forked from smc/mlmorph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verb.fst
48 lines (40 loc) · 2.24 KB
/
verb.fst
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
#include "symbols.fst"
% Verbs
$ADVERB$ = "<lexicon/adverbs.a>"
$VSTEM$ = "<lexicon/verbs.a>"
$TENSES$ = "<vinfl/tense.a>"
$MOODS$ = "<vinfl/moods/moods.a>"
$ASPECTS$ = "<vinfl/aspects/aspects.a>"
$CONJUNCTION$ = "<lexicon/conjunctions.a>"
$POLARITY$ = "<lexicon/polarity.a>"
$PASSIVEVOICE$ = "<vinfl/voices/passive.a>"
$CAUSATIVEVOICE$ = "<vinfl/voices/causative.a>"
$ADVERBSTEMS$ = "<vinfl/adverbs/adverbs.a>"
$VERBQUESTIONS$ = "<vinfl/verb-polar-question.a>"
$VSTEM-PASSIVE$ = $VSTEM$ <passive-voice> || $PASSIVEVOICE$
$VSTEM-CAUSATIVE$ = $VSTEM$ <causative-voice> || $CAUSATIVEVOICE$
$VSTEM$ = $VSTEM$ | $VSTEM-PASSIVE$ <RB> | $VSTEM-CAUSATIVE$ <RB>
$VERB-PREFIX$ = $ADVERB$? $VSTEM$ [#vinfl#]? $CONJUNCTION$* $POLARITY$?
$VERB-TENSES$ = $VERB-PREFIX$ || $TENSES$
$VERB-MOODS$ = $VERB-PREFIX$ || $MOODS$
$VERB-ASPECTS$ = $VERB-PREFIX$ || $ASPECTS$
$VERB-ADVERBS$ = ( $VSTEM$ [#adv#] $POLARITY$? ) || $ADVERBSTEMS$
% For the output of aspects, apply adv-clause-rp-past, but limit it only for the outputs ending with ു
% Example: പാടിയിരുന്നു->പാടിയിരുന്ന, വന്നുകൊണ്ടിരുന്നു->വന്നുകൊണ്ടിരുന്ന
$ENDS_WITH_U_FILTER$ = [#Letters##POS##BM##Numbers##TMP##vinfl#]+ ു [#POS##BM##Numbers##TMP##vinfl#]+
$VERB-ADVERBS-FROM-INFLECTIONS$ = ( $VERB-ASPECTS$ || $ENDS_WITH_U_FILTER$ ) <RB> <adv-clause-rp-past> || $ADVERBSTEMS$
$VERB-ADVERBS$ = $VERB-ADVERBS$ | $VERB-ADVERBS-FROM-INFLECTIONS$
$VERB$ = $VERB-TENSES$ | $VERB-MOODS$ | $VERB-ASPECTS$
$VERB_QUESTIONS$ = $VERB$ [<qn>] || $VERBQUESTIONS$
$VERB$ = $VERB$ | $VERB_QUESTIONS$
% The only agglutination scenario for verbs is when adverbs appears such as മുൻവിനയെച്ചം.
$VERB$ = $VERB$ | ( $VERB-ADVERBS$+ $VERB$?)
$VERB-ADVERBS$ >> "verb-adverbs.a"
% Tests
$tests$ = (ചിരിക്കുക<v><RB> | വായിക്കുക<v><RB> ) [#vinfl#]
( $tests$ || $ASPECTS$ || $ENDS_WITH_U_FILTER$ ) <RB> [<adv-clause-rp-past>] || $ADVERBSTEMS$ >> "verb.test.a"
$VSTEM-PASSIVE$ >> "vstem-passive.test.a"
$VSTEM-CAUSATIVE$ >> "vstem-causative.test.a"
$VERB-ADVERBS-FROM-INFLECTIONS$ >> "verb-adverbs.test.a"
ചിരിക്കുക<v><RB> [#vinfl#]? || $ASPECTS$ >> "vstem-aspects.a"
$VERB$