summaryrefslogtreecommitdiff
path: root/next-lib/src/bulgarian/MorphoBul.gf
blob: f59d783c8e30d7d6e14a03e5669f86c0f98725c3 (plain)
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
--# -path=.:../../prelude

--1 A Simple English Resource Morphology
--
-- Aarne Ranta 2002 -- 2005
--
-- This resource morphology contains definitions needed in the resource
-- syntax. To build a lexicon, it is better to use $ParadigmsEng$, which
-- gives a higher-level access to this module.

resource MorphoBul = ResBul ** open
  Predef,
  Prelude,
  CatBul
  in {
  flags coding=cp1251 ;


  flags optimize=all ;

oper
--2 Determiners

  mkDeterminerSg : Str -> Str -> Str -> {s : Bool => DGender => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako ->
    {s = \\_,g,_ => table DGender [vseki;vseki;vsiaka;vsiako] ! g; n = Sg; countable = False; spec = Indef} ;
  mkDeterminerPl : Str -> {s : Bool => DGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki ->
    {s = \\_,_,_ => vsicki; sp = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ;

  mkQuant : Str -> Str -> Str -> Str -> {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} = \tozi,tazi,towa,tezi -> 
    { s = \\_ => table {
                   ASg Masc _    => tozi ;
                   ASgMascDefNom => tozi ;
                   ASg Fem  _    => tazi ;
                   ASg Neut _    => towa ;
                   APl      _    => tezi
                   } ;
      nonEmpty = True ;
      spec = Indef
    } ;

--2 Verbs

  mkVerb : (_,_,_,_,_,_,_,_,_:Str) -> VTable = 
    \cheta,chete,chetoh,chetqh,chel,chetql,cheten,chetqst,cheti ->
        table {
          VPres      Sg P1 => cheta;
          VPres      Sg P2 => chete + "ø";
          VPres      Sg P3 => chete;
          VPres      Pl P1 => case chete of {
                                _ + ("à"|"ÿ") => chete + "ìå";
                                _             => chete + "ì"
                              };
          VPres      Pl P2 => chete + "òå";
          VPres      Pl P3 => case cheta of {
                                vika + "ì" => case chete of {
                                                dad + "å" => dad + "àò";
                                                vika      => vika + "ò"
                                              };
                                _          => cheta + "ò"
                              };
          VAorist    Sg P1 => chetoh;
          VAorist    Sg _  => case chetoh of {
                                chet+"îõ" => chete;
                                zova+ "õ" => zova
                              };
          VAorist    Pl P1 => chetoh + "ìå";
          VAorist    Pl P2 => chetoh + "òå";
          VAorist    Pl P3 => chetoh + "à";
          VImperfect Sg P1 => chetqh;
          VImperfect Sg _  => case chete of {
	                        rabot + "è" => rabot + "eøå";
	                        _           => chete + "øå"
                              };
          VImperfect Pl P1 => chetqh + "ìå";
          VImperfect Pl P2 => chetqh + "òå";
          VImperfect Pl P3 => chetqh + "à";
          VPerfect aform   =>let chel1 : Str =
                                   case chel of {
                                     pas+"úë" => pas+"ë";
                                     _        => chel
                                   }
                             in (mkAdjective chel
                                             (chel+"èÿ")
                                             (chel+"èÿò")
                                             (chel1+"a")
                                             (chel1+"àòà")
                                             (chel1+"î")
                                             (chel1+"îòî")
                                             (ia2e chel1+"è")
                                             (ia2e chel1+"èòå")).s ! aform ;
          VPluPerfect aform => regAdjective chetql  ! aform ;
          VPassive    aform => regAdjective cheten  ! aform ;
          VPresPart   aform => regAdjective chetqst ! aform ;
          VImperative Sg => cheti;
          VImperative Pl => case cheti of {
	                      chet + "è" => chet + "åòå";
	                      ela        => ela  + "òå"
                            };
          VGerund => case chete of {
                       rabot + "è" => rabot + "åéêè";
                       _           => chete + "éêè"
                     }
        } ;


--2 Nouns

  mkNoun : Str -> Str -> Str -> Str -> DGender -> N = \sg,pl,count,voc,g -> {
    s = table {
          NF Sg Indef => sg ;
          NF Sg Def   => case sg of {
                           _+"à"=>sg+"òà" ;
                           _+"ÿ"=>sg+"òà" ;
                           _+"î"=>sg+"òî" ;
                           _+"å"=>sg+"òî" ;
                           _+"è"=>sg+"òî" ;
                           s+"é"=>s +"ÿ"  ;
                           _+("òåë"|"àð"|"ÿð"|"äåí"
                             |"ïúò"|"îãúí"|"ñúí"
                             |"êîí"|"êðàë"|"öàð"
                             |"çåò"|"ëàêúò"|"íîêúò")
                                =>sg +"ÿ" ;
                           _    =>case g of {
                                    DFem => sg+"òà" ;
                                    _    => sg+"à"
                                  }
                         } ;
          NF Pl Indef => pl ;
          NF Pl Def   => case pl of {
                           _+"à"=>pl+"òà" ;
                           _+"å"=>pl+"òå" ;
                           _+"è"=>pl+"òå" ;
                           s+"ÿ"=>s +"òà" ;
                           s    =>s +"òå"
                         } ;
          NFSgDefNom  => case sg of {
                           _+"à"=>sg+"òà" ;
                           _+"ÿ"=>sg+"òà" ;
                           _+"î"=>sg+"òî" ;
                           _+"å"=>sg+"òî" ;
                           _+"è"=>sg+"òî" ;
                           s+"é"=>s +"ÿò" ;
                           _+("òåë"|"àð"|"ÿð"|"äåí"
                             |"ïúò"|"îãúí"|"ñúí"
                             |"êîí"|"êðàë"|"öàð"
                             |"çåò"|"ëàêúò"|"íîêúò")
                                =>sg+"ÿò" ;
                           _    =>case g of {
                                    DFem => sg+"òà" ;
                                    _    => sg+"úò"
                                  }
                         } ;
          NFPlCount   => count ;
          NFVocative  => voc
        } ;
    g = g ;
    lock_N = <>
    } ;


--2 Adjectives
    
  mkAdjective : (_,_,_,_,_,_,_,_,_ : Str) -> A = 
          \dobyr,dobria,dobriat,dobra,dobrata,dobro,dobroto,dobri,dobrite -> {
    s = table {
          ASg Masc Indef => dobyr ;
          ASg Masc Def   => dobria ;
          ASgMascDefNom  => dobriat ;
          ASg Fem  Indef => dobra ;
          ASg Fem  Def   => dobrata ;
          ASg Neut Indef => dobro ;
          ASg Neut Def   => dobroto ;
          APl Indef      => dobri ;
          APl Def        => dobrite
        } ;
    adv = dobro ;
    lock_A = <>
    } ;
}