Inflection

The morphology of a word is given by a pattern, which is composed of a set of transforms, that is in turn composed of rules and produces a form described as a prototype. To give a simple example we will look at how we represent that English nouns form their plural in "s"

:english_noun a lemon:MorphPattern ;
  lemon:transform [
    lemon:rule "~s" ;
    lemon:generates [
      isocat:number isocat:plural
    ]
  ] .
Example 64

This gives a pattern, with a single rule defined as "˜s" that generates a prototype with the property number with value plural. The rules are specified in a simple manner where the tilde symbol represents the canonical form and then the “s” is simply appended. A lexical entry may be indicated to have a given morphological pattern by the pattern property as follows.

:cat lemon:pattern :english_noun
Example 65

The rule above is clearly not sufficient: for example for the word “cherry” it would generate the erroneous plural “cherrys.” Another rule can be added to handle this case, for example

:english_noun a lemon:MorphPattern ;
  lemon:transform [
    lemon:rule "~s" ;
    lemon:rule "~y/~ies" ;
    lemon:generates [
      isocat:number isocat:plural
    ] 
  ] .
Example 66

In this example the slash indicates the difference between the matcher and the replacer as such for the rule to applies the canonical form must first match the matcher and then the matched text is replaced with the replacer. The first rule has no matcher and so is assumed to match all canonical forms that aren't matched by a more specific rule.12 This rule is still not correct as it generates for “play” the form “plaies”. As such we should further modify the rule to check for a preceding vowel this is done as follows

:english_noun a lemon:MorphPattern ;
  lemon:transform [
    lemon:rule "~s" ;
    lemon:rule "~(<?![aeiou])y/~ies" ;
    lemon:generates [
      isocat:number isocat:plural
    ]
  ] .
Example 67

In fact, as this example may have hinted the underlying representation of the rules used by this module are in fact Perl-like regular expressions13. In fact as such an alternative rule that performs the same task "˜([ˆaeiou])y/˜$1ies"; note that here the penultimate constonant must be reintroduced as it gets removed by being matched, and this is done with "$1". We think it is clearer to state rules using the look-ahead and look-behind assertions (namely (?=X), (?!X), (<?=X), and (<?!X)), as they do not cause vowels to be lost. Another reason for prefering these zero-width assertions is that in implementation the tildes must be translated to (.*) and $1 respectively, and it makes it easier to do this if there are no groups on the left hand side.

The use of the tilde is useful is as it makes it easier to represent both prefices and suffices, for example consider the case of the German perfect participle, this is formed for regular weak verbs by prefixing “ge” and changing the inflectional suffix to “t”. We can model this as follows

:german_weak_verb a lemon:MorphPattern ;
  lemon:transform [
    lemon:rule "~e?n/ge~t" ;
    lemon:generates [
      isocat:tense isocat:past ;
      isocat:aspect isocat:perfective ;
      isocat:verbFormMood isocat:participle
     ]
   ] .
Example 68

Of course it is natural it is possible for a pattern to have multiple transforms and even for a transform to have multiple generations. For example, we shall show an example for Italian generating the present singular first and third person forms and then using the third person singular to get the singular imperative

:italian_are_verb a lemon:MorphPattern ;
  lemon:transform [
    lemon:rule "~are/~o" ;
    lemon:generates [
      isocat:tense isocat:present ;
      isocat:person isocat:firstPerson ;
      isocat:number isocat:singular
    ] 
  ] , [
    lemon:rule "~are/~a" ;
    lemon:generates [
       isocat:tense isocat:present ;
       isocat:person isocat:firstPerson ;
       isocat:number isocat:singular
     ] , [
       isocat:verbFormMoode isocat:imperative ;
       isocat:number isocat:singular
     ]
  ] .
Example 69

Sometimes the canonical form alone is not sufficient to generate all forms of the word, for this reason other forms must be used as the base for generating some forms, and these forms should be given in the lexicon. An example is German mixed verbs, for example “denken”, to think, that has an irregular past “dachte”. This form is the first (and third) person singular preterite, and the second person singular is created by adding “st” to this form. For these cases the onStem property is provided, for example:

:german_mixed_verb a lemon:MorphPattern ;
  lemon:transform [
    lemon:onStem [
      isocat:tense isocat:past ;
      isocat:verbFormMood isocat:indicative ;
      isocat:person isocat:firstPerson ;
      isocat:number isocat:singular
    ] ;
    lemon:rule "~st" ;
    lemon:generates [
      isocat:tense isocat:past ;
      isocat:verbFormMood isocat:indicative ;
      isocat:person isocat:secondPerson ;
      isocat:number isocat:singular
    ]
  ] .
Image liam-ex1
Example 70

For polysynthesis as in example 60,we introduce a property that indicates how multiple inflections can be composed called nextScope. So the inflections that compose the example are as follows14

:japanese_vowel_stem_verb a lemon:MorphPattern ;
  lemon:transform :causative_transform ,
                 :passive_transform ,
                 :negative_transform ,
                 :past_transform_on_negative .
                 
:causative_transform lemon:rule "~ru/~saseru" ;
  lemon:nextScope :passive_transform, :negative_transform ;
  lemon:generates [
    isocat:voice isocat:causativeVoice
  ] .
  
:passive_transform lemon:rule "~ru/~rareru" ;
  lemon:nextScope :negative_tranform ;
  lemon:generates [
    isocat:voice isocat:passiveVoice
  ] .
  
:negative_transform lemon:rule "~ru/~nai" ;
  lemon:nextScope :past_transform_on_negative ;
  lemon:generates [
    isocat:negative isocat:yes
  ] .
  
:past_transform_on_negative lemon:onStem [
     isocat:negative isocat:yes ;
     isocat:tense isocat:present 
   ] ;
   lemon:rule "~i/~katta" ;
   lemon:generates [
     isocat:negative isocat:yes ;
     isocat:tense isocat:past
   ] .
Image liam-ex2
Example 71

John McCrae 2012-07-31