;    mmorph, MULTEXT morphology tool
;    Version 2.3, October 1995
;    Copyright (c) 1994,1995 ISSCO/SUISSETRA, Geneva, Switzerland

; This file shows various constructs possible in the declarations.
; It is also an small example to show how Grammar and Spelling interact
; for the morphology of French adjectives.
; It makes no claim as for the linguistic soundness of the approach :-)

; declaration of lexical and surface alphabet
@ Alphabets

lexical	: a b c d e f g h i j k l m n o p q r s t u v w x y z       
	   " " "\"" "." "," "?" "!"

surface	: a b c d e f g h i j k l m n o p q r s t u v w x y z        
	  " " "\"" "." "," "?" "!"

; Declarations of attribute with their possible values
@ Attributes
    gender : masculine feminine none
    number : singular plural none
    person : 1 2 3
    form : stem surface

; Declarations of category types with their associated attribute list
; the bar | separates the attributes to keep from those to throw away
@ Types
    Adjective : gender number | form
    Noun : gender number | form
    AdjSuffix : gender number
    NounSuffix : number

; Composition rules
@ Grammar

SurfaceA : Adjective[form=surface]


Plural : Adjective[ gender=$1 number=plural form=surface ]
	 <- Adjective[number=singular gender=$1]
	    AdjSuffix[number=plural]

s	:  "s" AdjSuffix[number=plural gender=none]


; make females out of males
Feminine : Adjective[ gender=feminine number=singular form=$A=surface|stem]
	    <- Adjective[gender=masculine number=singular form=$A]
	       AdjSuffix[gender=feminine]

e	:   "e" AdjSuffix[gender=feminine number=none]

@ Classes

Vowel :	a e i o u y

Punct : " " "." "\"" "," "?" "!"

Vowel_not_a :	e i o u y

Consonnant: b c d f g h j k l m n p q r s t v w x z

cs :	c s

@ Pairs

; showing explicit pair declarations
Vowel1:    a / a
	   e / e
           i / i

; abbreviated notation
Consonnant2:  c
              d

; question mark indicates any match (its like the = found in some literature)
SurfaceVowel:
	    Vowel/?

Double_n_s_t:  " " / " "
	       <t t> / t
	       <s s> / s
	       <n n> / n

Double_l:   <l l> / l

s_x:   s x

Insert_d:   d / <>

Insert_e:   e / <>

Delete_s:  <>/s

Boundary: <>/?	; hack to match either morpheme (+) or word (~) boundary

@ Spelling

; grosse/gros+e
Double : <=>
    Vowel - Double_n_s_t - * e
;   Vowel - Double_n_s_t - * e Boundary

; nulle/nul+e
Double_l: <=>
    Vowel_not_a - Double_l - * e

; creux/creux+s
Delete_s: <=>
    s_x * - Delete_s - ~

; test
test: <=>
    a * - " " /" " - ~

; gaux/gal+s
al_aux: <=>
   a - u/l * x/s - ~

; creuse/creux+e
eux_euse: <=>
    e u - s/x - * e

; belle/beau+e
eau_elle: <=>
    e - l/a l/u - * ?/e

; beaux/beau+s
au_aux: <=>
    a/? u/? * - x/s - ~

; esquimaude/esquimau+e
au_aude: <=>
    a u * - Insert_d - ?/e

; Lexical entries (stems and also some surface forms)
@ Lexicon

Adjective[ gender=masculine number=singular form=surface ]
"beau"
"gal"
"bas"
"sot"
"creux"
"bon"
"nul"
"esquimau"
