File: example

package info (click to toggle)
mmorph 2.3.4.2-9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 920 kB
  • ctags: 904
  • sloc: ansic: 4,992; yacc: 1,215; lex: 417; makefile: 295; sh: 48; sed: 33; csh: 26
file content (148 lines) | stat: -rw-r--r-- 2,991 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
;    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"