mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Latvian RG: approaching RGL API
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
--# -path=.:alltenses:prelude:../latvian
|
||||
|
||||
resource CombinatorsLav = Combinators with
|
||||
resource CombinatorsLav = Combinators with
|
||||
(Cat = CatLav),
|
||||
(Structural = StructuralLav),
|
||||
(Constructors = ConstructorsLav) ;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
--# -path=.:alltenses:prelude:../latvian
|
||||
|
||||
resource ConstructorsLav = Constructors with (Grammar = GrammarLav) ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
--# -path=.:alltenses:prelude:../latvian
|
||||
|
||||
instance SyntaxLav of Syntax =
|
||||
instance SyntaxLav of Syntax =
|
||||
ConstructorsLav, CatLav, StructuralLav, CombinatorsLav ;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
--# -path=.:alltenses:prelude:../latvian
|
||||
|
||||
resource TryLav = SyntaxLav-[mkAdN], LexiconLav, ParadigmsLav - [mkAdv,mkAdN,mkOrd,mkQuant] **
|
||||
resource TryLav = SyntaxLav-[mkAdN], LexiconLav, ParadigmsLav - [mkAdv,mkAdN,mkOrd,mkQuant] **
|
||||
open (P = ParadigmsLav) in {
|
||||
|
||||
oper
|
||||
|
||||
@@ -1,80 +1,39 @@
|
||||
concrete AdjectiveLav of Adjective = CatLav ** open ResLav, StructuralLav, Prelude in {
|
||||
flags
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete AdjectiveLav of Adjective = CatLav ** open
|
||||
ResLav,
|
||||
StructuralLav,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
PositA a = { s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) } ;
|
||||
ComparA a np = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) ++ "par" ++ np.s ! Acc ; } |
|
||||
{ s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) ++ "nekā" ++ np.s ! Nom ; };
|
||||
UseComparA a = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) } ;
|
||||
lin
|
||||
PositA a = { s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) } ;
|
||||
|
||||
ComplA2 a np = {
|
||||
s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ np.s ! (a.p.c ! (fromAgr np.a).n) ;
|
||||
} ;
|
||||
|
||||
ReflA2 a = {
|
||||
s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ reflPron ! (a.p.c ! n) ;
|
||||
} ;
|
||||
ComparA a np = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) ++ "par" ++ np.s ! Acc } |
|
||||
{ s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) ++ "nekā" ++ np.s ! Nom } ;
|
||||
|
||||
AdAP ada ap = { s = \\d,g,n,c => ada.s ++ ap.s ! d ! g ! n ! c ; } ;
|
||||
|
||||
SentAP ap sc = { --FIXME - te vajag apstākļa vārdu nevis īpašības vārdu! Kuru nevar normāli no AP dabūt
|
||||
s = \\d,g,n,c => ap.s ! d ! g ! n ! c ++ "," ++ sc.s ;
|
||||
} ;
|
||||
UseComparA a = { s = \\d,g,n,c => a.s ! (AAdj Compar d g n c) } ;
|
||||
|
||||
AdjOrd ord = {
|
||||
s = \\d,g,n,c => ord.s ! g ! c ; --FIXME - skaitļa agreement? noteiktība?
|
||||
} ;
|
||||
ComplA2 a np = {
|
||||
s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ np.s ! (a.p.c ! (fromAgr np.a).n)
|
||||
} ;
|
||||
|
||||
CAdvAP cadv ap np = {
|
||||
s = \\d,g,n,c => cadv.s ++ ap.s ! d ! g ! n ! c ++ cadv.p ++ np.s ! Nom ; --TODO nominatīvs var ne vienmēr būt, pie tā CAdv jāliek parametrs par locījumu
|
||||
} ;
|
||||
ReflA2 a = { s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ++ a.p.s ++ reflPron ! (a.p.c ! n) } ;
|
||||
|
||||
UseA2 a = {
|
||||
s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) ;
|
||||
} ;
|
||||
{-
|
||||
PositA a = {
|
||||
s = \\_ => a.s ! AAdj Posit Nom ;
|
||||
isPre = True
|
||||
} ;
|
||||
ComparA a np = {
|
||||
s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! Nom ;
|
||||
isPre = False
|
||||
} ;
|
||||
UseComparA a = {
|
||||
s = \\_ => a.s ! AAdj Compar Nom ;
|
||||
isPre = True
|
||||
} ;
|
||||
AdAP ada ap = { s = \\d,g,n,c => ada.s ++ ap.s ! d ! g ! n ! c } ;
|
||||
|
||||
AdjOrd ord = {
|
||||
s = \\_ => ord.s ! Nom ;
|
||||
isPre = True
|
||||
} ;
|
||||
-- FIXME: te vajag apstākļa vārdu nevis īpašības vārdu! bet apst.v. nevar normāli no AP dabūt
|
||||
SentAP ap sc = { s = \\d,g,n,c => ap.s ! d ! g ! n ! c ++ "," ++ sc.s } ;
|
||||
|
||||
CAdvAP ad ap np = {
|
||||
s = \\a => ad.s ++ ap.s ! a ++ ad.p ++ np.s ! Nom ;
|
||||
isPre = False
|
||||
} ;
|
||||
-- FIXME: skaitļa agreement? noteiktība?
|
||||
AdjOrd ord = { s = \\d,g,n,c => ord.s ! g ! c } ;
|
||||
|
||||
ComplA2 a np = {
|
||||
s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! Acc ;
|
||||
isPre = False
|
||||
} ;
|
||||
--TODO: nominatīvs var ne vienmēr būt, pie CAdv jāliek parametrs par locījumu
|
||||
CAdvAP cadv ap np = { s = \\d,g,n,c => cadv.s ++ ap.s ! d ! g ! n ! c ++ cadv.p ++ np.s ! Nom } ;
|
||||
|
||||
ReflA2 a = {
|
||||
s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ;
|
||||
isPre = False
|
||||
} ;
|
||||
UseA2 a = { s = \\d,g,n,c => a.s ! (AAdj Posit d g n c) } ;
|
||||
|
||||
AdAP ada ap = {
|
||||
s = \\a => ada.s ++ ap.s ! a ;
|
||||
isPre = ap.isPre
|
||||
} ;
|
||||
|
||||
UseA2 a = {
|
||||
s = \\_ => a.s ! AAdj Posit Nom ;
|
||||
isPre = True
|
||||
} ;
|
||||
-}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,34 @@
|
||||
concrete AdverbLav of Adverb = CatLav ** open ResLav, Prelude in {
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
lin
|
||||
|
||||
PositAdvAdj a = {s = a.s ! (AAdv Posit)} ;
|
||||
|
||||
ComparAdvAdj cadv a np = {
|
||||
s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ np.s ! Nom -- TODO vajag arî 'âtrâks par Jâni' un 'âtrâks nekâ Jânis' pie more_CAdv
|
||||
-- TODO - vai te tieðâm veido 'âtrâk par Jâni', kas ir pareizais adverbs? nevis 'âtrâks par jâni'...
|
||||
} ;
|
||||
ComparAdvAdjS cadv a s = {
|
||||
s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ s.s
|
||||
} ;
|
||||
concrete AdverbLav of Adverb = CatLav ** open
|
||||
ResLav,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
PrepNP prep np = {s = prep.s ++ np.s ! (prep.c ! (fromAgr np.a).n)} ; --FIXME - postpozîcijas prievârdi
|
||||
flags
|
||||
coding = utf8 ;
|
||||
|
||||
AdAdv = cc2 ;
|
||||
SubjS = cc2 ;
|
||||
lin
|
||||
PositAdvAdj a = { s = a.s ! (AAdv Posit) } ;
|
||||
|
||||
-- TODO: vajag arī 'ātrāks par Jāni' un 'ātrāks nekā Jānis' pie more_CAdv
|
||||
-- TODO: vai te tiešām veido 'ātrāk par Jāni'? kurš ir pareizais adverbs? nevis 'ātrāks par Jāni'?
|
||||
ComparAdvAdj cadv a np = { s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ np.s ! Nom } ;
|
||||
|
||||
ComparAdvAdjS cadv a s = { s = cadv.s ++ a.s ! (AAdv cadv.d) ++ cadv.p ++ s.s } ;
|
||||
|
||||
-- FIXME: postpozīcijas prievārdi
|
||||
PrepNP prep np = { s = prep.s ++ np.s ! (prep.c ! (fromAgr np.a).n) } ;
|
||||
|
||||
AdAdv = cc2 ;
|
||||
|
||||
SubjS = cc2 ;
|
||||
|
||||
AdnCAdv cadv = {
|
||||
s = case cadv.d of {
|
||||
Posit => cadv.s ++ cadv.p ;
|
||||
_ => NON_EXISTENT
|
||||
}
|
||||
} ;
|
||||
|
||||
AdnCAdv cadv = {
|
||||
s = case cadv.d of {
|
||||
Posit => cadv.s ++ cadv.p;
|
||||
_ => NON_EXISTENT
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete AllLav of AllLavAbs =
|
||||
concrete AllLav of AllLavAbs =
|
||||
LangLav,
|
||||
{- IrregLav-[
|
||||
blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V,
|
||||
sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V], -}
|
||||
ExtraLav
|
||||
** {} ;
|
||||
** {
|
||||
|
||||
flags
|
||||
coding = utf8 ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
abstract AllLavAbs =
|
||||
abstract AllLavAbs =
|
||||
Lang,
|
||||
{- IrregLavAbs-[
|
||||
blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V,
|
||||
sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V], -}
|
||||
ExtraLavAbs
|
||||
** {} ;
|
||||
** {}
|
||||
|
||||
@@ -1,142 +1,84 @@
|
||||
concrete CatLav of Cat = CommonX - [CAdv, Voc] ** open ResLav, Prelude in {
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
flags optimize=all_subs ;
|
||||
concrete CatLav of Cat = CommonX - [CAdv, Voc] ** open
|
||||
ResLav,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
lincat
|
||||
S = {s : Str} ;
|
||||
QS = {s : Str} ;
|
||||
RS = {s : Agr => Str} ; -- ; c : Case c for it clefts
|
||||
SSlash = {s : Str; p : Prep};
|
||||
|
||||
N = {s : Number => Case => Str ; g : Gender} ;
|
||||
N2 = {s : Number => Case => Str ; g : Gender} ** {p : Prep; isPre : Bool}; -- case / preposition used. if isPre, then located before the noun.
|
||||
N3 = {s : Number => Case => Str ; g : Gender} ** {p1,p2 : Prep; isPre1, isPre2 : Bool};
|
||||
PN = {s : Case => Str ; g : Gender; n : Number} ;
|
||||
A = {s : AForm => Str };
|
||||
A2 = A ** {p : Prep};
|
||||
V, VQ, VA, VV = Verb ;
|
||||
VS = Verb ** {subj : Subj} ;
|
||||
V2, V2A, V2Q, V2V = Verb ** {p : Prep} ; -- TODO - valence, pieòemam ka viena; bûtu jânorâda semantika - integrçt ar FrameNet?
|
||||
V2S = Verb ** {p : Prep; subj : Subj} ;
|
||||
V3 = Verb ** {p1, p2 : Prep} ;
|
||||
|
||||
Pron = {s : Case => Str ; a : ResLav.Agr; possessive : Gender => Number => Case => Str} ;
|
||||
Conj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = {s : Str; c : Number => Case} ; -- e.g. 'ar' + Sg-Acc or Pl-Dat; Preposition may be empty [] for simple case-based valences
|
||||
-- TODO - pozîcija nav noteikta; daþi ir pirms daþi pçc
|
||||
|
||||
Cl = {s : VerbMood => Polarity => Str} ;
|
||||
ClSlash = {s : VerbMood => Polarity => Str; p : Prep};
|
||||
|
||||
Imp = {s : Polarity => Number => Str} ;
|
||||
|
||||
QCl = {s : VerbMood => Polarity => Str} ;
|
||||
IP = {s : Case => Str; n: Number };
|
||||
IQuant = {s : Gender => Number => Str} ;
|
||||
IDet = {s : Gender => Str ; n : Number} ;
|
||||
flags
|
||||
coding = utf8 ;
|
||||
optimize = all_subs ;
|
||||
|
||||
RCl = {s : VerbMood => Polarity => Agr => Str} ;
|
||||
RP = {s : Case => Str} ;
|
||||
|
||||
CN = {s : Definite => Number => Case => Str ; g : Gender} ;
|
||||
Det = {s : Gender => Case => Str ; n : Number ; d: Definite} ;
|
||||
Predet = {s : Gender => Str} ;
|
||||
Quant = {s : Gender => Number => Case => Str ; d: Definite} ;
|
||||
Card = { s : Gender => Case => Str ; n: Number} ;
|
||||
Ord = { s : Gender => Case => Str } ;
|
||||
NP = {s : Case => Str ; a : ResLav.Agr} ;
|
||||
AP = {s : Definite => Gender => Number => Case => Str} ;
|
||||
VP = ResLav.VP;
|
||||
VPSlash = VP ** {p : Prep};
|
||||
Comp = {s : ResLav.Agr => Str} ;
|
||||
|
||||
Num = {s : Gender => Case => Str ; n : Number ; hasCard : Bool} ;
|
||||
Numeral = {s : CardOrd => Gender => Case => Str ; n : Number} ;
|
||||
Digits = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
CAdv = { s : Str; p : Str; d: Degree } ;
|
||||
{-
|
||||
-- Tensed/Untensed
|
||||
lincat
|
||||
-- Tensed/Untensed
|
||||
S = { s : Str } ;
|
||||
QS = { s : Str } ;
|
||||
RS = { s : Agr => Str } ; -- Eng: c : Case -- c for it clefts
|
||||
SSlash = { s : Str ; p : Prep } ;
|
||||
|
||||
S = {s : Str} ;
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
|
||||
SSlash = {s : Str ; c2 : Str} ;
|
||||
-- Sentence
|
||||
Cl = { s : VerbMood => Polarity => Str } ;
|
||||
ClSlash = { s : VerbMood => Polarity => Str ; p : Prep } ;
|
||||
Imp = { s : Polarity => Number => Str } ;
|
||||
|
||||
-- Sentence
|
||||
-- Question
|
||||
QCl = { s : VerbMood => Polarity => Str } ;
|
||||
IP = { s : Case => Str ; n: Number } ;
|
||||
--IComp = { s : Str } ;
|
||||
IDet = { s : Gender => Str ; n : Number } ;
|
||||
IQuant = { s : Gender => Number => Str } ;
|
||||
|
||||
Cl = {s : ResEng.Tense => Anteriority => CPolarity => Order => Str} ;
|
||||
ClSlash = {
|
||||
s : ResEng.Tense => Anteriority => CPolarity => Order => Str ;
|
||||
c2 : Str
|
||||
} ;
|
||||
Imp = {s : CPolarity => ImpForm => Str} ;
|
||||
-- Relative
|
||||
RCl = { s : VerbMood => Polarity => Agr => Str } ;
|
||||
RP = { s : Gender => Case => Str } ;
|
||||
|
||||
-- Question
|
||||
-- Verb
|
||||
VP = ResLav.VP ;
|
||||
VPSlash = ResLav.VP ** { p : Prep } ;
|
||||
Comp = { s : ResLav.Agr => Str } ;
|
||||
|
||||
QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ;
|
||||
IP = {s : Case => Str ; n : Number} ;
|
||||
IComp = {s : Str} ;
|
||||
IDet = {s : Str ; n : Number} ;
|
||||
IQuant = {s : Number => Str} ;
|
||||
-- Adjective
|
||||
AP = { s : Definite => Gender => Number => Case => Str } ;
|
||||
|
||||
-- Relative
|
||||
-- Noun
|
||||
CN = { s : Definite => Number => Case => Str ; g : Gender } ;
|
||||
NP = { s : Case => Str ; a : ResLav.Agr } ;
|
||||
Pron = { s : Case => Str ; a : ResLav.Agr ; possessive : Gender => Number => Case => Str } ;
|
||||
Det = { s : Gender => Case => Str ; n : Number ; d : Definite } ;
|
||||
Predet = { s : Gender => Str } ;
|
||||
Ord = { s : Gender => Case => Str } ;
|
||||
Num = { s : Gender => Case => Str ; n : Number ; hasCard : Bool } ;
|
||||
Card = { s : Gender => Case => Str ; n : Number } ;
|
||||
Quant = { s : Gender => Number => Case => Str ; d : Definite } ;
|
||||
|
||||
RCl = {
|
||||
s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ;
|
||||
c : Case
|
||||
} ;
|
||||
-- Numeral
|
||||
Numeral = { s : CardOrd => Gender => Case => Str ; n : Number } ;
|
||||
Digits = { s : CardOrd => Str ; n : Number } ;
|
||||
|
||||
-- Verb
|
||||
-- Structural
|
||||
Conj = { s1, s2 : Str ; n : Number } ;
|
||||
Subj = { s : Str } ;
|
||||
Prep = { s : Str ; c : Number => Case } ;
|
||||
-- e.g. 'ar' + Sg-Acc or Pl-Dat; preposition may be empty ([]) for case-based valences
|
||||
-- TODO: pozīcija (pre/post) nav noteikta
|
||||
|
||||
VP = ResEng.VP ;
|
||||
VPSlash = ResEng.VP ** {c2 : Str} ;
|
||||
Comp = {s : Agr => Str} ;
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
N = { s : Number => Case => Str ; g : Gender } ;
|
||||
N2 = { s : Number => Case => Str ; g : Gender } ** { p : Prep ; isPre : Bool } ;
|
||||
-- case/preposition used; if isPre, then located before the noun
|
||||
N3 = { s : Number => Case => Str ; g : Gender } ** { p1, p2 : Prep ; isPre1, isPre2 : Bool } ;
|
||||
PN = { s : Case => Str ; g : Gender ; n : Number } ;
|
||||
|
||||
-- Adjective
|
||||
A = { s : AForm => Str } ;
|
||||
A2 = A ** { p : Prep } ;
|
||||
|
||||
AP = {s : Agr => Str ; isPre : Bool} ;
|
||||
V, VQ, VA, VV = Verb ;
|
||||
VS = Verb ** { subj : Subj } ;
|
||||
V2, V2A, V2Q, V2V = Verb ** { p : Prep } ;
|
||||
V2S = Verb ** { p : Prep ; subj : Subj } ;
|
||||
V3 = Verb ** { p1, p2 : Prep } ;
|
||||
-- TODO: pieņemam ka viena valence; būtu jānorāda semantika - integrēt ar FrameNet
|
||||
|
||||
-- Noun
|
||||
CAdv = { s, p : Str ; d : Degree } ;
|
||||
|
||||
CN = {s : Number => Case => Str ; g : Gender} ;
|
||||
NP = {s : Case => Str ; a : Agr} ;
|
||||
Pron = {s : Case => Str ; sp : Case => Str ; a : Agr} ;
|
||||
Det = {s : Str ; sp : Case => Str ; n : Number} ;
|
||||
Predet = {s : Str} ;
|
||||
Ord = { s : Case => Str } ;
|
||||
Num = {s : Case => Str ; n : Number ; hasCard : Bool} ;
|
||||
Card = {s : Case => Str ; n : Number} ;
|
||||
Quant = {s : Bool => Number => Str ; sp : Bool => Number => Case => Str} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
Numeral = {s : CardOrd => Case => Str ; n : Number} ;
|
||||
Digits = {s : CardOrd => Case => Str ; n : Number ; tail : DTail} ;
|
||||
|
||||
-- Structural
|
||||
|
||||
Conj = {s1,s2 : Str ; n : Number} ;
|
||||
---b Conj = {s : Str ; n : Number} ;
|
||||
---b DConj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = {s : Str} ;
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ;
|
||||
V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ;
|
||||
V3 = Verb ** {c2, c3 : Str} ;
|
||||
VV = {s : VVForm => Str ; isAux : Bool} ;
|
||||
V2V = Verb ** {c2 : Str ; isAux : Bool} ;
|
||||
|
||||
A = {s : AForm => Str} ;
|
||||
A2 = {s : AForm => Str ; c2 : Str} ;
|
||||
|
||||
N = {s : Number => Case => Str ; g : Gender} ;
|
||||
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ;
|
||||
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ;
|
||||
PN = {s : Case => Str ; g : Gender} ;
|
||||
-}
|
||||
}
|
||||
|
||||
16
lib/src/latvian/CompatibilityLav.gf
Normal file
16
lib/src/latvian/CompatibilityLav.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete CompatibilityLav of Compatibility = CatLav ** open
|
||||
Prelude,
|
||||
ResLav
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
-- TODO: kāpēc citās valodās (piem., Eng, Bul) kategorijai Num (NumInt) ir lauks isNum (= True)?
|
||||
NumInt n = { s = \\_,_ => n.s ; n = Pl ; hasCard = False } ;
|
||||
OrdInt n = { s = \\_,_ => n.s ++ "." } ;
|
||||
|
||||
}
|
||||
@@ -1,43 +1,47 @@
|
||||
concrete ConjunctionLav of Conjunction =
|
||||
CatLav ** open ResLav, Coordination, Prelude in {
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
flags optimize=all_subs ;
|
||||
concrete ConjunctionLav of Conjunction = CatLav ** open
|
||||
Coordination,
|
||||
ResLav
|
||||
in {
|
||||
|
||||
lin
|
||||
flags
|
||||
optimize = all_subs ;
|
||||
coding = utf8 ;
|
||||
|
||||
ConjS = conjunctDistrSS ;
|
||||
lin
|
||||
ConjS = conjunctDistrSS ;
|
||||
|
||||
ConjAdv = conjunctDistrSS ;
|
||||
ConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||
a = toAgr (conjNumber (fromAgr ss.a).n conj.n) (fromAgr ss.a).p (fromAgr ss.a).g
|
||||
} ;
|
||||
ConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||
a = toAgr (conjNumber (fromAgr ss.a).n conj.n) (fromAgr ss.a).p (fromAgr ss.a).g
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctDistrTable4 Definite Gender Number Case conj ss;
|
||||
ConjAP conj ss = conjunctDistrTable4 Definite Gender Number Case conj ss ;
|
||||
|
||||
ConjRS conj ss = conjunctDistrTable Agr conj ss;
|
||||
ConjRS conj ss = conjunctDistrTable Agr conj ss ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
-- These fun's are generated from the list cat's:
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS comma ;
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS comma ;
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
|
||||
BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||
ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
|
||||
BaseAP x y = twoTable4 Definite Gender Number Case x y ;
|
||||
ConsAP xs x = consrTable4 Definite Gender Number Case comma xs x ;
|
||||
|
||||
BaseRS x y = twoTable Agr x y ;
|
||||
ConsRS xs x = consrTable Agr comma xs x ;
|
||||
BaseNP x y = twoTable Case x y ** { a = conjAgr x.a y.a } ;
|
||||
ConsNP xs x = consrTable Case comma xs x ** { a = conjAgr xs.a x.a } ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : Case => Str ; a : Agr} ;
|
||||
[AP] = {s1,s2 : Definite => Gender => Number => Case => Str } ;
|
||||
[RS] = {s1,s2 : Agr => Str } ;
|
||||
BaseAP x y = twoTable4 Definite Gender Number Case x y ;
|
||||
ConsAP xs x = consrTable4 Definite Gender Number Case comma xs x ;
|
||||
|
||||
BaseRS x y = twoTable Agr x y ;
|
||||
ConsRS xs x = consrTable Agr comma xs x ;
|
||||
|
||||
lincat
|
||||
[S] = { s1, s2 : Str } ;
|
||||
[Adv] = { s1, s2 : Str } ;
|
||||
[NP] = { s1, s2 : Case => Str ; a : Agr } ;
|
||||
[AP] = { s1, s2 : Definite => Gender => Number => Case => Str } ;
|
||||
[RS] = { s1, s2 : Agr => Str } ;
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,100 +1,8 @@
|
||||
concrete ExtraLav of ExtraLavAbs = CatLav **
|
||||
open ResLav, Coordination, Prelude, MorphoLav in {
|
||||
{-
|
||||
lin
|
||||
GenNP np = {s = \\_,_ => np.s ! Gen ; sp = \\_,_,_ => np.s ! Gen} ;
|
||||
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
StrandRelSlash rp slash = {
|
||||
s = \\t,a,p,ag =>
|
||||
rp.s ! RC (fromAgr ag).g Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||
c = Acc
|
||||
} ;
|
||||
EmptyRelSlash slash = {
|
||||
s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||
c = Acc
|
||||
} ;
|
||||
concrete ExtraLav of ExtraLavAbs = CatLav ** {
|
||||
|
||||
StrandQuestSlash ip slash =
|
||||
{s = \\t,a,b,q =>
|
||||
(mkQuestion (ss (ip.s ! Acc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
||||
};
|
||||
flags
|
||||
coding = utf8 ;
|
||||
|
||||
lincat
|
||||
VPI = {s : VPIForm => Agr => Str} ;
|
||||
[VPI] = {s1,s2 : VPIForm => Agr => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPI = twoTable2 VPIForm Agr ;
|
||||
ConsVPI = consrTable2 VPIForm Agr comma ;
|
||||
|
||||
MkVPI vp = {
|
||||
s = \\v,a => vp.ad ++ vp.inf ++ vp.s2 ! a
|
||||
} ;
|
||||
ConjVPI = conjunctDistrTable2 VPIForm Agr ;
|
||||
ComplVPIVV vv vpi =
|
||||
insertObj (\\a => (if_then_Str vv.isAux [] "to") ++ vpi.s ! VPIInf ! a) (predVV vv) ;
|
||||
|
||||
UncNegCl t p cl = {
|
||||
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! ODir
|
||||
} ;
|
||||
UncNegQCl t p cl = {
|
||||
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! q
|
||||
} ;
|
||||
UncNegRCl t p cl = {
|
||||
s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! r ;
|
||||
c = cl.c
|
||||
} ;
|
||||
|
||||
UncNegImpSg p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Sg False} ;
|
||||
UncNegImpPl p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Pl False} ;
|
||||
|
||||
CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ;
|
||||
|
||||
oper
|
||||
unc = contrNeg False ;
|
||||
|
||||
|
||||
lin
|
||||
that_RP =
|
||||
{ s = table {
|
||||
RC _ Gen => "whose" ;
|
||||
RC _ _ => "that" ;
|
||||
RPrep Neutr => "which" ;
|
||||
RPrep _ => "whom"
|
||||
} ;
|
||||
a = RNoAg
|
||||
} ;
|
||||
|
||||
each_Det = mkDeterminer Sg "each" ;
|
||||
|
||||
-- for VP conjunction
|
||||
|
||||
param
|
||||
VPIForm = VPIInf | VPIPPart ;
|
||||
|
||||
lincat
|
||||
VPS = {s : Agr => Str} ;
|
||||
[VPS] = {s1,s2 : Agr => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPS = twoTable Agr ;
|
||||
ConsVPS = consrTable Agr comma ;
|
||||
|
||||
PredVPS np vpi = {s = np.s ! Nom ++ vpi.s ! np.a} ;
|
||||
|
||||
MkVPS t p vp = {
|
||||
s = \\a =>
|
||||
let
|
||||
verb = vp.s ! t.t ! t.a ! contrNeg True p.p ! ODir ! a ;
|
||||
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
||||
in t.s ++ p.s ++ vp.ad ++ verbf ++ vp.s2 ! a
|
||||
} ;
|
||||
|
||||
ConjVPS = conjunctDistrTable Agr ;
|
||||
|
||||
ICompAP ap = {s = "how" ++ ap.s ! agrP3 Sg} ; ---- IComp should have agr!
|
||||
|
||||
IAdvAdv adv = {s = "how" ++ adv.s} ;
|
||||
-}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
abstract ExtraLavAbs = Extra - [ProDrop] ** {
|
||||
{-
|
||||
-- uncontracted negations; contracted are the default
|
||||
fun
|
||||
UncNegCl : Temp -> Pol -> Cl -> S ;
|
||||
UncNegQCl : Temp -> Pol -> QCl -> QS ;
|
||||
UncNegRCl : Temp -> Pol -> RCl -> RS ;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
UncNegImpSg : Pol -> Imp -> Utt; -- do not help yourself
|
||||
UncNegImpPl : Pol -> Imp -> Utt; -- do not help yourselves
|
||||
|
||||
-- freely compounded nouns
|
||||
|
||||
CompoundCN : CN -> CN -> CN ; -- rock album
|
||||
|
||||
that_RP : RP ; -- "that" as a relational pronoun (IdRP is "which" / "who")
|
||||
|
||||
each_Det : Det ;
|
||||
-}
|
||||
}
|
||||
abstract ExtraLavAbs = {}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete GrammarLav of Grammar =
|
||||
NounLav,
|
||||
VerbLav,
|
||||
concrete GrammarLav of Grammar =
|
||||
NounLav,
|
||||
VerbLav,
|
||||
AdjectiveLav,
|
||||
AdverbLav,
|
||||
NumeralLav,
|
||||
@@ -17,6 +17,9 @@ concrete GrammarLav of Grammar =
|
||||
TenseX - [CAdv]
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
flags
|
||||
startcat = Phr ;
|
||||
unlexer = text ;
|
||||
lexer = text ;
|
||||
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -1,88 +1,75 @@
|
||||
concrete IdiomLav of Idiom = CatLav ** open Prelude, ResLav, VerbLav, ParadigmsVerbsLav in {
|
||||
flags optimize=all_subs ;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
lin
|
||||
ImpersCl vp = let
|
||||
a = AgP3 Sg Masc
|
||||
in{
|
||||
concrete IdiomLav of Idiom = CatLav ** open
|
||||
Prelude,
|
||||
ResLav,
|
||||
VerbLav,
|
||||
ParadigmsVerbsLav
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8 ;
|
||||
optimize = all_subs ;
|
||||
|
||||
lin
|
||||
ImpersCl vp =
|
||||
let a = AgP3 Sg Masc
|
||||
in {
|
||||
s = \\mood,pol =>
|
||||
buildVerb vp.v mood pol a ++ -- Verb
|
||||
vp.s2 ! a -- Object(s), complements, adverbial modifiers;
|
||||
} ;
|
||||
|
||||
GenericCl vp = let
|
||||
a = AgP3 Sg Masc
|
||||
in{
|
||||
buildVerb vp.v mood pol a ++ -- Verb
|
||||
vp.s2 ! a -- Object(s), complements, adverbial modifiers
|
||||
} ;
|
||||
|
||||
GenericCl vp =
|
||||
let a = AgP3 Sg Masc
|
||||
in {
|
||||
s = \\mood,pol =>
|
||||
buildVerb vp.v mood pol a ++ -- Verb
|
||||
vp.s2 ! a -- Object(s), complements, adverbial modifiers;
|
||||
} ;
|
||||
|
||||
ExistNP np = let
|
||||
v = lin V mkVerb_toBe;
|
||||
a = np.a
|
||||
buildVerb vp.v mood pol a ++
|
||||
vp.s2 ! a
|
||||
} ;
|
||||
|
||||
ExistNP np =
|
||||
let
|
||||
v = lin V mkVerb_toBe ;
|
||||
a = np.a
|
||||
in {
|
||||
s = \\mood,pol =>
|
||||
buildVerb v mood pol a ++
|
||||
np.s ! Nom
|
||||
} ;
|
||||
|
||||
ExistIP ip =
|
||||
let
|
||||
v = lin V mkVerb_toBe ;
|
||||
a = AgP3 ip.n Masc
|
||||
in {
|
||||
s = \\mood,pol =>
|
||||
buildVerb v mood pol a ++ -- Verb
|
||||
np.s ! Nom
|
||||
} ;
|
||||
|
||||
ExistIP ip = let
|
||||
v = lin V mkVerb_toBe;
|
||||
a = AgP3 ip.n Masc
|
||||
in {
|
||||
s = \\mood,pol =>
|
||||
ip.s ! Nom ++
|
||||
buildVerb v mood pol a -- Verb
|
||||
} ;
|
||||
|
||||
ProgrVP v = v; -- FIXME - needs restriction so that only VerbMood Indicative _ _ Present is allowed; but can't do that on VP level..
|
||||
|
||||
ImpPl1 vp = let
|
||||
a = AgP1 Pl
|
||||
in {
|
||||
s =
|
||||
vp.v.s ! Pos ! (Indicative P1 Pl Pres) ++ -- Verb
|
||||
vp.s2 ! a -- Object(s), complements, adverbial modifiers;
|
||||
ip.s ! Nom ++
|
||||
buildVerb v mood pol a
|
||||
} ;
|
||||
|
||||
-- FIXME: needs restriction so that only VerbMood Indicative _ _ Present is allowed;
|
||||
-- can't do that on VP level...
|
||||
ProgrVP v = v ;
|
||||
|
||||
ImpPl1 vp =
|
||||
let a = AgP1 Pl
|
||||
in {
|
||||
s =
|
||||
vp.v.s ! Pos ! (Indicative P1 Pl Pres) ++ -- Verb
|
||||
vp.s2 ! a -- Object(s), complements, adverbial modifiers
|
||||
} | {
|
||||
s =
|
||||
vp.v.s ! Pos ! (Indicative P1 Pl Fut) ++ -- Verb
|
||||
vp.s2 ! a -- Object(s), complements, adverbial modifiers;
|
||||
};
|
||||
|
||||
ImpP3 np vp = {
|
||||
s = "lai" ++ np.s ! Nom ++ buildVerb vp.v (Ind Simul Pres) Pos np.a ++ vp.s2 ! np.a;
|
||||
};
|
||||
|
||||
--FIXME placeholder
|
||||
CleftNP np rs = { s = \\_,_ => NON_EXISTENT } ;
|
||||
CleftAdv ad s = { s = \\_,_ => NON_EXISTENT } ;
|
||||
{-
|
||||
ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
||||
|
||||
GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
||||
s =
|
||||
vp.v.s ! Pos ! (Indicative P1 Pl Fut) ++
|
||||
vp.s2 ! a
|
||||
} ;
|
||||
|
||||
CleftNP np rs = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => rs.s ! np.a)
|
||||
(insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
|
||||
ImpP3 np vp = {
|
||||
s = "lai" ++ np.s ! Nom ++ buildVerb vp.v (Ind Simul Pres) Pos np.a ++ vp.s2 ! np.a ;
|
||||
} ;
|
||||
|
||||
CleftAdv ad s = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => conjThat ++ s.s)
|
||||
(insertObj (\\_ => ad.s) (predAux auxBe))) ;
|
||||
-- FIXME: placeholder
|
||||
CleftNP np rs = { s = \\_,_ => NON_EXISTENT } ;
|
||||
CleftAdv ad s = { s = \\_,_ => NON_EXISTENT } ;
|
||||
|
||||
ExistNP np =
|
||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
(insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
|
||||
|
||||
ExistIP ip =
|
||||
mkQuestion (ss (ip.s ! Nom))
|
||||
(mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
|
||||
|
||||
ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
|
||||
|
||||
ImpPl1 vp = {s = "let's" ++ infVP True vp (AgP1 Pl)} ;
|
||||
|
||||
ImpP3 np vp = {s = "let" ++ np.s ! Acc ++ infVP True vp np.a} ;
|
||||
-}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
--# -path=.:prelude:../abstract:../common
|
||||
|
||||
concrete IrregLav of IrregLavAbs = CatLav ** open ParadigmsLav in {
|
||||
{-
|
||||
flags optimize=values ;
|
||||
|
||||
lin
|
||||
awake_V = irregV "awake" "awoke" "awoken" ;
|
||||
bear_V = irregV "bear" "bore" "born" ;
|
||||
beat_V = irregV "beat" "beat" "beat" ;
|
||||
become_V = irregV "become" "became" "become" ;
|
||||
begin_V = irregV "begin" "began" "begun" ;
|
||||
bend_V = irregV "bend" "bent" "bent" ;
|
||||
beset_V = irregV "beset" "beset" "beset" ;
|
||||
bet_V = irregDuplV "bet" "bet" "bet" ;
|
||||
bid_V = irregDuplV "bid" (variants {"bid" ; "bade"}) (variants {"bid" ; "bidden"}) ;
|
||||
bind_V = irregV "bind" "bound" "bound" ;
|
||||
bite_V = irregV "bite" "bit" "bitten" ;
|
||||
bleed_V = irregV "bleed" "bled" "bled" ;
|
||||
blow_V = irregV "blow" "blew" "blown" ;
|
||||
break_V = irregV "break" "broke" "broken" ;
|
||||
breed_V = irregV "breed" "bred" "bred" ;
|
||||
bring_V = irregV "bring" "brought" "brought" ;
|
||||
broadcast_V = irregV "broadcast" "broadcast" "broadcast" ;
|
||||
build_V = irregV "build" "built" "built" ;
|
||||
burn_V = irregV "burn" (variants {"burned" ; "burnt"}) (variants {"burned" ; "burnt"}) ;
|
||||
burst_V = irregV "burst" "burst" "burst" ;
|
||||
buy_V = irregV "buy" "bought" "bought" ;
|
||||
cast_V = irregV "cast" "cast" "cast" ;
|
||||
catch_V = irregV "catch" "caught" "caught" ;
|
||||
choose_V = irregV "choose" "chose" "chosen" ;
|
||||
cling_V = irregV "cling" "clung" "clung" ;
|
||||
come_V = irregV "come" "came" "come" ;
|
||||
cost_V = irregV "cost" "cost" "cost" ;
|
||||
creep_V = irregV "creep" "crept" "crept" ;
|
||||
cut_V = irregDuplV "cut" "cut" "cut" ;
|
||||
deal_V = irregV "deal" "dealt" "dealt" ;
|
||||
dig_V = irregDuplV "dig" "dug" "dug" ;
|
||||
dive_V = irregV "dive" (variants {"dived" ; "dove"}) "dived" ;
|
||||
do_V = mk5V "do" "does" "did" "done" "doing" ;
|
||||
draw_V = irregV "draw" "drew" "drawn" ;
|
||||
dream_V = irregV "dream" (variants {"dreamed" ; "dreamt"}) (variants {"dreamed" ; "dreamt"}) ;
|
||||
drive_V = irregV "drive" "drove" "driven" ;
|
||||
drink_V = irregV "drink" "drank" "drunk" ;
|
||||
eat_V = irregV "eat" "ate" "eaten" ;
|
||||
fall_V = irregV "fall" "fell" "fallen" ;
|
||||
feed_V = irregV "feed" "fed" "fed" ;
|
||||
feel_V = irregV "feel" "felt" "felt" ;
|
||||
fight_V = irregV "fight" "fought" "fought" ;
|
||||
find_V = irregV "find" "found" "found" ;
|
||||
fit_V = irregDuplV "fit" "fit" "fit" ;
|
||||
flee_V = irregV "flee" "fled" "fled" ;
|
||||
fling_V = irregV "fling" "flung" "flung" ;
|
||||
fly_V = irregV "fly" "flew" "flown" ;
|
||||
forbid_V = irregDuplV "forbid" "forbade" "forbidden" ;
|
||||
forget_V = irregDuplV "forget" "forgot" "forgotten" ;
|
||||
forgive_V = irregV "forgive" "forgave" "forgiven" ;
|
||||
forsake_V = irregV "forsake" "forsook" "forsaken" ;
|
||||
freeze_V = irregV "freeze" "froze" "frozen" ;
|
||||
get_V = irregDuplV "get" "got" "gotten" ;
|
||||
give_V = irregV "give" "gave" "given" ;
|
||||
go_V = mk5V "go" "goes" "went" "gone" "going" ;
|
||||
grind_V = irregV "grind" "ground" "ground" ;
|
||||
grow_V = irregV "grow" "grew" "grown" ;
|
||||
hang_V = irregV "hang" "hung" "hung" ;
|
||||
have_V = mk5V "have" "has" "had" "had" "having" ;
|
||||
hear_V = irregV "hear" "heard" "heard" ;
|
||||
hide_V = irregV "hide" "hid" "hidden" ;
|
||||
hit_V = irregDuplV "hit" "hit" "hit" ;
|
||||
hold_V = irregV "hold" "held" "held" ;
|
||||
hurt_V = irregV "hurt" "hurt" "hurt" ;
|
||||
keep_V = irregV "keep" "kept" "kept" ;
|
||||
kneel_V = irregV "kneel" "knelt" "knelt" ;
|
||||
knit_V = irregDuplV "knit" "knit" "knit" ;
|
||||
know_V = irregV "know" "knew" "know" ;
|
||||
lay_V = irregV "lay" "laid" "laid" ;
|
||||
lead_V = irregV "lead" "led" "led" ;
|
||||
leap_V = irregV "leap" (variants {"leaped" ; "lept"}) (variants {"leaped" ; "lept"}) ;
|
||||
learn_V = irregV "learn" (variants {"learned" ; "learnt"}) (variants {"learned" ; "learnt"}) ;
|
||||
leave_V = irregV "leave" "left" "left" ;
|
||||
lend_V = irregV "lend" "lent" "lent" ;
|
||||
let_V = irregDuplV "let" "let" "let" ;
|
||||
lie_V = irregV "lie" "lay" "lain" ;
|
||||
light_V = irregV "light" (variants {"lighted" ; "lit"}) "lighted" ;
|
||||
lose_V = irregV "lose" "lost" "lost" ;
|
||||
make_V = irregV "make" "made" "made" ;
|
||||
mean_V = irregV "mean" "meant" "meant" ;
|
||||
meet_V = irregV "meet" "met" "met" ;
|
||||
misspell_V = irregV "misspell" (variants {"misspelled" ; "misspelt"}) (variants {"misspelled" ; "misspelt"}) ;
|
||||
mistake_V = irregV "mistake" "mistook" "mistaken" ;
|
||||
mow_V = irregV "mow" "mowed" (variants {"mowed" ; "mown"}) ;
|
||||
overcome_V = irregV "overcome" "overcame" "overcome" ;
|
||||
overdo_V = mk5V "overdo" "overdoes" "overdid" "overdone" "overdoing" ;
|
||||
overtake_V = irregV "overtake" "overtook" "overtaken" ;
|
||||
overthrow_V = irregV "overthrow" "overthrew" "overthrown" ;
|
||||
pay_V = irregV "pay" "paid" "paid" ;
|
||||
plead_V = irregV "plead" "pled" "pled" ;
|
||||
prove_V = irregV "prove" "proved" (variants {"proved" ; "proven"}) ;
|
||||
put_V = irregDuplV "put" "put" "put" ;
|
||||
quit_V = irregDuplV "quit" "quit" "quit" ;
|
||||
read_V = irregV "read" "read" "read" ;
|
||||
rid_V = irregDuplV "rid" "rid" "rid" ;
|
||||
ride_V = irregV "ride" "rode" "ridden" ;
|
||||
ring_V = irregV "ring" "rang" "rung" ;
|
||||
rise_V = irregV "rise" "rose" "risen" ;
|
||||
run_V = irregDuplV "run" "ran" "run" ;
|
||||
saw_V = irregV "saw" "sawed" (variants {"sawed" ; "sawn"}) ;
|
||||
say_V = irregV "say" "said" "said" ;
|
||||
see_V = irregV "see" "saw" "seen" ;
|
||||
seek_V = irregV "seek" "sought" "sought" ;
|
||||
sell_V = irregV "sell" "sold" "sold" ;
|
||||
send_V = irregV "send" "sent" "sent" ;
|
||||
set_V = irregDuplV "set" "set" "set" ;
|
||||
sew_V = irregV "sew" "sewed" (variants {"sewed" ; "sewn"}) ;
|
||||
shake_V = irregV "shake" "shook" "shaken" ;
|
||||
shave_V = irregV "shave" "shaved" (variants {"shaved" ; "shaven"}) ;
|
||||
shear_V = irregV "shear" "shore" "shorn" ;
|
||||
shed_V = irregDuplV "shed" "shed" "shed" ;
|
||||
shine_V = irregV "shine" "shone" "shone" ;
|
||||
shoe_V = irregV "shoe" "shoed" (variants {"shoed" ; "shod"}) ;
|
||||
shoot_V = irregV "shoot" "shot" "shot" ;
|
||||
show_V = irregV "show" "showed" (variants {"showed" ; "shown"}) ;
|
||||
shrink_V = irregV "shrink" "shrank" "shrunk" ;
|
||||
shut_V = irregDuplV "shut" "shut" "shut" ;
|
||||
sing_V = irregV "sing" "sang" "sung" ;
|
||||
sink_V = irregV "sink" "sank" "sunk" ;
|
||||
sit_V = irregDuplV "sit" "sat" "sat" ;
|
||||
sleep_V = irregV "sleep" "slept" "slept" ;
|
||||
slay_V = irregV "slay" "slew" "slain" ;
|
||||
slide_V = irregV "slide" "slid" "slid" ;
|
||||
sling_V = irregV "sling" "slung" "slung" ;
|
||||
slit_V = irregDuplV "slit" "slit" "slit" ;
|
||||
smite_V = irregV "smite" "smote" "smitten" ;
|
||||
sow_V = irregV "sow" "sowed" (variants {"sowed" ; "sown"}) ;
|
||||
speak_V = irregV "speak" "spoke" "spoken" ;
|
||||
speed_V = irregV "speed" "sped" "sped" ;
|
||||
spend_V = irregV "spend" "spent" "spent" ;
|
||||
spill_V = irregV "spill" (variants {"spilled" ; "spilt"}) (variants {"spilled" ; "spilt"}) ;
|
||||
spin_V = irregDuplV "spin" "spun" "spun" ;
|
||||
spit_V = irregDuplV "spit" (variants {"spit" ; "spat"}) "spit" ;
|
||||
split_V = irregDuplV "split" "split" "split" ;
|
||||
spread_V = irregV "spread" "spread" "spread" ;
|
||||
spring_V = irregV "spring" (variants {"sprang" ; "sprung"}) "sprung" ;
|
||||
stand_V = irregV "stand" "stood" "stood" ;
|
||||
steal_V = irregV "steal" "stole" "stolen" ;
|
||||
stick_V = irregV "stick" "stuck" "stuck" ;
|
||||
sting_V = irregV "sting" "stung" "stung" ;
|
||||
stink_V = irregV "stink" "stank" "stunk" ;
|
||||
stride_V = irregV "stride" "strod" "stridden" ;
|
||||
strike_V = irregV "strike" "struck" "struck" ;
|
||||
string_V = irregV "string" "strung" "strung" ;
|
||||
strive_V = irregV "strive" "strove" "striven" ;
|
||||
swear_V = irregV "swear" "swore" "sworn" ;
|
||||
sweep_V = irregV "sweep" "swept" "swept" ;
|
||||
swell_V = irregV "swell" "swelled" (variants {"swelled" ; "swollen"}) ;
|
||||
swim_V = irregDuplV "swim" "swam" "swum" ;
|
||||
swing_V = irregV "swing" "swung" "swung" ;
|
||||
take_V = irregV "take" "took" "taken" ;
|
||||
teach_V = irregV "teach" "taught" "taught" ;
|
||||
tear_V = irregV "tear" "tore" "torn" ;
|
||||
tell_V = irregV "tell" "told" "told" ;
|
||||
think_V = irregV "think" "thought" "thought" ;
|
||||
thrive_V = irregV "thrive" (variants {"thrived" ; "throve"}) "thrived" ;
|
||||
throw_V = irregV "throw" "threw" "thrown" ;
|
||||
thrust_V = irregV "thrust" "thrust" "thrust" ;
|
||||
tread_V = irregV "tread" "trod" "trodden" ;
|
||||
understand_V = irregV "understand" "understood" "understood" ;
|
||||
uphold_V = irregV "uphold" "upheld" "upheld" ;
|
||||
upset_V = irregDuplV "upset" "upset" "upset" ;
|
||||
wake_V = irregV "wake" "woke" "woken" ;
|
||||
wear_V = irregV "wear" "wore" "worn" ;
|
||||
weave_V = irregV "weave" (variants {"weaved" ; "wove"}) (variants {"weaved" ; "woven"}) ;
|
||||
wed_V = irregDuplV "wed" "wed" "wed" ;
|
||||
weep_V = irregV "weep" "wept" "wept" ;
|
||||
wind_V = irregV "wind" "wound" "wound" ;
|
||||
win_V = irregDuplV "win" "won" "won" ;
|
||||
withhold_V = irregV "withhold" "withheld" "withheld" ;
|
||||
withstand_V = irregV "withstand" "withstood" "withstood" ;
|
||||
wring_V = irregV "wring" "wrung" "wrung" ;
|
||||
write_V = irregV "write" "wrote" "written" ;
|
||||
-}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
abstract IrregLavAbs = Cat ** {
|
||||
{-
|
||||
fun
|
||||
awake_V : V ;
|
||||
bear_V : V ;
|
||||
beat_V : V ;
|
||||
become_V : V ;
|
||||
begin_V : V ;
|
||||
bend_V : V ;
|
||||
beset_V : V ;
|
||||
bet_V : V ;
|
||||
bid_V : V ;
|
||||
bind_V : V ;
|
||||
bite_V : V ;
|
||||
bleed_V : V ;
|
||||
blow_V : V ;
|
||||
break_V : V ;
|
||||
breed_V : V ;
|
||||
bring_V : V ;
|
||||
broadcast_V : V ;
|
||||
build_V : V ;
|
||||
burn_V : V ;
|
||||
burst_V : V ;
|
||||
buy_V : V ;
|
||||
cast_V : V ;
|
||||
catch_V : V ;
|
||||
choose_V : V ;
|
||||
cling_V : V ;
|
||||
come_V : V ;
|
||||
cost_V : V ;
|
||||
creep_V : V ;
|
||||
cut_V : V ;
|
||||
deal_V : V ;
|
||||
dig_V : V ;
|
||||
dive_V : V ;
|
||||
do_V : V ;
|
||||
draw_V : V ;
|
||||
dream_V : V ;
|
||||
drive_V : V ;
|
||||
drink_V : V ;
|
||||
eat_V : V ;
|
||||
fall_V : V ;
|
||||
feed_V : V ;
|
||||
feel_V : V ;
|
||||
fight_V : V ;
|
||||
find_V : V ;
|
||||
fit_V : V ;
|
||||
flee_V : V ;
|
||||
fling_V : V ;
|
||||
fly_V : V ;
|
||||
forbid_V : V ;
|
||||
forget_V : V ;
|
||||
forgive_V : V ;
|
||||
forsake_V : V ;
|
||||
freeze_V : V ;
|
||||
get_V : V ;
|
||||
give_V : V ;
|
||||
go_V : V ;
|
||||
grind_V : V ;
|
||||
grow_V : V ;
|
||||
hang_V : V ;
|
||||
have_V : V ;
|
||||
hear_V : V ;
|
||||
hide_V : V ;
|
||||
hit_V : V ;
|
||||
hold_V : V ;
|
||||
hurt_V : V ;
|
||||
keep_V : V ;
|
||||
kneel_V : V ;
|
||||
knit_V : V ;
|
||||
know_V : V ;
|
||||
lay_V : V ;
|
||||
lead_V : V ;
|
||||
leap_V : V ;
|
||||
learn_V : V ;
|
||||
leave_V : V ;
|
||||
lend_V : V ;
|
||||
let_V : V ;
|
||||
lie_V : V ;
|
||||
light_V : V ;
|
||||
lose_V : V ;
|
||||
make_V : V ;
|
||||
mean_V : V ;
|
||||
meet_V : V ;
|
||||
misspell_V : V ;
|
||||
mistake_V : V ;
|
||||
mow_V : V ;
|
||||
overcome_V : V ;
|
||||
overdo_V : V ;
|
||||
overtake_V : V ;
|
||||
overthrow_V : V ;
|
||||
pay_V : V ;
|
||||
plead_V : V ;
|
||||
prove_V : V ;
|
||||
put_V : V ;
|
||||
quit_V : V ;
|
||||
read_V : V ;
|
||||
rid_V : V ;
|
||||
ride_V : V ;
|
||||
ring_V : V ;
|
||||
rise_V : V ;
|
||||
run_V : V ;
|
||||
saw_V : V ;
|
||||
say_V : V ;
|
||||
see_V : V ;
|
||||
seek_V : V ;
|
||||
sell_V : V ;
|
||||
send_V : V ;
|
||||
set_V : V ;
|
||||
sew_V : V ;
|
||||
shake_V : V ;
|
||||
shave_V : V ;
|
||||
shear_V : V ;
|
||||
shed_V : V ;
|
||||
shine_V : V ;
|
||||
shoe_V : V ;
|
||||
shoot_V : V ;
|
||||
show_V : V ;
|
||||
shrink_V : V ;
|
||||
shut_V : V ;
|
||||
sing_V : V ;
|
||||
sink_V : V ;
|
||||
sit_V : V ;
|
||||
sleep_V : V ;
|
||||
slay_V : V ;
|
||||
slide_V : V ;
|
||||
sling_V : V ;
|
||||
slit_V : V ;
|
||||
smite_V : V ;
|
||||
sow_V : V ;
|
||||
speak_V : V ;
|
||||
speed_V : V ;
|
||||
spend_V : V ;
|
||||
spill_V : V ;
|
||||
spin_V : V ;
|
||||
spit_V : V ;
|
||||
split_V : V ;
|
||||
spread_V : V ;
|
||||
spring_V : V ;
|
||||
stand_V : V ;
|
||||
steal_V : V ;
|
||||
stick_V : V ;
|
||||
sting_V : V ;
|
||||
stink_V : V ;
|
||||
stride_V : V ;
|
||||
strike_V : V ;
|
||||
string_V : V ;
|
||||
strive_V : V ;
|
||||
swear_V : V ;
|
||||
sweep_V : V ;
|
||||
swell_V : V ;
|
||||
swim_V : V ;
|
||||
swing_V : V ;
|
||||
take_V : V ;
|
||||
teach_V : V ;
|
||||
tear_V : V ;
|
||||
tell_V : V ;
|
||||
think_V : V ;
|
||||
thrive_V : V ;
|
||||
throw_V : V ;
|
||||
thrust_V : V ;
|
||||
tread_V : V ;
|
||||
understand_V : V ;
|
||||
uphold_V : V ;
|
||||
upset_V : V ;
|
||||
wake_V : V ;
|
||||
wear_V : V ;
|
||||
weave_V : V ;
|
||||
wed_V : V ;
|
||||
weep_V : V ;
|
||||
wind_V : V ;
|
||||
win_V : V ;
|
||||
withhold_V : V ;
|
||||
withstand_V : V ;
|
||||
wring_V : V ;
|
||||
write_V : V ;
|
||||
-}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete LangLav of Lang =
|
||||
concrete LangLav of Lang =
|
||||
GrammarLav,
|
||||
LexiconLav
|
||||
** {
|
||||
@@ -10,4 +10,4 @@ flags
|
||||
unlexer = text ;
|
||||
lexer = text ;
|
||||
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--# -path=.:prelude
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete LexiconLav of Lexicon = CatLav ** open
|
||||
ParadigmsLav,
|
||||
@@ -7,13 +7,14 @@ concrete LexiconLav of Lexicon = CatLav ** open
|
||||
Prelude
|
||||
in {
|
||||
|
||||
flags
|
||||
flags
|
||||
optimize = values ;
|
||||
coding = utf8 ;
|
||||
|
||||
|
||||
lin
|
||||
airplane_N = mkN "lidmašīna" ;
|
||||
answer_V2S = mkV2S (mkV "atbildēt" third_conjugation) dat_Prep that_Subj ; -- toP = 'answer to [Person]' = 'atbildēt [kam?]'
|
||||
answer_V2S = mkV2S (mkV "atbildēt" third_conjugation) dat_Prep that_Subj ;
|
||||
-- toP = 'answer to [Person]' = 'atbildēt [kam?]'
|
||||
apartment_N = mkN "dzīvoklis" ;
|
||||
apple_N = mkN "ābols" ;
|
||||
art_N = mkN "māksla" ;
|
||||
@@ -38,10 +39,11 @@ lin
|
||||
bread_N = mkN "maize" ;
|
||||
break_V2 = mkV2 (mkV "lauzt" "laužu" "lauzu") acc_Prep ;
|
||||
broad_A = mkA "plats" ;
|
||||
brother_N2 = mkN2 (mkN "brālis") gen_Prep True; -- Ģenitīvs nav kā piederība, bet kā relācija: "Jāņa/tēva brālis", bet ne "mans brālis" (?)
|
||||
brother_N2 = mkN2 (mkN "brālis") gen_Prep True;
|
||||
-- Ģenitīvs nav kā piederība, bet kā relācija: "Jāņa/tēva brālis", bet ne "mans brālis" (?)
|
||||
brown_A = mkA "brūns" ;
|
||||
butter_N = mkN "sviests" ;
|
||||
buy_V2 = mkV2 (mkV "pirkt" "pērku" "pirku") acc_Prep ;
|
||||
buy_V2 = mkV2 (mkV "pirkt" "pērku" "pirku") acc_Prep ;
|
||||
camera_N = mkN "fotoaparāts" ;
|
||||
cap_N = mkN "cepure" ;
|
||||
car_N = mkN "automašīna" ;
|
||||
@@ -55,13 +57,13 @@ lin
|
||||
city_N = mkN "pilsēta" ;
|
||||
clean_A = mkA "tīrs" ;
|
||||
clever_A = mkA "gudrs" ;
|
||||
close_V2 = mkV2 (mkV "aizvērt" "aizveru" "aizvēru") acc_Prep;
|
||||
close_V2 = mkV2 (mkV "aizvērt" "aizveru" "aizvēru") acc_Prep ;
|
||||
coat_N = mkN "mētelis" ;
|
||||
cold_A = mkA "auksts" ;
|
||||
come_V = mkV "nākt" "nāku" "nācu" ;
|
||||
computer_N = mkN "dators" ;
|
||||
country_N = mkN "valsts" ;
|
||||
cousin_N = mkN "brālēns" ; --FIXME - brālēns / māsīca angļiem ir vienāds...
|
||||
cousin_N = mkN "brālēns" ; -- FIXME: brālēns/māsīca angļiem ir vienāds...
|
||||
cow_N = mkN "govs" ;
|
||||
die_V = mkV "nomirt" "nomirstu" "nomiru";
|
||||
dirty_A = mkA "netīrs" ;
|
||||
@@ -70,19 +72,17 @@ lin
|
||||
dog_N = mkN "suns" ;
|
||||
door_N = mkN "durvis" ;
|
||||
drink_V2 = mkV2 (mkV "dzert" "dzeru" "dzēru") acc_Prep;
|
||||
{-
|
||||
easy_A2V = mkA2V (regA "easy") forP ; -- FIXME - nu nav tādas konstrukcijas latviešu val
|
||||
-}
|
||||
eat_V2 = mkV2 (mkV "ēst" "ēdu" "ēdu") acc_Prep;
|
||||
--easy_A2V = mkA2V (regA "easy") forP ; -- FIXME: nav tādas konstrukcijas latviešu val.
|
||||
eat_V2 = mkV2 (mkV "ēst" "ēdu" "ēdu") acc_Prep ;
|
||||
empty_A = mkA "tukšs" ;
|
||||
enemy_N = mkN "ienaidnieks" ;
|
||||
factory_N = mkN "rūpnīca" ;
|
||||
father_N2 = mkN2 (mkN "tēvs") gen_Prep True ;
|
||||
fear_VS = mkVS (mkV "baidīties" third_conjugation) that_Subj;
|
||||
find_V2 = mkV2 (mkV "atrast" "atrodi" "atradu") acc_Prep;
|
||||
father_N2 = mkN2 (mkN "tēvs") gen_Prep True ;
|
||||
fear_VS = mkVS (mkV "baidīties" third_conjugation) that_Subj ;
|
||||
find_V2 = mkV2 (mkV "atrast" "atrodi" "atradu") acc_Prep ;
|
||||
fish_N = mkN "zivs" ;
|
||||
floor_N = mkN "grīda" ;
|
||||
forget_V2 = mkV2 (mkV "aizmirst" "aizmirstu" "aizmirsu") acc_Prep;
|
||||
forget_V2 = mkV2 (mkV "aizmirst" "aizmirstu" "aizmirsu") acc_Prep ;
|
||||
fridge_N = mkN "ledusskapis" ;
|
||||
friend_N = mkN "draugs" ;
|
||||
fruit_N = mkN "auglis" ;
|
||||
@@ -92,14 +92,14 @@ lin
|
||||
glove_N = mkN "cimds" ;
|
||||
gold_N = mkN "zelts" ;
|
||||
good_A = mkA "labs" ;
|
||||
go_V = mkV "iet" ;
|
||||
go_V = mkV "iet" ;
|
||||
green_A = mkA "zaļš" ;
|
||||
harbour_N = mkN "osta" ;
|
||||
hate_V2 = mkV2 (mkV "ienīst" "ienīstu" "ienīdu") acc_Prep;
|
||||
hate_V2 = mkV2 (mkV "ienīst" "ienīstu" "ienīdu") acc_Prep ;
|
||||
hat_N = mkN "cepure" ;
|
||||
hear_V2 = mkV2 (mkV "dzirdēt" third_conjugation) acc_Prep;
|
||||
hear_V2 = mkV2 (mkV "dzirdēt" third_conjugation) acc_Prep ;
|
||||
hill_N = mkN "kalns" ;
|
||||
hope_VS = mkVS (mkV "cerēt" third_conjugation) that_Subj;
|
||||
hope_VS = mkVS (mkV "cerēt" third_conjugation) that_Subj ;
|
||||
horse_N = mkN "zirgs" ;
|
||||
hot_A = mkA "karsts" ;
|
||||
house_N = mkN "māja" ;
|
||||
@@ -107,36 +107,35 @@ lin
|
||||
industry_N = mkN "industrija" ;
|
||||
iron_N = mkN "dzelzs" ;
|
||||
king_N = mkN "karalis" ;
|
||||
know_V2 = mkV2 (mkV "zināt" third_conjugation) acc_Prep; -- FIXME - šitādas lietas jārisina ar valencēm nevis 2 vienādiem vārdiem
|
||||
know_VS = mkVS (mkV "zināt" third_conjugation) that_Subj;
|
||||
know_V2 = mkV2 (mkV "zināt" third_conjugation) acc_Prep ;
|
||||
-- FIXME: šitādas lietas jārisina ar valencēm nevis 2 vienādiem vārdiem
|
||||
know_VS = mkVS (mkV "zināt" third_conjugation) that_Subj ;
|
||||
lake_N = mkN "ezers" ;
|
||||
lamp_N = mkN "lampa" ;
|
||||
learn_V2 = mkV2 (mkV "mācīties" third_conjugation) acc_Prep;
|
||||
learn_V2 = mkV2 (mkV "mācīties" third_conjugation) acc_Prep ;
|
||||
leather_N = mkN "āda" ;
|
||||
leave_V2 = mkV2 (mkV "atstāt" "atstāju" "atstāju") acc_Prep;
|
||||
{-
|
||||
like_V2 = mkV2 (regV "like") ;
|
||||
-}
|
||||
leave_V2 = mkV2 (mkV "atstāt" "atstāju" "atstāju") acc_Prep ;
|
||||
--like_V2 = mkV2 (regV "like") ;
|
||||
listen_V2 = mkV2 (mkV "klausīties" third_conjugation) acc_Prep ;
|
||||
live_V = mkV "dzīvot" second_conjugation ;
|
||||
long_A = mkA "garš" ;
|
||||
lose_V2 = mkV2 (mkV "pazaudēt" second_conjugation) acc_Prep;
|
||||
lose_V2 = mkV2 (mkV "pazaudēt" second_conjugation) acc_Prep ;
|
||||
love_N = mkN "mīlestība" ;
|
||||
love_V2 = mkV2 (mkV "mīlēt" third_conjugation) acc_Prep;
|
||||
love_V2 = mkV2 (mkV "mīlēt" third_conjugation) acc_Prep ;
|
||||
man_N = mkN "vīrietis" ;
|
||||
married_A2 = mkA2 (mkA (mkV "precēties" third_conjugation)) with_Prep ;
|
||||
meat_N = mkN "gaļa" ;
|
||||
milk_N = mkN "piens" ;
|
||||
moon_N = mkN "mēness" ;
|
||||
mother_N2 = mkN2 (mkN "māte") gen_Prep True;
|
||||
mother_N2 = mkN2 (mkN "māte") gen_Prep True ;
|
||||
mountain_N = mkN "kalns" ;
|
||||
music_N = mkN "mūzika" ;
|
||||
narrow_A = mkA "šaurs" ;
|
||||
new_A = mkA "jauns" ;
|
||||
newspaper_N = mkN "avīze" ;
|
||||
oil_N = mkN "eļļa" ; -- reku parādās klasiskās problēmas - eļļa vai nafta?
|
||||
oil_N = mkN "eļļa" ; -- reku parādās klasiskās problēmas - eļļa vai nafta?
|
||||
old_A = mkA "vecs" ;
|
||||
open_V2 = mkV2 (mkV "atvērt" "atveru" "atvēru") acc_Prep;
|
||||
open_V2 = mkV2 (mkV "atvērt" "atveru" "atvēru") acc_Prep ;
|
||||
paint_V2A = mkV2A (mkV "krāsot" second_conjugation) acc_Prep ;
|
||||
paper_N = mkN "papīrs" ;
|
||||
paris_PN = mkPN "Parīze" ;
|
||||
@@ -144,14 +143,14 @@ lin
|
||||
pen_N = mkN "pildspalva" ;
|
||||
planet_N = mkN "planēta" ;
|
||||
plastic_N = mkN "plastmasa" ;
|
||||
play_V2 = mkV2 (mkV "spēlēt" second_conjugation) acc_Prep;
|
||||
play_V2 = mkV2 (mkV "spēlēt" second_conjugation) acc_Prep ;
|
||||
policeman_N = mkN "policists" ;
|
||||
priest_N = mkN "mācītājs" ;
|
||||
probable_AS = mkAS (mkA "iespējams") ;
|
||||
queen_N = mkN "karaliene" ;
|
||||
radio_N = mkN "radio" ;
|
||||
{- rain_V0 = mkV0 (regV "rain") ; -}
|
||||
read_V2 = mkV2 (mkV "lasīt" third_conjugation) acc_Prep;
|
||||
--rain_V0 = mkV0 (regV "rain") ;
|
||||
read_V2 = mkV2 (mkV "lasīt" third_conjugation) acc_Prep ;
|
||||
red_A = mkA "sarkans" ;
|
||||
religion_N = mkN "reliģija" ;
|
||||
restaurant_N = mkN "restorāns" ;
|
||||
@@ -160,14 +159,14 @@ lin
|
||||
roof_N = mkN "jumts" ;
|
||||
rubber_N = mkN "gumija" ;
|
||||
run_V = mkV "skriet" "skrienu" "skrēju" ;
|
||||
say_VS = mkVS (mkV "sacīt" third_conjugation) that_Subj;
|
||||
say_VS = mkVS (mkV "sacīt" third_conjugation) that_Subj ;
|
||||
school_N = mkN "skola" ;
|
||||
science_N = mkN "zinātne" ;
|
||||
sea_N = mkN "jūra" ;
|
||||
seek_V2 = mkV2 (mkV "meklēt" second_conjugation) acc_Prep;
|
||||
see_V2 = mkV2 (mkV "redzēt" third_conjugation) acc_Prep;
|
||||
seek_V2 = mkV2 (mkV "meklēt" second_conjugation) acc_Prep ;
|
||||
see_V2 = mkV2 (mkV "redzēt" third_conjugation) acc_Prep ;
|
||||
sell_V3 = mkV3 (mkV "pārdot" "pārdodu" "pārdevu") acc_Prep dat_Prep ;
|
||||
send_V3 = mkV3 (mkV "sūtīt" third_conjugation) acc_Prep dat_Prep;
|
||||
send_V3 = mkV3 (mkV "sūtīt" third_conjugation) acc_Prep dat_Prep ;
|
||||
sheep_N = mkN "aita" ;
|
||||
ship_N = mkN "kuģis" ;
|
||||
shirt_N = mkN "krekls" ;
|
||||
@@ -175,12 +174,12 @@ lin
|
||||
shop_N = mkN "veikals" ;
|
||||
short_A = mkA "īss" ;
|
||||
silver_N = mkN "sudrabs" ;
|
||||
sister_N = mkN "māsa" ; --TODO kāpēc nav kā brālis ar parametru?
|
||||
sleep_V = mkV "gulēt";
|
||||
sister_N = mkN "māsa" ; -- TODO: kāpēc nav kā brālis ar parametru?
|
||||
sleep_V = mkV "gulēt";
|
||||
small_A = mkA "mazs" ;
|
||||
snake_N = mkN "čūska" ;
|
||||
sock_N = mkN "zeķe" ;
|
||||
speak_V2 = mkV2 (mkV "sacīt" third_conjugation) acc_Prep; --TODO - citas valences tur tak
|
||||
speak_V2 = mkV2 (mkV "sacīt" third_conjugation) acc_Prep ; -- TODO: citas valences tur tak
|
||||
star_N = mkN "zvaigzne" ;
|
||||
steel_N = mkN "tērauds" ;
|
||||
stone_N = mkN "akmens" ;
|
||||
@@ -188,40 +187,40 @@ lin
|
||||
student_N = mkN "students" ;
|
||||
stupid_A = mkA "dumjš" ;
|
||||
sun_N = mkN "saule" ;
|
||||
switch8off_V2 = mkV2 (mkV "izslēgt" "izslēdzu" "izslēdzu") acc_Prep;
|
||||
switch8on_V2 = mkV2 (mkV "ieslēgt" "ieslēdzu" "ieslēdzu") acc_Prep;
|
||||
switch8off_V2 = mkV2 (mkV "izslēgt" "izslēdzu" "izslēdzu") acc_Prep ;
|
||||
switch8on_V2 = mkV2 (mkV "ieslēgt" "ieslēdzu" "ieslēdzu") acc_Prep ;
|
||||
table_N = mkN "galds" ;
|
||||
talk_V3 = mkV3 (mkV "runāt" second_conjugation) to_Prep par_Prep ; --ar ko, par ko
|
||||
talk_V3 = mkV3 (mkV "runāt" second_conjugation) to_Prep par_Prep ; -- ar ko, par ko
|
||||
teacher_N = mkN "skolotājs" ;
|
||||
teach_V2 = mkV2 (mkV "mācīt" third_conjugation) acc_Prep;
|
||||
teach_V2 = mkV2 (mkV "mācīt" third_conjugation) acc_Prep ;
|
||||
television_N = mkN "televīzija" ;
|
||||
thick_A = mkA "biezs" ;
|
||||
thin_A = mkA "plāns" ;
|
||||
train_N = mkN "vilciens" ;
|
||||
travel_V = mkV "ceļot" second_conjugation;
|
||||
travel_V = mkV "ceļot" second_conjugation ;
|
||||
tree_N = mkN "koks" ;
|
||||
--trousers_N = mkN "bikses" ;
|
||||
ugly_A = mkA "neglīts" ;
|
||||
understand_V2 = mkV2 (mkV "saprast" "saprotu" "sapratu") acc_Prep;
|
||||
understand_V2 = mkV2 (mkV "saprast" "saprotu" "sapratu") acc_Prep ;
|
||||
university_N = mkN "universitāte" ;
|
||||
village_N = mkN "village" ;
|
||||
wait_V2 = mkV2 (mkV "gaidīt" third_conjugation) acc_Prep ;
|
||||
walk_V = mkV "staigāt" second_conjugation ;
|
||||
warm_A = mkA "silts" ;
|
||||
war_N = mkN "karš" ;
|
||||
watch_V2 = mkV2 (mkV "skatīties" third_conjugation) acc_Prep;
|
||||
walk_V = mkV "staigāt" second_conjugation ;
|
||||
warm_A = mkA "silts" ;
|
||||
war_N = mkN "karš" ;
|
||||
watch_V2 = mkV2 (mkV "skatīties" third_conjugation) acc_Prep ;
|
||||
water_N = mkN "ūdens" ;
|
||||
white_A = mkA "balts" ;
|
||||
window_N = mkN "logs" ;
|
||||
wine_N = mkN "vīns" ;
|
||||
win_V2 = mkV2 (mkV "uzvarēt" third_conjugation) acc_Prep;
|
||||
win_V2 = mkV2 (mkV "uzvarēt" third_conjugation) acc_Prep ;
|
||||
woman_N = mkN "sieviete" ;
|
||||
wonder_VQ = mkVQ (mkV "brīnīties" third_conjugation) ;
|
||||
wonder_VQ = mkVQ (mkV "brīnīties" third_conjugation) ;
|
||||
wood_N = mkN "koks" ;
|
||||
write_V2 = mkV2 (mkV "rakstīt" third_conjugation) acc_Prep;
|
||||
write_V2 = mkV2 (mkV "rakstīt" third_conjugation) acc_Prep ;
|
||||
yellow_A = mkA "dzeltens" ;
|
||||
young_A = mkA "jauns" ;
|
||||
do_V2 = mkV2 (mkV "darīt" third_conjugation) acc_Prep;
|
||||
do_V2 = mkV2 (mkV "darīt" third_conjugation) acc_Prep ;
|
||||
now_Adv = mkAdv "tagad" ;
|
||||
already_Adv = mkAdv "jau" ;
|
||||
song_N = mkN "dziesma" ;
|
||||
@@ -231,13 +230,12 @@ lin
|
||||
stop_V = mkV "apstāties" "apstājos" "apstājos";
|
||||
jump_V = mkV "lēkt" "lecu" "lēcu" ;
|
||||
|
||||
{-
|
||||
left_Ord = mkOrd "left" ;
|
||||
right_Ord = mkOrd "right" ; -}
|
||||
far_Adv = mkAdv "tālu" ;
|
||||
--left_Ord = mkOrd "left" ;
|
||||
--right_Ord = mkOrd "right" ;
|
||||
far_Adv = mkAdv "tālu" ;
|
||||
correct_A = mkA "pareizs" ;
|
||||
dry_A = mkA "sauss" ;
|
||||
dull_A = mkA "neass" ; -- garlaicīgs?
|
||||
dull_A = mkA "neass" ; -- garlaicīgs?
|
||||
full_A = mkA "pilns" ;
|
||||
heavy_A = mkA "smags" ;
|
||||
near_A = mkA "tuvs" ;
|
||||
@@ -249,13 +247,13 @@ lin
|
||||
wet_A = mkA "slapjš" ;
|
||||
wide_A = mkA "plats" ;
|
||||
animal_N = mkN "dzīvnieks" ;
|
||||
ashes_N = mkN "pelni" ; -- FIXME: plural only? kā to norāda?
|
||||
ashes_N = mkN "pelni" ; -- FIXME: plural only? kā to norāda?
|
||||
back_N = mkN "mugura" ;
|
||||
bark_N = mkN "miza" ;
|
||||
belly_N = mkN "vēders" ;
|
||||
blood_N = mkN "asinis" Fem;
|
||||
blood_N = mkN "asinis" Fem ;
|
||||
bone_N = mkN "kauls" ;
|
||||
breast_N = mkN "krūts" Fem;
|
||||
breast_N = mkN "krūts" Fem ;
|
||||
cloud_N = mkN "mākonis" ;
|
||||
day_N = mkN "diena" ;
|
||||
dust_N = mkN "putekļi" ;
|
||||
@@ -272,13 +270,13 @@ lin
|
||||
foot_N = mkN "pēda" ;
|
||||
forest_N = mkN "mežs" ;
|
||||
grass_N = mkN "zāle" ;
|
||||
guts_N = mkN "zarnas" ; -- FIXME: no singular
|
||||
guts_N = mkN "zarnas" ; -- FIXME: no singular
|
||||
hair_N = mkN "mati" ;
|
||||
hand_N = mkN "roka" ;
|
||||
head_N = mkN "galva" ;
|
||||
heart_N = mkN "sirds" ;
|
||||
horn_N = mkN "rags" ;
|
||||
husband_N = mkN "vīrs" ; --TODO - kāpēc nav parametrs tāpat kā tēvam?
|
||||
husband_N = mkN "vīrs" ; --TODO: kāpēc nav parametrs tāpat kā tēvam?
|
||||
ice_N = mkN "ledus" ;
|
||||
knee_N = mkN "ceļgals" ;
|
||||
leaf_N = mkN "lapa" ;
|
||||
@@ -311,62 +309,63 @@ lin
|
||||
wing_N = mkN "spārns" ;
|
||||
worm_N = mkN "tārps" ;
|
||||
year_N = mkN "gads" ;
|
||||
|
||||
|
||||
blow_V = mkV "pūst" "pūšu" "pūtu" ;
|
||||
breathe_V = mkV2 (mkV "elpot" second_conjugation) acc_Prep;
|
||||
breathe_V = mkV2 (mkV "elpot" second_conjugation) acc_Prep ;
|
||||
burn_V = mkV "degt" "degu" "degu" ;
|
||||
dig_V = mkV "rakt" "roku" "raku" ;
|
||||
fall_V = mkV "krist" "krītu" "kritu" ;
|
||||
float_V = mkV "peldēt" third_conjugation;
|
||||
flow_V = mkV "plūst" "plūstu" "plūdu";
|
||||
fall_V = mkV "krist" "krītu" "kritu" ;
|
||||
float_V = mkV "peldēt" third_conjugation ;
|
||||
flow_V = mkV "plūst" "plūstu" "plūdu" ;
|
||||
fly_V = mkV "lidot" second_conjugation ;
|
||||
freeze_V = mkV "sasalt" "sasalstu" "sasalu" ;
|
||||
give_V3 = mkV3 (mkV "dot" "dodu" "devu") acc_Prep dat_Prep ; -- dot ko kam
|
||||
give_V3 = mkV3 (mkV "dot" "dodu" "devu") acc_Prep dat_Prep ; -- dot ko? kam?
|
||||
laugh_V = mkV "smieties" "smejos" "smējos" ;
|
||||
lie_V = mkV "gulties" "guļos" "gūlos" ;
|
||||
play_V = mkV "spēlēt" second_conjugation;
|
||||
sew_V = mkV "šūt" "šuju" "šuvu";
|
||||
play_V = mkV "spēlēt" second_conjugation ;
|
||||
sew_V = mkV "šūt" "šuju" "šuvu" ;
|
||||
sing_V = mkV "dziedāt" third_conjugation ;
|
||||
sit_V = mkV "sēdēt" third_conjugation ;
|
||||
smell_V = mkV "smirdēt" third_conjugation;
|
||||
smell_V = mkV "smirdēt" third_conjugation ;
|
||||
spit_V = mkV "spļaut" "spļauju" "spļāvu" ;
|
||||
stand_V = mkV "stāvēt" third_conjugation;
|
||||
stand_V = mkV "stāvēt" third_conjugation ;
|
||||
swell_V = mkV "piebriest" "piebriestu" "piebriedu" ;
|
||||
swim_V = mkV "peldēt" third_conjugation;
|
||||
think_V = mkV "domāt" second_conjugation;
|
||||
turn_V = mkV "griezties" "griežos" "griezos";
|
||||
swim_V = mkV "peldēt" third_conjugation ;
|
||||
think_V = mkV "domāt" second_conjugation ;
|
||||
turn_V = mkV "griezties" "griežos" "griezos" ;
|
||||
vomit_V = mkV "vemt" "vemju" "vēmu" ;
|
||||
|
||||
bite_V2 = mkV2 (mkV "kost" "kožu" "kodu") dat_Prep ;
|
||||
count_V2 = mkV2 (mkV "skaitīt" third_conjugation) acc_Prep;
|
||||
cut_V2 = mkV2 (mkV "griezt" "griežu" "griezu") acc_Prep;
|
||||
fear_V2 = mkV2 (mkV "baidīties" third_conjugation) from_Prep;
|
||||
fight_V2 = mkV2 (mkV "cīnīties" third_conjugation) with_Prep;
|
||||
hit_V2 = mkV2 (mkV "sist" "situ" "situ") dat_Prep; -- TODO - atkal valences, var arī akuzatīvu ar bik citu nozīmi
|
||||
count_V2 = mkV2 (mkV "skaitīt" third_conjugation) acc_Prep ;
|
||||
cut_V2 = mkV2 (mkV "griezt" "griežu" "griezu") acc_Prep ;
|
||||
fear_V2 = mkV2 (mkV "baidīties" third_conjugation) from_Prep ;
|
||||
fight_V2 = mkV2 (mkV "cīnīties" third_conjugation) with_Prep ;
|
||||
hit_V2 = mkV2 (mkV "sist" "situ" "situ") dat_Prep ;
|
||||
-- TODO: atkal valences, var arī akuzatīvu ar bik citu nozīmi
|
||||
hold_V2 = mkV2 (mkV "turēt" third_conjugation) acc_Prep ;
|
||||
hunt_V2 = mkV2 (mkV "medīt" second_conjugation) acc_Prep;
|
||||
kill_V2 = mkV2 (mkV "nogalināt" third_conjugation) acc_Prep;
|
||||
pull_V2 = mkV2 (mkV "vilkt" "velku" "vilku") acc_Prep;
|
||||
push_V2 = mkV2 (mkV "stumt" "stumju" "stūmu") acc_Prep;
|
||||
rub_V2 = mkV2 (mkV "berzt" "beržu" "berzu") acc_Prep;
|
||||
scratch_V2 = mkV2 (mkV "kasīt" third_conjugation) acc_Prep;
|
||||
split_V2 = mkV2 (mkV "sadalīt" third_conjugation) acc_Prep;
|
||||
squeeze_V2 = mkV2 (mkV "saspiest" "saspiežu" "saspiedu") acc_Prep;
|
||||
stab_V2 = mkV2 (mkV "sadurt" "saduru" "sadūru") acc_Prep;
|
||||
suck_V2 = mkV2 (mkV "sūkt" "sūcu" "sūcu") acc_Prep;
|
||||
throw_V2 = mkV2 (mkV "mest" "metu" "metu") acc_Prep;
|
||||
tie_V2 = mkV2 (mkV "piesiet" "piesienu" "piesēju") acc_Prep;
|
||||
wash_V2 = mkV2 (mkV "mazgāt" second_conjugation) acc_Prep;
|
||||
wipe_V2 = mkV2 (mkV "slaucīt" third_conjugation) acc_Prep;
|
||||
hunt_V2 = mkV2 (mkV "medīt" second_conjugation) acc_Prep ;
|
||||
kill_V2 = mkV2 (mkV "nogalināt" third_conjugation) acc_Prep ;
|
||||
pull_V2 = mkV2 (mkV "vilkt" "velku" "vilku") acc_Prep ;
|
||||
push_V2 = mkV2 (mkV "stumt" "stumju" "stūmu") acc_Prep ;
|
||||
rub_V2 = mkV2 (mkV "berzt" "beržu" "berzu") acc_Prep ;
|
||||
scratch_V2 = mkV2 (mkV "kasīt" third_conjugation) acc_Prep ;
|
||||
split_V2 = mkV2 (mkV "sadalīt" third_conjugation) acc_Prep ;
|
||||
squeeze_V2 = mkV2 (mkV "saspiest" "saspiežu" "saspiedu") acc_Prep ;
|
||||
stab_V2 = mkV2 (mkV "sadurt" "saduru" "sadūru") acc_Prep ;
|
||||
suck_V2 = mkV2 (mkV "sūkt" "sūcu" "sūcu") acc_Prep ;
|
||||
throw_V2 = mkV2 (mkV "mest" "metu" "metu") acc_Prep ;
|
||||
tie_V2 = mkV2 (mkV "piesiet" "piesienu" "piesēju") acc_Prep ;
|
||||
wash_V2 = mkV2 (mkV "mazgāt" second_conjugation) acc_Prep ;
|
||||
wipe_V2 = mkV2 (mkV "slaucīt" third_conjugation) acc_Prep ;
|
||||
|
||||
-- other_A = regA "other" ;
|
||||
--other_A = regA "other" ;
|
||||
|
||||
grammar_N = mkN "gramatika" ;
|
||||
language_N = mkN "valoda" ;
|
||||
rule_N = mkN "likums" ;
|
||||
|
||||
john_PN = mkPN "Jānis" ;
|
||||
|
||||
|
||||
question_N = mkN "jautājums" ;
|
||||
ready_A = mkA "gatavs" ;
|
||||
reason_N = mkN "iemesls" ;
|
||||
@@ -374,8 +373,8 @@ lin
|
||||
uncertain_A = mkA "nepārliecināts" ;
|
||||
|
||||
oper
|
||||
par_Prep = mkPrep "par" Acc Dat;
|
||||
|
||||
par_Prep = mkPrep "par" Acc Dat ;
|
||||
|
||||
{-
|
||||
atP = mkPrep "at" ;
|
||||
forP = mkPrep "for" ;
|
||||
@@ -383,7 +382,6 @@ oper
|
||||
inP = mkPrep "in" ;
|
||||
onP = mkPrep "on" ;
|
||||
toP = mkPrep "to" ;
|
||||
|
||||
-}
|
||||
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--# -path=.:../common:../abstract
|
||||
|
||||
resource MakeStructuralLav = open CatLav, ParadigmsLav, ResLav, MorphoLav, Prelude in {
|
||||
{-
|
||||
oper
|
||||
mkSubj : Str -> Subj = \x ->
|
||||
lin Subj {s = x} ;
|
||||
mkNP : Str -> ParadigmsEng.Number -> NP = \s,n ->
|
||||
lin NP (regNP s n) ;
|
||||
mkIDet : Str -> ParadigmsEng.Number -> IDet = \s,n ->
|
||||
lin IDet {s = s ; n = n} ;
|
||||
-}
|
||||
}
|
||||
@@ -1,43 +1,12 @@
|
||||
--# -path=.:../../prelude
|
||||
--# -path=.:../abstract:../common:../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
|
||||
-- syntax. To build a lexicon, it is better to use $ParadigmsLav$, which
|
||||
-- gives a higher-level access to this module.
|
||||
|
||||
resource MorphoLav = open Prelude, (Predef=Predef), ResLav in {
|
||||
resource MorphoLav = ResLav ** {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--2 Determiners
|
||||
{-
|
||||
oper
|
||||
|
||||
mkDeterminer : Number -> Str ->
|
||||
{s : Str ; sp : NPCase => Str; n : Number ; hasNum : Bool} = \n,s ->
|
||||
{s = s;
|
||||
sp = \\c => regGenitiveS s ! npcase2case c ;
|
||||
n = n ;
|
||||
hasNum = True ; -- doesn't matter since s = sp
|
||||
} ;
|
||||
|
||||
--2 Pronouns
|
||||
|
||||
|
||||
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
|
||||
{s : NPCase => Str ; sp : Case => Str ; a : Agr} =
|
||||
\i,me,my,mine,n,p,g -> {
|
||||
s = table {
|
||||
NCase Nom => i ;
|
||||
NPAcc => me ;
|
||||
NCase Gen => my
|
||||
} ;
|
||||
a = toAgr n p g ;
|
||||
sp = regGenitiveS mine
|
||||
} ;
|
||||
-}
|
||||
} ;
|
||||
flags
|
||||
optimize = all ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,133 +1,157 @@
|
||||
concrete NounLav of Noun = CatLav ** open MorphoLav, ResLav, Prelude in {
|
||||
flags optimize=all_subs ;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
lin
|
||||
concrete NounLav of Noun = CatLav ** open
|
||||
MorphoLav,
|
||||
ResLav,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
UseN n = {s = \\_ => n.s ; g = n.g} ;
|
||||
UsePN pn = { s = pn.s ; a = agrgP3 Sg pn.g } ;
|
||||
UsePron p = p ;
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ! (fromAgr np.a).g ++ np.s ! c ;
|
||||
a = np.a
|
||||
flags
|
||||
coding = utf8 ;
|
||||
optimize = all_subs ;
|
||||
|
||||
lin
|
||||
UseN n = { s = \\_ => n.s ; g = n.g } ;
|
||||
UsePN pn = { s = pn.s ; a = agrgP3 Sg pn.g } ;
|
||||
UsePron p = p ;
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ! (fromAgr np.a).g ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
UseN2 n = { s = \\_ => n.s ; g = n.g } ;
|
||||
UseN3 n = n ;
|
||||
|
||||
ComplN2 f x = {
|
||||
s = \\_,n,c => preOrPost f.isPre (f.p.s ++ x.s ! (f.p.c ! (fromAgr x.a).n)) (f.s ! n ! c) ;
|
||||
g = f.g
|
||||
} ;
|
||||
|
||||
ComplN3 f x = {
|
||||
s = \\n,c => preOrPost f.isPre1 (f.p1.s ++ x.s ! (f.p1.c ! (fromAgr x.a).n)) (f.s ! n ! c) ;
|
||||
g = f.g ;
|
||||
p = f.p2 ;
|
||||
isPre = f.isPre2
|
||||
} ;
|
||||
|
||||
Use2N3 n = { s = n.s ; g = n.g ; p = n.p1 ; isPre = n.isPre1 } ;
|
||||
Use3N3 n = { s = n.s ; g = n.g ; p = n.p2 ; isPre = n.isPre2 } ;
|
||||
|
||||
AdvNP np adv = {
|
||||
s = \\c => np.s ! c ++ adv.s ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
RelNP np rs = {
|
||||
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetCN det cn = {
|
||||
s = \\c => det.s ! cn.g ! c ++ cn.s ! det.d ! det.n ! c ;
|
||||
a = AgP3 det.n cn.g ;
|
||||
} ;
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c ;
|
||||
n = num.n ;
|
||||
d = quant.d -- FIXME: ja ir kārtas skaitļa vārds, tad tikai noteiktās formas drīkst būt
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c ++ ord.s ! g ! c ;
|
||||
n = num.n ;
|
||||
d = quant.d --FIXME: ja ir kārtas skaitļa vārds, tad tikai noteiktās formas drīkst būt
|
||||
} ;
|
||||
|
||||
DetNP det = {
|
||||
s = \\c => det.s ! Masc ! c ;
|
||||
a = AgP3 det.n Masc
|
||||
} | {
|
||||
s = \\c => det.s ! Fem ! c ;
|
||||
a = AgP3 det.n Fem
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\d,n,c => ap.s ! d ! cn.g ! n ! c ++ cn.s ! d ! n ! c ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
DefArt = {
|
||||
s = \\_,_,_ => [] ;
|
||||
d = Def
|
||||
} ;
|
||||
|
||||
IndefArt = {
|
||||
s = \\_,_,_ => [] ;
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
s = p.possessive ;
|
||||
d = Def ;
|
||||
} ;
|
||||
|
||||
MassNP cn = {
|
||||
s = cn.s ! Indef ! Sg ; -- FIXME: a 'šis alus'? der tak gan 'zaļš alus' gan 'zaļais alus'
|
||||
a = AgP3 Sg cn.g
|
||||
} ;
|
||||
|
||||
NumSg = { s = \\_,_ => [] ; n = Sg ; hasCard = False } ;
|
||||
NumPl = { s = \\_,_ => [] ; n = Pl ; hasCard = False } ;
|
||||
|
||||
NumCard n = n ** { hasCard = True } ;
|
||||
|
||||
NumDigits n = { s = \\g,c => n.s ! NCard ; n = n.n } ;
|
||||
OrdDigits n = { s = \\g,c => n.s ! NOrd } ;
|
||||
|
||||
NumNumeral numeral = { s = numeral.s ! NCard ; n = numeral.n } ;
|
||||
OrdNumeral numeral = { s = numeral.s ! NOrd } ;
|
||||
|
||||
OrdSuperl a = { s = \\g,c => a.s ! (AAdj Superl Def g Sg c) } ;
|
||||
|
||||
AdNum adn num = {
|
||||
s = \\g,c => adn.s ++ num.s ! g ! c ;
|
||||
n = num.n ;
|
||||
hasCard = num.n
|
||||
} ;
|
||||
|
||||
AdvCN cn ad = {
|
||||
s = \\d,n,c => cn.s ! d ! n ! c ++ ad.s ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
-- 'Pielikums'
|
||||
ApposCN cn np = {
|
||||
s = \\d,n,c => case (fromAgr np.a).n of {
|
||||
n => cn.s ! d ! n ! c ++ np.s ! c ; -- FIXME: comparison not working
|
||||
_ => NON_EXISTENT
|
||||
} ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
UseN2 n = {s = \\_ => n.s ; g = n.g};
|
||||
UseN3 n = n;
|
||||
|
||||
ComplN2 f x = {
|
||||
s = \\_,n,c => preOrPost f.isPre (f.p.s ++ x.s ! (f.p.c ! (fromAgr x.a).n)) (f.s ! n ! c);
|
||||
g = f.g
|
||||
} ;
|
||||
ComplN3 f x = {
|
||||
s = \\n,c => preOrPost f.isPre1 (f.p1.s ++ x.s ! (f.p1.c ! (fromAgr x.a).n)) (f.s ! n ! c);
|
||||
g = f.g ;
|
||||
p = f.p2 ;
|
||||
isPre = f.isPre2
|
||||
} ;
|
||||
Use2N3 n = { s = n.s ; g = n.g ; p = n.p1 ; isPre = n.isPre1 };
|
||||
Use3N3 n = { s = n.s ; g = n.g ; p = n.p2 ; isPre = n.isPre2 };
|
||||
|
||||
AdvNP np adv = {
|
||||
s = \\c => np.s ! c ++ adv.s ;
|
||||
a = np.a
|
||||
} ;
|
||||
RelNP np rs = {
|
||||
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetCN det cn = {
|
||||
s = \\c => det.s ! cn.g ! c ++ cn.s ! det.d ! det.n ! c ;
|
||||
a = AgP3 det.n cn.g;
|
||||
} ;
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c;
|
||||
n = num.n ;
|
||||
d = quant.d --FIXME - ja ir kârtas skaitïa vârds, tad tikai noteiktâs formas drîkst bût
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
s = \\g,c => quant.s ! g ! num.n ! c ++ num.s ! g ! c ++ ord.s ! g ! c;
|
||||
n = num.n;
|
||||
d = quant.d --FIXME - ja ir kârtas skaitïa vârds, tad tikai noteiktâs formas drîkst bût
|
||||
} ;
|
||||
RelCN cn rs = {
|
||||
s = \\d, n,c => cn.s ! d ! n ! c ++ "," ++ rs.s ! AgP3 n cn.g ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
DetNP det = {
|
||||
s = \\c => det.s ! Masc ! c ;
|
||||
a = AgP3 det.n Masc
|
||||
} | {
|
||||
s = \\c => det.s ! Fem ! c ;
|
||||
a = AgP3 det.n Fem
|
||||
};
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\d,n,c => ap.s ! d ! cn.g ! n ! c ++ cn.s ! d ! n ! c ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
DefArt = {
|
||||
s = \\_,_,_ =>[];
|
||||
d = Def
|
||||
} ;
|
||||
|
||||
IndefArt = {
|
||||
s = \\_,_,_ => [];
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
s = p.possessive ;
|
||||
d = Def ;
|
||||
} ;
|
||||
SentCN cn sc = {
|
||||
s = \\d,n,c => cn.s ! d ! n ! c ++ "," ++ sc.s ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
MassNP cn = {
|
||||
s = cn.s ! Indef ! Sg ; -- FIXME a 'ðis alus'? der tak gan 'zaïð alus' gan 'zaïais alus'
|
||||
a = AgP3 Sg cn.g
|
||||
} ;
|
||||
|
||||
NumSg = {s = \\_,_ => []; n = Sg ; hasCard = False} ;
|
||||
NumPl = {s = \\_,_ => []; n = Pl ; hasCard = False} ;
|
||||
|
||||
NumCard n = n ** {hasCard = True} ;
|
||||
-- FIXME: vajag -ts / -ta divdabja formu, + šķirot noteikto/nenoteikto galotni
|
||||
PPartNP np v2 = {
|
||||
s = \\c => v2.s ! Pos ! (Participle (fromAgr np.a).g (fromAgr np.a).n c) ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
NumDigits n = {s = \\g,c => n.s ! NCard ; n = n.n} ;
|
||||
OrdDigits n = {s = \\g,c => n.s ! NOrd} ;
|
||||
|
||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;
|
||||
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||
|
||||
OrdSuperl a = {s = \\g,c => a.s ! (AAdj Superl Def g Sg c) } ;
|
||||
|
||||
AdNum adn num = {s = \\g,c => adn.s ++ num.s!g!c ; n = num.n; hasCard = num.n} ;
|
||||
-- TODO: šim vajag -ts -ta divdabjus (+ noteiktās formas tiem)
|
||||
--PPartNP np v2 = {
|
||||
-- s = \\c => np.s ! c ++ v2.s ! VPPart ;
|
||||
-- a = np.a
|
||||
--} ;
|
||||
--SentCN cn sc = { s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g } ;
|
||||
|
||||
AdvCN cn ad = {s = \\d,n,c => cn.s ! d ! n ! c ++ ad.s ; g = cn.g} ;
|
||||
|
||||
ApposCN cn np = { -- 'Pielikums'
|
||||
s = \\d,n,c => case (fromAgr np.a).n of {
|
||||
n => cn.s ! d ! n ! c ++ np.s ! c; -- FIXME - comparison not working
|
||||
_ => NON_EXISTENT };
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
RelCN cn rs = {
|
||||
s = \\d, n,c => cn.s ! d ! n ! c ++ "," ++ rs.s ! AgP3 n cn.g ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
-- FIXME - placeholder
|
||||
SentCN cn sc = {s = \\_,_,_ => NON_EXISTENT ; g = cn.g};
|
||||
PPartNP np v2 = {s = \\_ => NON_EXISTENT ; a = np.a};
|
||||
|
||||
{-
|
||||
TODO - ðim vajag -ts -ta divdabjus (+ noteiktâs formas tiem)
|
||||
PPartNP np v2 = {
|
||||
s = \\c => np.s ! c ++ v2.s ! VPPart ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ;
|
||||
|
||||
-}
|
||||
}
|
||||
|
||||
@@ -1,111 +1,117 @@
|
||||
concrete NumeralLav of Numeral = CatLav ** open ResLav, ParadigmsLav in {
|
||||
flags
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete NumeralLav of Numeral = CatLav ** open
|
||||
ResLav,
|
||||
ParadigmsLav
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8 ;
|
||||
{-
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Case => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ;
|
||||
Sub100 = {s : CardOrd => Case => Str ; n : Number} ;
|
||||
Sub1000 = {s : CardOrd => Case => Str ; n : Number} ;
|
||||
Sub1000000 = {s : CardOrd => Case => Str ; n : Number} ;
|
||||
-}
|
||||
lincat --TODO - formas, kas pieprasa ģenitīvu - tūkstotis grāmatu, trīs simti meiteņu
|
||||
Digit = {s : DForm => CardOrd => Gender => Case => Str} ;
|
||||
Sub10 = {s : CardOrd => Gender => Case => Str ; n : Number};
|
||||
Sub100 = {s : CardOrd => Gender => Case => Str ; n : Number};
|
||||
Sub1000 = {s : CardOrd => Gender => Case => Str ; n : Number};
|
||||
Sub1000000 = {s : CardOrd => Gender => Case => Str ; n : Number};
|
||||
|
||||
lincat
|
||||
-- TODO: formas, kas pieprasa ģenitīvu - tūkstotis grāmatu, trīs simti meiteņu
|
||||
Digit = { s : DForm => CardOrd => Gender => Case => Str } ;
|
||||
Sub10 = { s : CardOrd => Gender => Case => Str ; n : Number } ;
|
||||
Sub100 = { s : CardOrd => Gender => Case => Str ; n : Number } ;
|
||||
Sub1000 = { s : CardOrd => Gender => Case => Str ; n : Number } ;
|
||||
Sub1000000 = { s : CardOrd => Gender => Case => Str ; n : Number } ;
|
||||
|
||||
lin
|
||||
num x = x;
|
||||
n2 = mkNum "divi" "otrais" Pl;
|
||||
n3 = let trijs = mkNumSpec "trijs" "trešais" "trīs" "trīs" Pl in {
|
||||
s = \\f, o, g, c => case <f, o, g, c> of {
|
||||
<unit, NCard, _, Nom> => "trīs";
|
||||
<unit, NCard, _, Dat> => "trim";
|
||||
<unit, NCard, _, Loc> => "trīs";
|
||||
_ => trijs.s ! f ! o ! g ! c
|
||||
}
|
||||
} | {
|
||||
s = \\f, o, g, c => case <f, o, g, c> of {
|
||||
<unit, NCard, _, Nom> => "trīs";
|
||||
_ => trijs.s ! f ! o ! g ! c
|
||||
}
|
||||
};
|
||||
n4 = mkNum "četri" "ceturtais" Pl;
|
||||
n5 = mkNum "pieci" "piektais" Pl;
|
||||
n6 = mkNum "seši" "sestais" Pl;
|
||||
n7 = mkNum "septiņi" "septītais" Pl;
|
||||
n8 = mkNum "astoņi" "astotais" Pl;
|
||||
n9 = mkNum "deviņi" "devītais" Pl;
|
||||
|
||||
pot01 = {s = viens.s ! unit} ** {n = Sg} ;
|
||||
pot0 d = {s = d.s ! unit} ** {n = Pl} ;
|
||||
pot110 = {s = viens.s ! ten} ** {n = Pl} ;
|
||||
pot111 = {s = viens.s ! teen} ** {n = Pl} ;
|
||||
pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
||||
num x = x ;
|
||||
|
||||
n2 = mkNum "divi" "otrais" Pl ;
|
||||
|
||||
n3 =
|
||||
let trijs = mkNumSpec "trijs" "trešais" "trīs" "trīs" Pl
|
||||
in {
|
||||
s = \\f,o,g,c => case <f, o, g, c> of {
|
||||
<unit, NCard, _, Nom> => "trīs" ;
|
||||
<unit, NCard, _, Dat> => "trim" ;
|
||||
<unit, NCard, _, Loc> => "trīs" ;
|
||||
_ => trijs.s ! f ! o ! g ! c
|
||||
}
|
||||
} | {
|
||||
s = \\f,o,g,c => case <f, o, g, c> of {
|
||||
<unit, NCard, _, Nom> => "trīs" ;
|
||||
_ => trijs.s ! f ! o ! g ! c
|
||||
}
|
||||
} ;
|
||||
|
||||
n4 = mkNum "četri" "ceturtais" Pl ;
|
||||
n5 = mkNum "pieci" "piektais" Pl ;
|
||||
n6 = mkNum "seši" "sestais" Pl ;
|
||||
n7 = mkNum "septiņi" "septītais" Pl ;
|
||||
n8 = mkNum "astoņi" "astotais" Pl ;
|
||||
n9 = mkNum "deviņi" "devītais" Pl ;
|
||||
|
||||
pot01 = { s = viens.s ! unit } ** { n = Sg } ;
|
||||
pot0 d = { s = d.s ! unit } ** { n = Pl } ;
|
||||
pot110 = { s = viens.s ! ten } ** { n = Pl } ;
|
||||
pot111 = { s = viens.s ! teen } ** { n = Pl } ;
|
||||
pot1to19 d = { s = d.s ! teen } ** { n = Pl } ;
|
||||
pot0as1 n = { s = n.s ; n = n.n } ;
|
||||
pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||
pot1plus d e = {s = \\o, g, c => d.s ! ten ! NCard ! Masc ! Nom ++ e.s ! o ! g ! c; n = e.n} ;
|
||||
pot1 d = { s = d.s ! ten } ** { n = Pl } ;
|
||||
|
||||
pot1plus d e = {
|
||||
s = \\o,g,c => d.s ! ten ! NCard ! Masc ! Nom ++ e.s ! o ! g ! c ;
|
||||
n = e.n
|
||||
} ;
|
||||
|
||||
pot1as2 n = n ;
|
||||
pot2 d = { s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ simts ! o ! g ! d.n ! c; n = Pl} ; --FIXME - nav īsti labi, kārtas skaitlim ir jābūt 'trīssimtais' utml
|
||||
pot2plus d e = { s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ simts ! NCard ! Masc ! d.n ! Nom ++ e.s ! o ! g ! c; n = e.n} ;
|
||||
|
||||
-- FIXME: nav īsti labi, kārtas skaitlim ir jābūt 'trīssimtais' utml
|
||||
pot2 d = {
|
||||
s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ simts ! o ! g ! d.n ! c ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
pot2plus d e = {
|
||||
s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ simts ! NCard ! Masc ! d.n ! Nom ++ e.s ! o ! g ! c ;
|
||||
n = e.n
|
||||
} ;
|
||||
|
||||
pot2as3 n = n ;
|
||||
pot3 d = { s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ tuukstotis ! o ! g ! d.n ! c; n = Pl} ;
|
||||
pot3plus d e ={ s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ tuukstotis ! NCard ! Masc ! d.n ! Nom ++ e.s ! o ! g ! c; n = e.n} ;
|
||||
|
||||
{-
|
||||
pot3 d = {
|
||||
s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ tuukstotis ! o ! g ! d.n ! c ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ;
|
||||
lin pot0 d = d ** {n = Pl} ;
|
||||
lin pot110 = regCardOrd "ten" ** {n = Pl} ;
|
||||
lin pot111 = regCardOrd "eleven" ** {n = Pl} ;
|
||||
lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
||||
lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||
lin pot1plus d e = {
|
||||
s = \\o,c => d.s ! ten ! NCard ! Nom ++ "-" ++ e.s ! unit ! o ! c ; n = Pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = \\o,c => d.s ! unit ! NCard ! Nom ++ mkCard o "hundred" ! c} ** {n = Pl} ;
|
||||
lin pot2plus d e = {
|
||||
s = \\o,c => d.s ! unit ! NCard ! Nom ++ "hundred" ++ "and" ++ e.s ! o ! c ; n = Pl} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {
|
||||
s = \\o,c => n.s ! NCard ! Nom ++ mkCard o "thousand" ! c ; n = Pl} ;
|
||||
lin pot3plus n m = {
|
||||
s = \\o,c => n.s ! NCard ! Nom ++ "thousand" ++ m.s ! o ! c; n = Pl} ;
|
||||
-}
|
||||
pot3plus d e = {
|
||||
s = \\o,g,c => d.s ! NCard ! Masc ! Nom ++ tuukstotis ! NCard ! Masc ! d.n ! Nom ++ e.s ! o ! g ! c ;
|
||||
n = e.n
|
||||
} ;
|
||||
|
||||
-- numerals as sequences of digits
|
||||
-- Numerals as sequences of digits:
|
||||
|
||||
lincat
|
||||
Dig = {n : Number; s : CardOrd => Str };
|
||||
lincat
|
||||
Dig = { n : Number ; s : CardOrd => Str } ;
|
||||
|
||||
lin
|
||||
IDig d = d ;
|
||||
lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
s = \\o => d.s ! NCard ++ i.s ! o ;
|
||||
n = Pl ; --FIXME 1 cilvēks 11 cilvēki 21 cilvēks ...
|
||||
} ;
|
||||
IIDig d i = {
|
||||
s = \\o => d.s ! NCard ++ i.s ! o ;
|
||||
n = Pl ; -- FIXME: 1 cilvēks, 11 cilvēki, 21 cilvēks, ...
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk2Dig "1" Sg ;
|
||||
D_2 = mkDig "2" ;
|
||||
D_3 = mkDig "3" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk2Dig "1" Sg ;
|
||||
D_2 = mkDig "2" ;
|
||||
D_3 = mkDig "3" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
mkDig : Str -> Dig = \c -> mk2Dig c Pl ;
|
||||
oper
|
||||
mkDig : Str -> Dig = \c -> mk2Dig c Pl ;
|
||||
|
||||
mk2Dig : Str -> Number -> Dig = \c,n -> lin Dig {
|
||||
s = table {NCard => c ; NOrd => c+"."} ;
|
||||
n = n
|
||||
} ;
|
||||
mk2Dig : Str -> Number -> Dig = \c,n -> lin Dig {
|
||||
s = table { NCard => c ; NOrd => c + "." } ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
resource OverloadLav = Overload with (Grammar = GrammarLav) ;
|
||||
@@ -1,4 +1,4 @@
|
||||
-- Latvian adjective paradigms - by Normunds Grūzītis; copied off mini-grammar as of 2011-07-12
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
resource ParadigmsAdjectivesLav = open
|
||||
(Predef=Predef),
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
--1 English Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2003--2005
|
||||
--
|
||||
-- This is an API for the user of the resource grammar
|
||||
-- This is an API for the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
-- expressions of open categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoEng.gf$ is that the types
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoLav.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string arguments of the paradigms.
|
||||
@@ -20,13 +16,10 @@
|
||||
-- first we give a handful of patterns that aim to cover all
|
||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||
-- escape to construct the most irregular words of type $C$.
|
||||
-- However, this function should only seldom be needed: we have a
|
||||
-- separate module [``IrregEng`` ../../english/IrregEng.gf],
|
||||
-- which covers irregular verbss.
|
||||
|
||||
resource ParadigmsLav = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
resource ParadigmsLav = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
ParadigmsNounsLav,
|
||||
ParadigmsAdjectivesLav,
|
||||
ParadigmsVerbsLav,
|
||||
@@ -36,18 +29,18 @@ resource ParadigmsLav = open
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8;
|
||||
coding = utf8 ;
|
||||
|
||||
oper
|
||||
oper
|
||||
second_conjugation : VerbConj = C2 ;
|
||||
third_conjugation : VerbConj = C3 ;
|
||||
|
||||
|
||||
nominative : Case = Nom ;
|
||||
genitive : Case = Gen ;
|
||||
dative : Case = Dat ;
|
||||
genitive : Case = Gen ;
|
||||
dative : Case = Dat ;
|
||||
accusative : Case = Acc ;
|
||||
locative : Case = Loc ;
|
||||
|
||||
locative : Case = Loc ;
|
||||
|
||||
mkN = overload {
|
||||
mkN : (lemma : Str) -> N = \l -> lin N (mkNoun l) ;
|
||||
|
||||
@@ -59,72 +52,76 @@ oper
|
||||
mkN : (lemma : Str) -> NounDecl -> Bool -> N = \l,d,p -> lin N (mkNounByDeclPal l d p) ;
|
||||
mkN : (lemma : Str) -> Gender -> NounDecl -> N = \l,g,d -> lin N (mkNounByGendDecl l g d) ;
|
||||
|
||||
mkN : (lemma : Str) -> Gender -> NounDecl -> Bool -> N = \l,g,d,p -> lin N (mkNounByGendDeclPal l g d p) ;
|
||||
mkN : (lemma : Str) -> Gender -> NounDecl -> Bool -> N = \l,g,d,p ->
|
||||
lin N (mkNounByGendDeclPal l g d p) ;
|
||||
} ;
|
||||
|
||||
|
||||
mkPN = overload {
|
||||
mkN : (lemma : Str) -> PN = \l -> lin PN (mkProperNoun l Sg) ;
|
||||
mkN : (lemma : Str) -> Number -> PN = \l,n -> lin PN (mkProperNoun l n) ;
|
||||
} ;
|
||||
|
||||
|
||||
mkN2 = overload {
|
||||
mkN2 : N -> Prep -> N2 = \n,p -> lin N2 n ** {p = p; isPre = False};
|
||||
mkN2 : N -> Prep -> Bool -> N2 = \n,p,isPre -> lin N2 n ** {p = p; isPre = isPre};
|
||||
mkN2 : N -> Prep -> N2 = \n,p -> lin N2 n ** { p = p ; isPre = False } ;
|
||||
mkN2 : N -> Prep -> Bool -> N2 = \n,p,isPre -> lin N2 n ** { p = p ; isPre = isPre } ;
|
||||
} ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 = \n,p1,p2 -> lin N3 n ** {p1 = p1; p2 = p2; isPre1 = False; isPre2 = False};
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 = \n,p1,p2 ->
|
||||
lin N3 n ** { p1 = p1 ; p2 = p2 ; isPre1 = False ; isPre2 = False } ;
|
||||
|
||||
mkA = overload {
|
||||
mkA : (lemma : Str) -> A = \s -> lin A (mkAdjective s) ;
|
||||
mkA : (lemma : Str) -> AdjType -> A = \s,t -> lin A (mkAdjectiveByType s t) ;
|
||||
mkA : (v : Verb) -> A = \v -> lin A (mkAdjective_Participle v) ;
|
||||
} ;
|
||||
|
||||
mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (a ** {p = p}); -- precējies ar ...
|
||||
|
||||
|
||||
mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (a ** { p = p }) ; -- precējies ar ...
|
||||
mkAS : A -> AS =\a -> lin A a ;
|
||||
mkA2S : A -> Prep -> A2S =\a,p -> lin A2 (a ** {p = p});
|
||||
mkA2S : A -> Prep -> A2S =\a,p -> lin A2 (a ** { p = p }) ;
|
||||
mkAV : A -> AV = \a -> lin A a ;
|
||||
mkA2V : A -> Prep -> A2V = \a,p -> lin A2 (a ** {p = p} );
|
||||
|
||||
AS, AV : Type = {s : AForm => Str } ;
|
||||
A2S, A2V : Type = {s : AForm => Str; p: Prep};
|
||||
mkA2V : A -> Prep -> A2V = \a,p -> lin A2 (a ** { p = p }) ;
|
||||
|
||||
AS, AV : Type = { s : AForm => Str } ;
|
||||
A2S, A2V : Type = { s : AForm => Str ; p : Prep };
|
||||
|
||||
mkV = overload {
|
||||
mkV : (lemma : Str) -> V = \l -> lin V (mkVerb_Irreg l) ;
|
||||
mkV : (lemma : Str) -> VerbConj -> V = \l,c -> lin V (mkVerb l c) ;
|
||||
mkV : (lemma : Str) -> Str -> Str -> V = \l1,l2,l3 -> lin V (mkVerbC1 l1 l2 l3) ;
|
||||
} ;
|
||||
|
||||
mkV2 : V -> Prep -> V2 = \v,p -> lin V2 v ** {p = p};
|
||||
mkVS : V -> Subj -> VS = \v,s -> lin VS v ** {subj = s};
|
||||
mkV2S : V -> Prep -> Subj -> V2S = \v,p,s -> lin V2S v ** {p = p; subj = s};
|
||||
mkVA : V -> VA = \v -> lin VA v;
|
||||
mkV2A : V -> Prep -> V2A = \v,p -> lin V2A v ** {p = p};
|
||||
mkVQ : V -> VQ = \v -> lin VQ v;
|
||||
mkV2Q : V -> Prep -> V2Q = \v,p -> lin V2Q v ** {p = p};
|
||||
|
||||
mkV2 : V -> Prep -> V2 = \v,p -> lin V2 v ** { p = p } ;
|
||||
mkVS : V -> Subj -> VS = \v,s -> lin VS v ** { subj = s } ;
|
||||
mkV2S : V -> Prep -> Subj -> V2S = \v,p,s -> lin V2S v ** { p = p ; subj = s } ;
|
||||
mkVA : V -> VA = \v -> lin VA v ;
|
||||
mkV2A : V -> Prep -> V2A = \v,p -> lin V2A v ** { p = p } ;
|
||||
mkVQ : V -> VQ = \v -> lin VQ v ;
|
||||
mkV2Q : V -> Prep -> V2Q = \v,p -> lin V2Q v ** { p = p } ;
|
||||
mkVV : V -> VV = \v -> lin VV v ;
|
||||
mkV2V : V -> Prep -> V2V = \v,p -> lin V2V v ** {p = p};
|
||||
mkV3 : V -> Prep -> Prep -> V3 = \v,p1,p2 -> lin V3 v ** {p1 = p1; p2 = p2};
|
||||
|
||||
mkCAdv : Str -> Str -> Degree -> CAdv = \s,p,d -> {s = s ; p = p ; d = d; lock_CAdv = <>};
|
||||
|
||||
mkV2V : V -> Prep -> V2V = \v,p -> lin V2V v ** { p = p } ;
|
||||
mkV3 : V -> Prep -> Prep -> V3 = \v,p1,p2 -> lin V3 v ** { p1 = p1 ; p2 = p2 } ;
|
||||
|
||||
mkCAdv : Str -> Str -> Degree -> CAdv = \s,p,d -> { s = s ; p = p ; d = d ; lock_CAdv = <> } ;
|
||||
|
||||
mkPrep = overload {
|
||||
mkPrep : Str -> Case -> Case -> Prep = \prep, sg, pl -> lin Prep { s = prep; c = table { Sg => sg; Pl => pl } };
|
||||
mkPrep : Case -> Prep = \c -> lin Prep { s = []; c = table { _ => c } } ;
|
||||
};
|
||||
|
||||
-- empty fake prepositions for valences / rections that are expressed by simple cases without any prepositions
|
||||
nom_Prep = mkPrep Nom;
|
||||
gen_Prep = mkPrep Gen;
|
||||
dat_Prep = mkPrep Dat;
|
||||
acc_Prep = mkPrep Acc;
|
||||
loc_Prep = mkPrep Loc;
|
||||
|
||||
mkPrep : Str -> Case -> Case -> Prep = \prep,sg,pl ->
|
||||
lin Prep { s = prep ; c = table { Sg => sg ; Pl => pl } } ;
|
||||
mkPrep : Case -> Prep = \c -> lin Prep { s = [] ; c = table { _ => c } } ;
|
||||
} ;
|
||||
|
||||
-- empty fake prepositions for valences
|
||||
-- rections that are expressed by simple cases without any prepositions
|
||||
nom_Prep = mkPrep Nom ;
|
||||
gen_Prep = mkPrep Gen ;
|
||||
dat_Prep = mkPrep Dat ;
|
||||
acc_Prep = mkPrep Acc ;
|
||||
loc_Prep = mkPrep Loc ;
|
||||
|
||||
mkAdv : Str -> Adv = \x -> lin Adv (ss x) ;
|
||||
mkAdV : Str -> AdV = \x -> lin AdV (ss x) ;
|
||||
mkAdA : Str -> AdA = \x -> lin AdA (ss x) ;
|
||||
mkAdN : Str -> AdN = \x -> lin AdN (ss x) ;
|
||||
|
||||
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj = \y -> mk2Conj [] y Pl ;
|
||||
mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ;
|
||||
@@ -132,731 +129,68 @@ oper
|
||||
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
||||
} ;
|
||||
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
lin Conj (sd2 x y ** {n = n}) ;
|
||||
|
||||
viens = mkNumSpec "viens" "pirmais" "vien" "" Sg;
|
||||
mkNum : Str -> Str -> Number -> { s : DForm => CardOrd => Gender => Case => Str } = \pieci,piektais,n -> mkNumSpec pieci piektais (cutStem pieci) (cutStem pieci) n;
|
||||
|
||||
mkNumSpec : Str -> Str -> Str -> Str -> Number -> { s : DForm => CardOrd => Gender => Case => Str } = \pieci,piektais,stem_teen,stem_ten,n -> let
|
||||
masc = mkNoun_D1 pieci ;
|
||||
fem = mkNoun_D4 pieci Fem ;
|
||||
ord = mkAdjective_Pos piektais Def ;
|
||||
padsmit = mkAdjective_Pos (stem_teen+"padsmitais") Def ;
|
||||
desmit = mkAdjective_Pos (stem_ten+"desmitais") Def ;
|
||||
in {
|
||||
s = table {
|
||||
unit => table {
|
||||
NCard => table {
|
||||
Masc => table { c => masc.s ! n ! c } ;
|
||||
Fem => table { c => fem.s ! n ! c }
|
||||
} ;
|
||||
NOrd => table {
|
||||
g => table { c => ord ! g ! Sg ! c } --FIXME - pazaudējam kārtas skaitļu daudzskaitli - 'mēs palikām piektie'
|
||||
}
|
||||
} ;
|
||||
teen => table {
|
||||
NCard => table { g => table { c => stem_teen + "padsmit" } } ;
|
||||
NOrd => table { g => table { c => padsmit ! g ! Sg ! c } }
|
||||
} ;
|
||||
ten => table {
|
||||
NCard => table { g => table { c => stem_ten + "desmit" } } ;
|
||||
NOrd => table { g => table { c => desmit ! g ! Sg ! c } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
simts : CardOrd => Gender => Number => Case => Str = let
|
||||
card = mkNoun_D1 "simts" ;
|
||||
ord = mkAdjective_Pos "simtais" Def ;
|
||||
in table {
|
||||
NCard => table {
|
||||
_ => table { n => table { c => card.s ! n ! c }}
|
||||
} ;
|
||||
NOrd => table {
|
||||
g => table { n => table { c => ord ! g ! n ! c }}
|
||||
}
|
||||
};
|
||||
|
||||
tuukstotis : CardOrd => Gender => Number => Case => Str = let
|
||||
card = mkNoun_D2 "tūkstotis" True;
|
||||
ord = mkAdjective_Pos "tūkstošais" Def ;
|
||||
in table {
|
||||
NCard => table {
|
||||
_ => table { n => table { c => card.s ! n ! c }}
|
||||
} ;
|
||||
NOrd => table {
|
||||
g => table { n => table { c => ord ! g ! n ! c }}
|
||||
}
|
||||
};
|
||||
|
||||
{-
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
human : Gender ;
|
||||
nonhuman : Gender ;
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
-- To abstract over case names, we define the following.
|
||||
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
|
||||
-- Prepositions are used in many-argument functions for rection.
|
||||
-- The resource category $Prep$ is used.
|
||||
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Nouns are constructed by the function $mkN$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkN : overload {
|
||||
|
||||
-- The regular function captures the variants for nouns ending with
|
||||
-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes";
|
||||
-- "fly - flies" (but "toy - toys"),
|
||||
|
||||
mkN : (flash : Str) -> N ;
|
||||
|
||||
-- In practice the worst case is to give singular and plural nominative.
|
||||
|
||||
mkN : (man,men : Str) -> N ;
|
||||
|
||||
-- The theoretical worst case: give all four forms.
|
||||
|
||||
mkN : (man,men,man's,men's : Str) -> N ;
|
||||
|
||||
-- Change gender from the default $nonhuman$.
|
||||
|
||||
mkN : Gender -> N -> N ;
|
||||
|
||||
--3 Compound nouns
|
||||
--
|
||||
-- A compound noun is an uninflected string attached to an inflected noun,
|
||||
-- such as "baby boom", "chief executive officer".
|
||||
|
||||
mkN : Str -> N -> N
|
||||
} ;
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
|
||||
mkN2 : overload {
|
||||
mkN2 : N -> Prep -> N2 ; -- access to
|
||||
mkN2 : N -> Str -> N2 ; -- access to
|
||||
mkN2 : Str -> Str -> N2 ; -- access to
|
||||
mkN2 : N -> N2 ; -- wife of
|
||||
mkN2 : Str -> N2 -- daughter of
|
||||
} ;
|
||||
|
||||
-- Use the function $mkPrep$ or see the section on prepositions below to
|
||||
-- form other prepositions.
|
||||
--
|
||||
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
|
||||
|
||||
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names, with a regular genitive, are formed from strings.
|
||||
|
||||
mkPN : overload {
|
||||
|
||||
mkPN : Str -> PN ;
|
||||
|
||||
-- Sometimes a common noun can be reused as a proper name, e.g. "Bank"
|
||||
|
||||
mkPN : N -> PN
|
||||
} ;
|
||||
|
||||
--3 Determiners and quantifiers
|
||||
|
||||
mkQuant : overload {
|
||||
mkQuant : (this, these : Str) -> Quant ;
|
||||
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant ;
|
||||
} ;
|
||||
|
||||
mkOrd : Str -> Ord ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA : overload {
|
||||
|
||||
-- For regular adjectives, the adverbial and comparison forms are derived. This holds
|
||||
-- even for cases with the variations "happy - happily - happier - happiest",
|
||||
-- "free - freely - freer - freest", and "rude - rudest".
|
||||
|
||||
mkA : (happy : Str) -> A ;
|
||||
|
||||
-- However, the duplication of the final consonant cannot be predicted,
|
||||
-- but a separate case is used to give the comparative
|
||||
|
||||
mkA : (fat,fatter : Str) -> A ;
|
||||
|
||||
-- As many as four forms may be needed.
|
||||
|
||||
mkA : (good,better,best,well : Str) -> A
|
||||
} ;
|
||||
|
||||
-- Regular comparison is formed by "more - most" for words with two vowels separated
|
||||
-- and terminated by some other letters. To force this or the opposite,
|
||||
-- the following can be used:
|
||||
|
||||
compoundA : A -> A ; -- -/more/most ditto
|
||||
simpleA : A -> A ; -- young,younger,youngest
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
|
||||
mkA2 : overload {
|
||||
mkA2 : A -> Prep -> A2 ; -- absent from
|
||||
mkA2 : A -> Str -> A2 ; -- absent from
|
||||
mkA2 : Str -> Prep -> A2 ; -- absent from
|
||||
mkA2 : Str -> Str -> A2 -- absent from
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
--2 Adverbs
|
||||
|
||||
-- Adverbs are not inflected. Most lexical ones have position
|
||||
-- after the verb. Some can be preverbal (e.g. "always").
|
||||
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdV : Str -> AdV ;
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
|
||||
-- Adverbs modifying numerals
|
||||
|
||||
mkAdN : Str -> AdN ;
|
||||
|
||||
--2 Prepositions
|
||||
--
|
||||
-- A preposition as used for rection in the lexicon, as well as to
|
||||
-- build $PP$s in the resource API, just requires a string.
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
noPrep : Prep ;
|
||||
|
||||
-- (These two functions are synonyms.)
|
||||
|
||||
--2 Conjunctions
|
||||
--
|
||||
|
||||
mkConj : overload {
|
||||
mkConj : Str -> Conj ; -- and (plural agreement)
|
||||
mkConj : Str -> Number -> Conj ; -- or (agrement number given as argument)
|
||||
mkConj : Str -> Str -> Conj ; -- both ... and (plural)
|
||||
mkConj : Str -> Str -> Number -> Conj ; -- either ... or (agrement number given as argument)
|
||||
} ;
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
|
||||
-- Verbs are constructed by the function $mkV$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkV : overload {
|
||||
|
||||
-- The regular verb function recognizes the special cases where the last
|
||||
-- character is "y" ("cry-cries" but "buy-buys") or a sibilant
|
||||
-- ("kiss-"kisses", "jazz-jazzes", "rush-rushes", "munch - munches",
|
||||
-- "fix - fixes").
|
||||
|
||||
mkV : (cry : Str) -> V ;
|
||||
|
||||
-- Give the present and past forms for regular verbs where
|
||||
-- the last letter is duplicated in some forms,
|
||||
-- e.g. "rip - ripped - ripping".
|
||||
|
||||
mkV : (stop, stopped : Str) -> V ;
|
||||
|
||||
-- There is an extensive list of irregular verbs in the module $IrregularEng$.
|
||||
-- In practice, it is enough to give three forms,
|
||||
-- e.g. "drink - drank - drunk".
|
||||
|
||||
mkV : (drink, drank, drunk : Str) -> V ;
|
||||
|
||||
-- Irregular verbs with duplicated consonant in the present participle.
|
||||
|
||||
mkV : (run, ran, run, running : Str) -> V ;
|
||||
|
||||
-- Except for "be", the worst case needs five forms: the infinitive and
|
||||
-- the third person singular present, the past indicative, and the
|
||||
-- past and present participles.
|
||||
|
||||
mkV : (go, goes, went, gone, going : Str) -> V ;
|
||||
|
||||
-- Adds a prefix to an exisiting verb. This is most useful to create
|
||||
-- prefix-variants of irregular verbs from $IrregEng$, e.g. "undertake".
|
||||
|
||||
mkV : Str -> V -> V ;
|
||||
};
|
||||
|
||||
-- Verbs with a particle.
|
||||
-- The particle, such as in "switch on", is given as a string.
|
||||
|
||||
partV : V -> Str -> V ;
|
||||
|
||||
-- Reflexive verbs.
|
||||
-- By default, verbs are not reflexive; this function makes them that.
|
||||
|
||||
reflV : V -> V ;
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs). Notice that a particle comes from the $V$.
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ; -- kill
|
||||
mkV2 : V -> V2 ; -- hit
|
||||
mkV2 : V -> Prep -> V2 ; -- believe in
|
||||
mkV2 : V -> Str -> V2 ; -- believe in
|
||||
mkV2 : Str -> Prep -> V2 ; -- believe in
|
||||
mkV2 : Str -> Str -> V2 -- believe in
|
||||
};
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : overload {
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
|
||||
mkV3 : V -> Prep -> V3 ; -- give,_,to
|
||||
mkV3 : V -> Str -> V3 ; -- give,_,to
|
||||
mkV3 : Str -> Str -> V3 ; -- give,_,to
|
||||
mkV3 : V -> V3 ; -- give,_,_
|
||||
mkV3 : Str -> V3 ; -- give,_,_
|
||||
};
|
||||
|
||||
--3 Other complement patterns
|
||||
--
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
|
||||
-- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$.
|
||||
-- $V0$ is just $V$; the second argument is treated as adverb.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
|
||||
--2 Other categories
|
||||
|
||||
mkSubj : Str -> Subj = \s -> lin Subj {s = s} ;
|
||||
|
||||
--.
|
||||
--2 Definitions of paradigms
|
||||
--
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
|
||||
Gender = ResEng.Gender ;
|
||||
Number = ResEng.Number ;
|
||||
Case = ResEng.Case ;
|
||||
human = Masc ;
|
||||
nonhuman = Neutr ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
nominative = Nom ;
|
||||
genitive = Gen ;
|
||||
|
||||
Preposition : Type = Str ; -- obsolete
|
||||
|
||||
regN = \ray ->
|
||||
let rays = add_s ray
|
||||
in
|
||||
mk2N ray rays ;
|
||||
|
||||
|
||||
add_s : Str -> Str = \w -> case w of {
|
||||
_ + ("io" | "oo") => w + "s" ; -- radio, bamboo
|
||||
_ + ("s" | "z" | "x" | "sh" | "ch" | "o") => w + "es" ; -- bus, hero
|
||||
_ + ("a" | "o" | "u" | "e") + "y" => w + "s" ; -- boy
|
||||
x + "y" => x + "ies" ; -- fly
|
||||
_ => w + "s" -- car
|
||||
} ;
|
||||
|
||||
duplFinal : Str -> Str = \w -> case w of {
|
||||
_ + ("a" | "e" | "o") + ("a" | "e" | "i" | "o" | "u") + ? => w ; -- waited, needed
|
||||
_ + ("a" | "e" | "i" | "o" | "u") +
|
||||
c@("b"|"d"|"g"|"m"|"n"|"p"|"r"|"t") => w + c ; -- omitted, manned
|
||||
_ => w
|
||||
} ;
|
||||
|
||||
mk2N = \man,men ->
|
||||
let mens = case last men of {
|
||||
"s" => men + "'" ;
|
||||
_ => men + "'s"
|
||||
}
|
||||
in
|
||||
mk4N man men (man + "'s") mens ;
|
||||
|
||||
mk4N = \man,men,man's,men's ->
|
||||
lin N (mkNoun man man's men men's ** {g = Neutr}) ;
|
||||
|
||||
genderN g man = lin N {s = man.s ; g = g} ;
|
||||
|
||||
compoundN s n = lin N {s = \\x,y => s ++ n.s ! x ! y ; g=n.g} ;
|
||||
|
||||
mkPN = overload {
|
||||
mkPN : Str -> PN = regPN ;
|
||||
mkPN : N -> PN = nounPN
|
||||
} ;
|
||||
|
||||
mkN2 = overload {
|
||||
mkN2 : N -> Prep -> N2 = prepN2 ;
|
||||
mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s);
|
||||
mkN2 : Str -> Str -> N2 = \n,s -> prepN2 (regN n) (mkPrep s);
|
||||
mkN2 : N -> N2 = \n -> prepN2 n (mkPrep "of") ;
|
||||
mkN2 : Str -> N2 = \s -> prepN2 (regN s) (mkPrep "of")
|
||||
} ;
|
||||
|
||||
prepN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ;
|
||||
regN2 n = prepN2 (regN n) (mkPrep "of") ;
|
||||
|
||||
mkN3 = \n,p,q -> lin N3 (n ** {c2 = p.s ; c3 = q.s}) ;
|
||||
|
||||
--3 Relational common noun phrases
|
||||
--
|
||||
-- In some cases, you may want to make a complex $CN$ into a
|
||||
-- relational noun (e.g. "the old town hall of").
|
||||
|
||||
cnN2 : CN -> Prep -> N2 ;
|
||||
cnN3 : CN -> Prep -> Prep -> N3 ;
|
||||
|
||||
-- This is obsolete.
|
||||
cnN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ;
|
||||
cnN3 = \n,p,q -> lin N3 (n ** {c2 = p.s ; c3 = q.s}) ;
|
||||
|
||||
regPN n = regGenPN n human ;
|
||||
regGenPN n g = lin PN {s = table {Gen => n + "'s" ; _ => n} ; g = g} ;
|
||||
nounPN n = lin PN {s = n.s ! singular ; g = n.g} ;
|
||||
|
||||
mkQuant = overload {
|
||||
mkQuant : (this, these : Str) -> Quant = \sg,pl -> mkQuantifier sg pl sg pl;
|
||||
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier;
|
||||
} ;
|
||||
|
||||
mkQuantifier : Str -> Str -> Str -> Str -> Quant =
|
||||
\sg,pl,sg',pl' -> lin Quant {
|
||||
s = \\_ => table { Sg => sg ; Pl => pl } ;
|
||||
sp = \\_ => table { Sg => regGenitiveS sg' ; Pl => regGenitiveS pl'}
|
||||
} ;
|
||||
|
||||
mkOrd : Str -> Ord = \x -> lin Ord { s = regGenitiveS x};
|
||||
|
||||
mk2A a b = mkAdjective a a a b ;
|
||||
regA a = case a of {
|
||||
_ + ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ +
|
||||
("a" | "e" | "i" | "o" | "u" | "y") + ? + _ =>
|
||||
lin A (compoundADeg (regADeg a)) ;
|
||||
_ => lin A (regADeg a)
|
||||
} ;
|
||||
|
||||
prepA2 a p = lin A2 (a ** {c2 = p.s}) ;
|
||||
|
||||
ADeg = A ; ----
|
||||
|
||||
mkADeg a b c d = mkAdjective a b c d ;
|
||||
|
||||
regADeg happy =
|
||||
let
|
||||
happ = init happy ;
|
||||
y = last happy ;
|
||||
happie = case y of {
|
||||
"y" => happ + "ie" ;
|
||||
"e" => happy ;
|
||||
_ => duplFinal happy + "e"
|
||||
} ;
|
||||
happily : Str = case happy of {
|
||||
_ + "ble" => init happy + "y" ;
|
||||
_ + "y" => happ + "ily" ;
|
||||
_ + "ll" => happy + "y" ;
|
||||
_ => happy + "ly"
|
||||
} ;
|
||||
in mkADeg happy (happie + "r") (happie + "st") happily ;
|
||||
|
||||
duplADeg fat =
|
||||
mkADeg fat
|
||||
(fat + last fat + "er") (fat + last fat + "est") (fat + "ly") ;
|
||||
|
||||
compoundADeg a =
|
||||
let ad = (a.s ! AAdj Posit Nom)
|
||||
in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ;
|
||||
|
||||
adegA a = a ;
|
||||
|
||||
mkAdv x = lin Adv (ss x) ;
|
||||
mkAdV x = lin AdV (ss x) ;
|
||||
mkAdA x = lin AdA (ss x) ;
|
||||
mkAdN x = lin AdN (ss x) ;
|
||||
|
||||
mkPrep p = lin Prep (ss p) ;
|
||||
noPrep = mkPrep [] ;
|
||||
|
||||
mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ;
|
||||
|
||||
regV cry =
|
||||
let
|
||||
cries = (regN cry).s ! Pl ! Nom ; -- !
|
||||
cried : Str = case cries of {
|
||||
_ + "es" => init cries + "d" ;
|
||||
_ => duplFinal cry + "ed"
|
||||
} ;
|
||||
crying : Str = case cry of {
|
||||
_ + "ee" => cry + "ing" ;
|
||||
d + "ie" => d + "ying" ;
|
||||
us + "e" => us + "ing" ;
|
||||
_ => duplFinal cry + "ing"
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n -> lin Conj (sd2 x y ** { n = n }) ;
|
||||
|
||||
viens = mkNumSpec "viens" "pirmais" "vien" "" Sg ;
|
||||
|
||||
mkNum : Str -> Str -> Number -> { s : DForm => CardOrd => Gender => Case => Str } =
|
||||
\pieci,piektais,n -> mkNumSpec pieci piektais (cutStem pieci) (cutStem pieci) n ;
|
||||
|
||||
mkNumSpec : Str -> Str -> Str -> Str -> Number -> { s : DForm => CardOrd => Gender => Case => Str } =
|
||||
\pieci,piektais,stem_teen,stem_ten,n ->
|
||||
let
|
||||
masc = mkNoun_D1 pieci ;
|
||||
fem = mkNoun_D4 pieci Fem ;
|
||||
ord = mkAdjective_Pos piektais Def ;
|
||||
padsmit = mkAdjective_Pos (stem_teen+"padsmitais") Def ;
|
||||
desmit = mkAdjective_Pos (stem_ten+"desmitais") Def ;
|
||||
in {
|
||||
s = table {
|
||||
unit => table {
|
||||
NCard => table {
|
||||
Masc => table { c => masc.s ! n ! c } ;
|
||||
Fem => table { c => fem.s ! n ! c }
|
||||
} ;
|
||||
NOrd => table {
|
||||
-- FIXME: pazaudējam kārtas skaitļu daudzskaitli - 'mēs palikām piektie'
|
||||
g => table { c => ord ! g ! Sg ! c }
|
||||
}
|
||||
} ;
|
||||
teen => table {
|
||||
NCard => table { g => table { c => stem_teen + "padsmit" } } ;
|
||||
NOrd => table { g => table { c => padsmit ! g ! Sg ! c } }
|
||||
} ;
|
||||
ten => table {
|
||||
NCard => table { g => table { c => stem_ten + "desmit" } } ;
|
||||
NOrd => table { g => table { c => desmit ! g ! Sg ! c } }
|
||||
}
|
||||
}
|
||||
in mk5V cry cries cried cried crying ;
|
||||
|
||||
reg2V fit fitted =
|
||||
let fitt = Predef.tk 2 fitted ;
|
||||
in mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ;
|
||||
|
||||
regDuplV fit =
|
||||
case last fit of {
|
||||
("a" | "e" | "i" | "o" | "u" | "y") =>
|
||||
Predef.error (["final duplication makes no sense for"] ++ fit) ;
|
||||
t =>
|
||||
let fitt = fit + t in
|
||||
mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing")
|
||||
} ;
|
||||
|
||||
irregV x y z = let reg = (regV x).s in
|
||||
mk5V x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = []} ;
|
||||
|
||||
irreg4V x y z w = let reg = (regV x).s in
|
||||
mk5V x (reg ! VPres) y z w ** {s1 = []} ;
|
||||
|
||||
irregDuplV fit y z =
|
||||
let
|
||||
fitting = (regDuplV fit).s ! VPresPart
|
||||
in
|
||||
mk5V fit (fit + "s") y z fitting ;
|
||||
|
||||
partV v p = lin V {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ;
|
||||
reflV v = lin V {s = v.s ; part = v.part ; isRefl = True} ;
|
||||
|
||||
prepV2 v p = lin V2 {s = v.s ; s1 = v.s1 ; c2 = p.s ; isRefl = v.isRefl} ;
|
||||
dirV2 v = prepV2 v noPrep ;
|
||||
|
||||
prepPrepV3 v p q =
|
||||
lin V3 {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; isRefl = v.isRefl} ;
|
||||
dirV3 v p = prepPrepV3 v noPrep p ;
|
||||
dirdirV3 v = dirV3 v noPrep ;
|
||||
|
||||
mkVS v = lin VS v ;
|
||||
mkVV v = lin VV {
|
||||
s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ;
|
||||
--- variants {}} ; not used
|
||||
isAux = False
|
||||
} ;
|
||||
mkVQ v = lin VQ v ;
|
||||
|
||||
V0 : Type = V ;
|
||||
-- V2S, V2V, V2Q : Type = V2 ;
|
||||
AS, A2S, AV : Type = A ;
|
||||
A2V : Type = A2 ;
|
||||
|
||||
mkV0 v = v ;
|
||||
mkV2S v p = lin V2S (prepV2 v p) ;
|
||||
mkV2V v p t = lin V2V (prepV2 v p ** {isAux = False}) ;
|
||||
mkVA v = lin VA v ;
|
||||
mkV2A v p = lin V2A (prepV2 v p) ;
|
||||
mkV2Q v p = lin V2Q (prepV2 v p) ;
|
||||
|
||||
mkAS v = v ;
|
||||
mkA2S v p = lin A (prepA2 v p) ;
|
||||
mkAV v = v ;
|
||||
mkA2V v p = prepA2 v p ;
|
||||
|
||||
|
||||
-- pre-overload API and overload definitions
|
||||
|
||||
mk4N : (man,men,man's,men's : Str) -> N ;
|
||||
regN : Str -> N ;
|
||||
mk2N : (man,men : Str) -> N ;
|
||||
genderN : Gender -> N -> N ;
|
||||
compoundN : Str -> N -> N ;
|
||||
|
||||
mkN = overload {
|
||||
mkN : (man,men,man's,men's : Str) -> N = mk4N ;
|
||||
mkN : Str -> N = regN ;
|
||||
mkN : (man,men : Str) -> N = mk2N ;
|
||||
mkN : Gender -> N -> N = genderN ;
|
||||
mkN : Str -> N -> N = compoundN
|
||||
simts : CardOrd => Gender => Number => Case => Str =
|
||||
let
|
||||
card = mkNoun_D1 "simts" ;
|
||||
ord = mkAdjective_Pos "simtais" Def ;
|
||||
in table {
|
||||
NCard => table {
|
||||
_ => table { n => table { c => card.s ! n ! c } }
|
||||
} ;
|
||||
NOrd => table {
|
||||
g => table { n => table { c => ord ! g ! n ! c } }
|
||||
}
|
||||
} ;
|
||||
|
||||
-- Relational nouns ("daughter of x") need a preposition.
|
||||
|
||||
prepN2 : N -> Prep -> N2 ;
|
||||
|
||||
-- The most common preposition is "of", and the following is a
|
||||
-- shortcut for regular relational nouns with "of".
|
||||
|
||||
regN2 : Str -> N2 ;
|
||||
|
||||
mk2A : (free,freely : Str) -> A ;
|
||||
regA : Str -> A ;
|
||||
|
||||
mkA = overload {
|
||||
mkA : Str -> A = regA ;
|
||||
mkA : (fat,fatter : Str) -> A = \fat,fatter ->
|
||||
mkAdjective fat fatter (init fatter + "st") (fat + "ly") ;
|
||||
mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
|
||||
mkAdjective a b c d
|
||||
tuukstotis : CardOrd => Gender => Number => Case => Str =
|
||||
let
|
||||
card = mkNoun_D2 "tūkstotis" True ;
|
||||
ord = mkAdjective_Pos "tūkstošais" Def ;
|
||||
in table {
|
||||
NCard => table {
|
||||
_ => table { n => table { c => card.s ! n ! c } }
|
||||
} ;
|
||||
NOrd => table {
|
||||
g => table { n => table { c => ord ! g ! n ! c } }
|
||||
}
|
||||
} ;
|
||||
|
||||
compoundA = compoundADeg ;
|
||||
simpleA a =
|
||||
let ad = (a.s ! AAdj Posit Nom)
|
||||
in regADeg ad ;
|
||||
|
||||
prepA2 : A -> Prep -> A2 ;
|
||||
|
||||
mkA2 = overload {
|
||||
mkA2 : A -> Prep -> A2 = prepA2 ;
|
||||
mkA2 : A -> Str -> A2 = \a,p -> prepA2 a (mkPrep p) ;
|
||||
mkA2 : Str -> Prep -> A2 = \a,p -> prepA2 (regA a) p;
|
||||
mkA2 : Str -> Str -> A2 = \a,p -> prepA2 (regA a) (mkPrep p);
|
||||
} ;
|
||||
|
||||
mk5V : (go, goes, went, gone, going : Str) -> V ;
|
||||
regV : (cry : Str) -> V ;
|
||||
reg2V : (stop, stopped : Str) -> V;
|
||||
irregV : (drink, drank, drunk : Str) -> V ;
|
||||
irreg4V : (run, ran, run, running : Str) -> V ;
|
||||
|
||||
-- Use reg2V instead
|
||||
regDuplV : Str -> V ;
|
||||
-- Use irreg4V instead
|
||||
irregDuplV : (get, got, gotten : Str) -> V ;
|
||||
|
||||
mkV = overload {
|
||||
mkV : (cry : Str) -> V = regV ;
|
||||
mkV : (stop, stopped : Str) -> V = reg2V ;
|
||||
mkV : (drink, drank, drunk : Str) -> V = irregV ;
|
||||
mkV : (run, ran, run, running : Str) -> V = irreg4V ;
|
||||
mkV : (go, goes, went, gone, going : Str) -> V = mk5V ;
|
||||
mkV : Str -> V -> V = prefixV
|
||||
};
|
||||
|
||||
prepV2 : V -> Prep -> V2 ;
|
||||
dirV2 : V -> V2 ;
|
||||
prefixV : Str -> V -> V = \p,v -> v ** { s = p + v.s } ;
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : V -> V2 = dirV2 ;
|
||||
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
|
||||
mkV2 : V -> Prep -> V2 = prepV2 ;
|
||||
mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ;
|
||||
mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ;
|
||||
mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p)
|
||||
};
|
||||
|
||||
prepPrepV3 : V -> Prep -> Prep -> V3 ;
|
||||
dirV3 : V -> Prep -> V3 ;
|
||||
dirdirV3 : V -> V3 ;
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : V -> Prep -> Prep -> V3 = prepPrepV3 ;
|
||||
mkV3 : V -> Prep -> V3 = dirV3 ;
|
||||
mkV3 : V -> Str -> V3 = \v,s -> dirV3 v (mkPrep s);
|
||||
mkV3 : Str -> Str -> V3 = \v,s -> dirV3 (regV v) (mkPrep s);
|
||||
mkV3 : V -> V3 = dirdirV3 ;
|
||||
mkV3 : Str -> V3 = \v -> dirdirV3 (regV v) ;
|
||||
} ;
|
||||
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj = \y -> mk2Conj [] y plural ;
|
||||
mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ;
|
||||
mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ;
|
||||
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
||||
} ;
|
||||
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
lin Conj (sd2 x y ** {n = n}) ;
|
||||
|
||||
---- obsolete
|
||||
|
||||
-- Comparison adjectives may two more forms.
|
||||
|
||||
ADeg : Type ;
|
||||
|
||||
mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||
|
||||
-- The regular pattern recognizes two common variations:
|
||||
-- "-e" ("rude" - "ruder" - "rudest") and
|
||||
-- "-y" ("happy - happier - happiest - happily")
|
||||
|
||||
regADeg : Str -> ADeg ; -- long, longer, longest
|
||||
|
||||
-- However, the duplication of the final consonant is nor predicted,
|
||||
-- but a separate pattern is used:
|
||||
|
||||
duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
||||
|
||||
-- If comparison is formed by "more", "most", as in general for
|
||||
-- long adjective, the following pattern is used:
|
||||
|
||||
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||
|
||||
-- From a given $ADeg$, it is possible to get back to $A$.
|
||||
|
||||
adegA : ADeg -> A ;
|
||||
|
||||
|
||||
regPN : Str -> PN ;
|
||||
regGenPN : Str -> Gender -> PN ; -- John, John's
|
||||
|
||||
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
||||
|
||||
nounPN : N -> PN ;
|
||||
|
||||
|
||||
-}
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- Latvian noun paradigms - by Normunds Grūzītis & Pēteris Paikens
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
resource ParadigmsNounsLav = open
|
||||
(Predef=Predef),
|
||||
@@ -13,7 +13,7 @@ flags
|
||||
oper
|
||||
Noun : Type = {s : Number => Case => Str ; g : Gender} ;
|
||||
ProperNoun : Type = {s : Case => Str; g : Gender; n : Number} ;
|
||||
|
||||
|
||||
masculine : Gender = Masc ;
|
||||
feminine : Gender = Fem ;
|
||||
|
||||
@@ -153,7 +153,7 @@ oper
|
||||
-- Pl: -i
|
||||
-- should be provided only in the case of plural mass nouns
|
||||
-- produces an incorrect Sg.Nom form if plural lemma is given
|
||||
-- the incorrect Sg.Nom forms should be filtered out by a domain lexicon
|
||||
-- the incorrect Sg.Nom forms should be filtered out by a domain lexicon
|
||||
mkNoun_D2 : Str -> Bool -> Noun = \lemma,pal ->
|
||||
let stem : Str = cutStem lemma
|
||||
in {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
-- Latvian pronoun paradigms - by Normunds Grūzītis; copied off mini-grammar as of 2011-07-12
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
resource ParadigmsPronounsLav = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
resource ParadigmsPronounsLav = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
ResLav,
|
||||
CatLav
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8;
|
||||
|
||||
|
||||
oper
|
||||
PronGend : Type = {s : Gender => Number => Case => Str} ;
|
||||
PronGend : Type = {s : Gender => Number => Case => Str} ;
|
||||
|
||||
-- PRONOUNS (incl. 'determiners')
|
||||
|
||||
@@ -35,7 +35,7 @@ oper
|
||||
Dat => stem + "am" ;
|
||||
Acc => stem + "u" ;
|
||||
Loc => stem + "ā" ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT --FIXME - var tak uzrunā arī likt determineru
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => stem + "i" ;
|
||||
@@ -114,5 +114,5 @@ oper
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
-- Latvian verb paradigms - by Pēteris Paikens & Normunds Grūzītis
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
resource ParadigmsVerbsLav = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
resource ParadigmsVerbsLav = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
ResLav,
|
||||
CatLav
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8 ;
|
||||
|
||||
oper
|
||||
|
||||
oper
|
||||
Verb_TMP : Type = {s : VerbForm => Str} ;
|
||||
|
||||
-- Second and third conjugations
|
||||
@@ -92,7 +92,7 @@ oper
|
||||
Indicative P3 _ Fut => pal_C1_1 stem3 stem + "s" ;
|
||||
Indicative P3 _ Past => stem3 + "a" ;
|
||||
|
||||
Indicative _ _ Cond => stem + "tu";
|
||||
Indicative _ _ Cond => stem + "tu";
|
||||
|
||||
Relative Pres => stem2 + "ot" ;
|
||||
Relative Fut => pal_C1_1 stem3 stem + "šot" ;
|
||||
@@ -101,11 +101,11 @@ oper
|
||||
|
||||
Debitive => "jā" + stem2 ;
|
||||
DebitiveRelative => "jā" + stem2 + "ot" ;
|
||||
|
||||
|
||||
Imperative Sg => stem3 ;
|
||||
Imperative Pl => stem3 + "iet" ;
|
||||
|
||||
Participle g n c => participle_normal_l g n c (pal_C1_3 stem3) (pal_C1_4 stem3)
|
||||
|
||||
Participle g n c => participle_normal_l g n c (pal_C1_3 stem3) (pal_C1_4 stem3)
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -135,7 +135,7 @@ oper
|
||||
Indicative P3 _ Fut => stem + "s" ;
|
||||
Indicative P3 _ Past => stem + "ja" ;
|
||||
|
||||
Indicative _ _ Cond => stem + "tu";
|
||||
Indicative _ _ Cond => stem + "tu";
|
||||
|
||||
Relative Pres => stem + "jot" ;
|
||||
Relative Fut => stem + "šot" ;
|
||||
@@ -144,10 +144,10 @@ oper
|
||||
|
||||
Debitive => "jā" + stem ;
|
||||
DebitiveRelative => "jā" + stem + "jot" ;
|
||||
|
||||
|
||||
Imperative Sg => stem ;
|
||||
Imperative Pl => stem + "jiet";
|
||||
|
||||
|
||||
Participle g n c => participle_normal g n c (stem + "j")
|
||||
}
|
||||
} ;
|
||||
@@ -178,7 +178,7 @@ oper
|
||||
Indicative P3 _ Fut => stem + "s" ;
|
||||
Indicative P3 _ Past => stem + "ja" ;
|
||||
|
||||
Indicative _ _ Cond => stem + "tu";
|
||||
Indicative _ _ Cond => stem + "tu";
|
||||
|
||||
Relative Pres => pal_C3_1 stem + "ot" ;
|
||||
Relative Fut => stem + "šot" ;
|
||||
@@ -187,7 +187,7 @@ oper
|
||||
|
||||
Debitive => pal_C3_3 stem ;
|
||||
DebitiveRelative => pal_C3_3 stem + "ot" ;
|
||||
|
||||
|
||||
Imperative Sg => pal_C3_1 stem + "i" ;
|
||||
Imperative Pl => pal_C3_1 stem + "iet";
|
||||
|
||||
@@ -224,7 +224,7 @@ oper
|
||||
Indicative P3 _ Fut => pal_C1_1 stem3 stem + "sies" ;
|
||||
Indicative P3 _ Past => stem3 + "ās" ;
|
||||
|
||||
Indicative _ _ Cond => stem + "tos";
|
||||
Indicative _ _ Cond => stem + "tos";
|
||||
|
||||
Relative Pres => stem2 + "oties" ;
|
||||
Relative Fut => pal_C1_1 stem3 stem + "šoties" ;
|
||||
@@ -233,11 +233,11 @@ oper
|
||||
|
||||
Debitive => "jā" + stem2 + "as" ;
|
||||
DebitiveRelative => "jā" + stem2 + "oties" ;
|
||||
|
||||
|
||||
Imperative Sg => pal_C1_2 stem3 stem2 + "ies" ;
|
||||
Imperative Pl => pal_C1_2 stem3 stem2 + "ieties" ;
|
||||
|
||||
Participle g n c => participle_reflexive_l g n c (pal_C1_3 stem3) (pal_C1_4 stem3)
|
||||
Participle g n c => participle_reflexive_l g n c (pal_C1_3 stem3) (pal_C1_4 stem3)
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -267,7 +267,7 @@ oper
|
||||
Indicative P3 _ Fut => stem + "sies" ;
|
||||
Indicative P3 _ Past => stem + "jās" ;
|
||||
|
||||
Indicative _ _ Cond => stem + "tos";
|
||||
Indicative _ _ Cond => stem + "tos";
|
||||
|
||||
Relative Pres => stem + "joties" ;
|
||||
Relative Fut => stem + "šoties" ;
|
||||
@@ -276,7 +276,7 @@ oper
|
||||
|
||||
Debitive => "jā" + stem + "jas" ;
|
||||
DebitiveRelative => "jā" + stem + "joties" ;
|
||||
|
||||
|
||||
Imperative Sg => stem + "jies" ;
|
||||
Imperative Pl => stem + "jieties" ;
|
||||
|
||||
@@ -310,7 +310,7 @@ oper
|
||||
Indicative P3 _ Fut => stem + "sies" ;
|
||||
Indicative P3 _ Past => stem + "jās" ;
|
||||
|
||||
Indicative _ _ Cond => stem + "tos";
|
||||
Indicative _ _ Cond => stem + "tos";
|
||||
|
||||
Relative Pres => pal_C3_1 stem + "oties" ;
|
||||
Relative Fut => stem + "šoties" ;
|
||||
@@ -322,7 +322,7 @@ oper
|
||||
|
||||
Imperative Sg => pal_C3_1 stem + "ies" ;
|
||||
Imperative Pl => pal_C3_1 stem + "ieties" ;
|
||||
|
||||
|
||||
Participle g n c => participle_reflexive g n c (stem + "j")
|
||||
}
|
||||
} ;
|
||||
@@ -353,7 +353,7 @@ oper
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
mkVerb_Walk : Verb = {
|
||||
s = table {
|
||||
Pos => table {
|
||||
@@ -367,26 +367,26 @@ oper
|
||||
DebitiveRelative => NON_EXISTENT;
|
||||
x => (mkVerb_C1 "neiet" "neeju" "negāju" ).s ! x -- the incorrect form 'neesu' will be overriden
|
||||
}
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
mkVerb_Sleep : Verb = {
|
||||
s = table {
|
||||
Pos => table {
|
||||
Indicative P2 Sg Pres => (mkVerb_C3 "gulēt").s ! Indicative P2 Sg Pres;
|
||||
Indicative p n Pres => (mkVerb_C3 "guļēt").s ! Indicative p n Pres;
|
||||
Relative Pres => (mkVerb_C3 "guļēt").s ! Relative Pres;
|
||||
Debitive => (mkVerb_C3 "guļēt").s ! Debitive;
|
||||
DebitiveRelative => (mkVerb_C3 "guļēt").s ! DebitiveRelative;
|
||||
x => (mkVerb_C3 "gulēt").s ! x
|
||||
Indicative P2 Sg Pres => (mkVerb_C3 "gulēt").s ! Indicative P2 Sg Pres;
|
||||
Indicative p n Pres => (mkVerb_C3 "guļēt").s ! Indicative p n Pres;
|
||||
Relative Pres => (mkVerb_C3 "guļēt").s ! Relative Pres;
|
||||
Debitive => (mkVerb_C3 "guļēt").s ! Debitive;
|
||||
DebitiveRelative => (mkVerb_C3 "guļēt").s ! DebitiveRelative;
|
||||
x => (mkVerb_C3 "gulēt").s ! x
|
||||
} ;
|
||||
Neg => table {
|
||||
Indicative P2 Sg Pres => (mkVerb_C3 "negulēt").s ! Indicative P2 Sg Pres;
|
||||
Indicative P2 Sg Pres => (mkVerb_C3 "negulēt").s ! Indicative P2 Sg Pres;
|
||||
Indicative p n Pres => (mkVerb_C3 "neguļēt").s ! Indicative p n Pres;
|
||||
Relative Pres => (mkVerb_C3 "neguļēt").s ! Relative Pres;
|
||||
Debitive => NON_EXISTENT;
|
||||
DebitiveRelative => NON_EXISTENT;
|
||||
x => (mkVerb_C3 "negulēt").s ! x
|
||||
Relative Pres => (mkVerb_C3 "neguļēt").s ! Relative Pres;
|
||||
Debitive => NON_EXISTENT;
|
||||
DebitiveRelative => NON_EXISTENT;
|
||||
x => (mkVerb_C3 "negulēt").s ! x
|
||||
}
|
||||
}
|
||||
} ;
|
||||
@@ -399,7 +399,7 @@ oper
|
||||
s + "s" => case stem3 of {
|
||||
_ + "d" => s + "dī" ;
|
||||
_ + "t" => s + "tī" ;
|
||||
_ + "s" => s + "sī" ;
|
||||
_ + "s" => s + "sī" ;
|
||||
_ => stem
|
||||
} ;
|
||||
s + "z" => s + "zī" ; -- lauzt -> lauzīs
|
||||
@@ -490,12 +490,12 @@ oper
|
||||
s + "ī" => s + "ā" ;
|
||||
s + "inā" => s + "inā" ;
|
||||
_ => Predef.tk 1 stem + "a"
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
||||
-- Participle paradigms
|
||||
participle_normal : Gender -> Number -> Case -> Str -> Str = \g,n,c, stem -> participle_normal_l g n c stem stem;
|
||||
participle_normal_l : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c, stem, lemma_stem ->
|
||||
participle_normal_l : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c, stem, lemma_stem ->
|
||||
case g of {
|
||||
Masc => case n of {
|
||||
Sg => case c of {
|
||||
@@ -504,15 +504,15 @@ oper
|
||||
Dat => stem + "ušam" ;
|
||||
Acc => stem + "ušu" ;
|
||||
Loc => stem + "ušā" ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT
|
||||
} ;
|
||||
Pl => case c of {
|
||||
Nom => stem + "uši" ;
|
||||
Gen => stem + "ušu" ;
|
||||
Dat => stem + "ušiem" ;
|
||||
Acc => stem + "ušus" ;
|
||||
Loc => stem + "ušos" ;
|
||||
Voc => NON_EXISTENT
|
||||
Loc => stem + "ušos" ;
|
||||
Voc => NON_EXISTENT
|
||||
}
|
||||
} ;
|
||||
Fem => case n of {
|
||||
@@ -522,7 +522,7 @@ oper
|
||||
Dat => stem + "ušai" ;
|
||||
Acc => stem + "ušu" ;
|
||||
Loc => stem + "ušā" ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT
|
||||
};
|
||||
Pl => case c of {
|
||||
Nom => stem + "ušas" ;
|
||||
@@ -530,13 +530,13 @@ oper
|
||||
Dat => stem + "ušām" ;
|
||||
Acc => stem + "ušas" ;
|
||||
Loc => stem + "ušās" ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
participle_reflexive : Gender -> Number -> Case -> Str -> Str = \g,n,c, stem -> participle_reflexive_l g n c stem stem;
|
||||
participle_reflexive_l : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c, stem, lemma_stem ->
|
||||
participle_reflexive_l : Gender -> Number -> Case -> Str -> Str -> Str = \g,n,c, stem, lemma_stem ->
|
||||
case g of {
|
||||
Masc => case n of {
|
||||
Sg => case c of {
|
||||
@@ -545,7 +545,7 @@ oper
|
||||
Dat => NON_EXISTENT ;
|
||||
Acc => stem + "ušos" ;
|
||||
Loc => NON_EXISTENT ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT
|
||||
} ;
|
||||
Pl => case c of {
|
||||
Nom => stem + "ušies" ;
|
||||
@@ -553,7 +553,7 @@ oper
|
||||
Dat => NON_EXISTENT ;
|
||||
Acc => stem + "ušos" ;
|
||||
Loc => NON_EXISTENT ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT
|
||||
}
|
||||
} ;
|
||||
Fem => case n of {
|
||||
@@ -563,7 +563,7 @@ oper
|
||||
Dat => NON_EXISTENT ;
|
||||
Acc => stem + "ušos" ;
|
||||
Loc => NON_EXISTENT ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT
|
||||
};
|
||||
Pl => case c of {
|
||||
Nom => stem + "ušās" ;
|
||||
@@ -571,9 +571,9 @@ oper
|
||||
Dat => NON_EXISTENT ;
|
||||
Acc => stem + "ušos" ;
|
||||
Loc => NON_EXISTENT ;
|
||||
Voc => NON_EXISTENT
|
||||
Voc => NON_EXISTENT
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,29 +1,38 @@
|
||||
concrete PhraseLav of Phrase = CatLav ** open Prelude, ResLav, VerbLav in {
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete PhraseLav of Phrase = CatLav ** open
|
||||
ResLav,
|
||||
VerbLav
|
||||
in {
|
||||
|
||||
flags
|
||||
coding = utf8;
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = {s = s.s} ;
|
||||
UttQS qs = {s = qs.s } ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg } ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl } ;
|
||||
UttImpPol pol imp = {s = pol.s ++ "lūdzu" ++ imp.s ! pol.p ! Pl } ;
|
||||
|
||||
UttNP np = {s = np.s ! Nom} ;
|
||||
UttCN n = {s = n.s ! Indef ! Sg ! Nom} ;
|
||||
UttAP ap = {s = ap.s ! Indef ! Masc ! Sg ! Nom} ;
|
||||
UttAdv adv = adv ;
|
||||
UttVP vp = {s = build_VP vp Pos Infinitive (AgP3 Pl Masc)} ; --FIXME - neesmu līdz galam drošs vai agreement ir tieši (AgPr Pl)
|
||||
UttIP ip = { s = ip.s ! Nom };
|
||||
UttIAdv iadv = iadv ;
|
||||
UttCard n = { s = n.s ! Masc ! Nom};
|
||||
lin
|
||||
PhrUtt pconj utt voc = { s = pconj.s ++ utt.s ++ voc.s } ;
|
||||
|
||||
UttS s = { s = s.s } ;
|
||||
UttQS qs = { s = qs.s } ;
|
||||
UttImpSg pol imp = { s = pol.s ++ imp.s ! pol.p ! Sg } ;
|
||||
UttImpPl pol imp = { s = pol.s ++ imp.s ! pol.p ! Pl } ;
|
||||
UttImpPol pol imp = { s = pol.s ++ "lūdzu" ++ imp.s ! pol.p ! Pl } ;
|
||||
|
||||
UttNP np = { s = np.s ! Nom } ;
|
||||
UttCN n = { s = n.s ! Indef ! Sg ! Nom } ;
|
||||
UttAP ap = { s = ap.s ! Indef ! Masc ! Sg ! Nom } ;
|
||||
UttAdv adv = adv ;
|
||||
|
||||
-- FIXME: neesmu līdz galam drošs vai agreement ir tieši (AgPr Pl)
|
||||
UttVP vp = { s = build_VP vp Pos Infinitive (AgP3 Pl Masc) } ;
|
||||
|
||||
UttIP ip = { s = ip.s ! Nom } ;
|
||||
UttIAdv iadv = iadv ;
|
||||
UttCard n = { s = n.s ! Masc ! Nom } ;
|
||||
|
||||
NoPConj = { s = [] } ;
|
||||
NoVoc = { s = [] } ;
|
||||
|
||||
VocNP np = { s = "," ++ np.s ! ResLav.Voc } ;
|
||||
PConjConj conj = { s = conj.s2 } ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
NoVoc = {s = []} ;
|
||||
|
||||
VocNP np = {s = "," ++ np.s ! ResLav.Voc} ;
|
||||
PConjConj conj = {s = conj.s2} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,51 +1,55 @@
|
||||
concrete QuestionLav of Question = CatLav ** open ResLav, VerbLav, Prelude, ParadigmsVerbsLav in {
|
||||
flags
|
||||
optimize=all_subs ;
|
||||
coding = utf8;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
lin
|
||||
QuestCl cl = {
|
||||
s = \\m,p => "vai" ++ cl.s ! m ! p
|
||||
} ;
|
||||
|
||||
QuestVP ip vp = {
|
||||
s = \\m,p => ip.s ! Nom ++ buildVerb vp.v m p (AgP3 ip.n Masc)
|
||||
} ;
|
||||
|
||||
QuestSlash ip slash = {
|
||||
s = \\m,p => slash.p.s ++ ip.s ! (slash.p.c ! ip.n) ++ slash.s ! m ! p
|
||||
} ;
|
||||
|
||||
QuestIAdv iadv cl = {
|
||||
s = \\m,p => iadv.s ++ cl.s ! m ! p ;
|
||||
};
|
||||
|
||||
QuestIComp icomp np = {
|
||||
s = \\m,p => icomp.s ++ buildVerb mkVerb_toBe m p np.a ++ np.s ! Nom
|
||||
};
|
||||
concrete QuestionLav of Question = CatLav ** open
|
||||
ResLav,
|
||||
VerbLav,
|
||||
Prelude,
|
||||
ParadigmsVerbsLav
|
||||
in {
|
||||
|
||||
IdetQuant idet num = {
|
||||
s = \\g => idet.s ! g ! num.n ++ num.s ! g ! Nom ;
|
||||
n = num.n
|
||||
} ;
|
||||
flags
|
||||
optimize = all_subs ;
|
||||
coding = utf8 ;
|
||||
|
||||
AdvIP ip adv = {
|
||||
s = \\c => ip.s ! c ++ adv.s ;
|
||||
n = ip.n
|
||||
} ;
|
||||
lin
|
||||
QuestCl cl = { s = \\m,p => "vai" ++ cl.s ! m ! p } ;
|
||||
|
||||
PrepIP p ip = {s = p.s ++ ip.s ! (p.c ! ip.n)} ;
|
||||
QuestVP ip vp = { s = \\m,p => ip.s ! Nom ++ buildVerb vp.v m p (AgP3 ip.n Masc) } ;
|
||||
|
||||
IdetCN idet cn = {
|
||||
s = \\c => idet.s ! cn.g ++ cn.s ! Def ! idet.n ! c ;
|
||||
n = idet.n
|
||||
} ;
|
||||
QuestSlash ip slash = { s = \\m,p => slash.p.s ++ ip.s ! (slash.p.c ! ip.n) ++ slash.s ! m ! p } ;
|
||||
|
||||
IdetIP idet = {
|
||||
s = \\c => (idet.s ! Masc) | (idet.s ! Fem) ;
|
||||
n = idet.n
|
||||
} ;
|
||||
QuestIAdv iadv cl = { s = \\m,p => iadv.s ++ cl.s ! m ! p } ;
|
||||
|
||||
QuestIComp icomp np = { s = \\m,p => icomp.s ++ buildVerb mkVerb_toBe m p np.a ++ np.s ! Nom } ;
|
||||
|
||||
IdetQuant idet num = {
|
||||
s = \\g => idet.s ! g ! num.n ++ num.s ! g ! Nom ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
-- FIXME: quick&dirty - lai kompilētos pret RGL API
|
||||
-- Saskaņā ar Cat.gf, Common.gf un Structural.gf nav iespējams neko saskaņot...
|
||||
-- Identisks copy-paste ir Rus gadījumā, bet priekš Bul Krasimirs ir kaut ko paplašinājis.
|
||||
AdvIAdv i a = ss (i.s ++ a.s) ;
|
||||
|
||||
AdvIP ip adv = {
|
||||
s = \\c => ip.s ! c ++ adv.s ;
|
||||
n = ip.n
|
||||
} ;
|
||||
|
||||
PrepIP p ip = { s = p.s ++ ip.s ! (p.c ! ip.n) } ;
|
||||
|
||||
IdetCN idet cn = {
|
||||
s = \\c => idet.s ! cn.g ++ cn.s ! Def ! idet.n ! c ;
|
||||
n = idet.n
|
||||
} ;
|
||||
|
||||
IdetIP idet = {
|
||||
s = \\c => (idet.s ! Masc) | (idet.s ! Fem) ;
|
||||
n = idet.n
|
||||
} ;
|
||||
|
||||
CompIAdv a = a ;
|
||||
CompIP p = ss (p.s ! Nom) ;
|
||||
|
||||
CompIAdv a = a ;
|
||||
CompIP p = ss (p.s ! Nom) ;
|
||||
}
|
||||
|
||||
@@ -1,55 +1,53 @@
|
||||
concrete RelativeLav of Relative = CatLav ** open ResLav, VerbLav in {
|
||||
flags optimize=all_subs ;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
lin
|
||||
concrete RelativeLav of Relative = CatLav ** open
|
||||
ResLav,
|
||||
VerbLav
|
||||
in {
|
||||
|
||||
RelCl cl = {
|
||||
s = \\m,p,_ => "ka" ++ cl.s ! m ! p
|
||||
} ;
|
||||
|
||||
RelVP rp vp = {
|
||||
s = \\m,p,ag => rp.s ! Nom ++ buildVerb vp.v m p (toAgr (fromAgr ag).n P3 (fromAgr ag).g) ++ vp.s2 ! ag
|
||||
} ;
|
||||
flags
|
||||
optimize = all_subs ;
|
||||
coding = utf8 ;
|
||||
|
||||
RelSlash rp slash = { -- FIXME - vârdu secîba; nevis 'kas mîl viòu' bet 'kas viòu mîl'
|
||||
s = \\m,p,ag =>
|
||||
slash.p.s ++ rp.s ! (slash.p.c ! Sg) ++ slash.s ! m ! p ;
|
||||
} ;
|
||||
{-
|
||||
lin
|
||||
RelCl cl = { s = \\m,p,_ => "ka" ++ cl.s ! m ! p } ;
|
||||
|
||||
-- Pied piping: "at which we are looking". Stranding and empty
|
||||
-- relative are defined in $ExtraEng.gf$ ("that we are looking at",
|
||||
-- "we are looking at").
|
||||
RelVP rp vp = {
|
||||
s = \\m,p,ag =>
|
||||
rp.s ! Masc ! Nom ++ buildVerb vp.v m p (toAgr (fromAgr ag).n P3 (fromAgr ag).g) ++ vp.s2 ! ag
|
||||
} ;
|
||||
|
||||
-- FIXME: vārdu secība - nevis 'kas mīl viņu' bet 'kas viņu mīl' (?)
|
||||
-- FIXME: Masc varētu nebūt labi
|
||||
RelSlash rp slash = {
|
||||
s = \\m,p,ag => slash.p.s ++ rp.s ! Masc ! (slash.p.c ! Sg) ++ slash.s ! m ! p
|
||||
} ;
|
||||
|
||||
FunRP p np rp = {
|
||||
s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
|
||||
a = RAg np.a
|
||||
-- FIXME: placeholder
|
||||
-- TODO: jātestē, kautkas nav labi ar testpiemēru
|
||||
FunRP p np rp = {
|
||||
s = \\g,c => p.s ++ rp.s ! g ! c ++ np.s ! (p.c ! (fromAgr np.a).n)
|
||||
} ;
|
||||
|
||||
IdRP = {
|
||||
s = table {
|
||||
Masc => table {
|
||||
Nom => "kurš" ;
|
||||
Gen => "kura" ;
|
||||
Dat => "kuram" ;
|
||||
Acc => "kuru" ;
|
||||
Loc => "kurā" ;
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
} ;
|
||||
-}
|
||||
--FIXME placeholder
|
||||
FunRP p np rp = { s = \\_ => NON_EXISTENT } ;
|
||||
|
||||
IdRP = {
|
||||
s = table {
|
||||
Nom => "kas";
|
||||
Gen => "kâ";
|
||||
Dat => "kam";
|
||||
Acc => "ko";
|
||||
Loc => "kur";
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
}
|
||||
};
|
||||
{-
|
||||
IdRP =
|
||||
{ s = table {
|
||||
RC _ Gen => "whose" ;
|
||||
RC Neutr _ => "which" ;
|
||||
RC _ Acc => "whom" ;
|
||||
RC _ Nom => "who" ;
|
||||
RPrep Neutr => "which" ;
|
||||
RPrep _ => "whom"
|
||||
} ;
|
||||
a = RNoAg
|
||||
} ; -}
|
||||
Fem => table {
|
||||
Nom => "kura" ;
|
||||
Gen => "kuras" ;
|
||||
Dat => "kurai" ;
|
||||
Acc => "kuru" ;
|
||||
Loc => "kurā" ;
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,541 +1,104 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work. To define everything that is needed to
|
||||
-- implement $Test$, it moreover contains regular lexical
|
||||
-- patterns needed for $Lex$.
|
||||
|
||||
resource ResLav = ParamX ** open Prelude in {
|
||||
flags optimize=all ;
|
||||
|
||||
|
||||
-- Some parameters, such as $Number$, are inherited from $ParamX$.
|
||||
--2 For $Noun$
|
||||
-- This is the worst-case $Case$ needed for pronouns.
|
||||
param
|
||||
|
||||
flags
|
||||
optimize = all ;
|
||||
coding = utf8 ;
|
||||
|
||||
param
|
||||
-- Some parameters, such as $Number$, are inherited from $ParamX$.
|
||||
|
||||
-- Nouns
|
||||
Case = Nom | Gen | Dat | Acc | Loc | Voc;
|
||||
Gender = Masc | Fem ;
|
||||
Restriction = AllForms | SgOnly | PlOnly | SgGenOnly | PlGenOnly ;
|
||||
NounDecl = D0 | D1 | D2 | D3 | D4 | D5 | D6 | DR ;
|
||||
|
||||
Case = Nom | Gen | Dat | Acc | Loc | Voc ;
|
||||
Gender = Masc | Fem ;
|
||||
NounDecl = D0 | D1 | D2 | D3 | D4 | D5 | D6 | DR ;
|
||||
|
||||
-- Adjectives
|
||||
Definite = Indef | Def ;
|
||||
AdjType = AdjQual | AdjRel | AdjIndecl ;
|
||||
AForm = AAdj Degree Definite Gender Number Case | AAdv Degree; --TODO pârveidot uz ðâdu formu lai ir arî apstâkïa vârdi kas atvasinâti no îpaðîbas vârdiem
|
||||
|
||||
Definite = Indef | Def ;
|
||||
AdjType = AdjQual | AdjRel | AdjIndecl ;
|
||||
|
||||
-- TODO: pārveidot uz šādu formu lai ir arī apstākļa vārdi kas atvasināti no īpašības vārdiem
|
||||
AForm = AAdj Degree Definite Gender Number Case | AAdv Degree ;
|
||||
|
||||
-- Verbs
|
||||
-- Ind = Indicative
|
||||
-- Rel = Relative (Latvian specific: http://www.isocat.org/rest/dc/3836)
|
||||
-- Deb = Debitive (Latvian specific: http://www.isocat.org/rest/dc/3835)
|
||||
-- Condit = Conditional
|
||||
-- DebitiveRelative - the relative subtype of debitive
|
||||
VerbForm = Infinitive | Indicative Person Number Tense | Relative Tense | Debitive | Imperative Number |
|
||||
DebitiveRelative | Participle Gender Number Case ;
|
||||
-- TODO - divdabim noteiktâ forma un arî pârâkâ / vispârâkâ pakâpe
|
||||
VerbMood = Ind Anteriority Tense | Rel Anteriority Tense | Deb Anteriority Tense | Condit Anteriority ;
|
||||
VerbConj = C2 | C3 ;
|
||||
|
||||
--Agr = Ag Gender Number ;
|
||||
Agr = AgP1 Number | AgP2 Number | AgP3 Number Gender ;
|
||||
|
||||
ThisOrThat = This | That ;
|
||||
CardOrd = NCard | NOrd ;
|
||||
DForm = unit | teen | ten ;
|
||||
|
||||
oper
|
||||
|
||||
vowel : pattern Str = #("a"|"â"|"e"|"ç"|"i"|"î"|"o"|"u"|"û") ;
|
||||
-- DebitiveRelative = the relative subtype of debitive
|
||||
VerbForm = Infinitive | Indicative Person Number Tense | Relative Tense | Debitive |
|
||||
Imperative Number | DebitiveRelative | Participle Gender Number Case ;
|
||||
-- TODO: divdabim noteiktā forma un arī pārākā / vispārākā pakāpe
|
||||
|
||||
simpleCons : pattern Str = #("c"|"d"|"l"|"n"|"s"|"t"|"z") ;
|
||||
labialCons : pattern Str = #("b"|"m"|"p"|"v") ;
|
||||
sonantCons : pattern Str = #("l"|"m"|"n"|"r"|"ï"|"ò") ;
|
||||
doubleCons : pattern Str = #("ll"|"ln"|"nn"|"sl"|"sn"|"st"|"zl"|"zn") ;
|
||||
|
||||
NON_EXISTENT : Str = "NON_EXISTENT" ;
|
||||
|
||||
Verb : Type = {s : Polarity => VerbForm => Str} ;
|
||||
VP = {v : Verb ; s2 : Agr => Str} ; -- s2 = object(s), complements, adverbial modifiers.
|
||||
VPSlash = VP ** {p : prep} ; -- principâ rekur ir objekts kuram jau kaut kas ir bet ir vçl viena brîva valence..
|
||||
prep = {s : Str; c : Number => Case};
|
||||
--Valence : Type = { p : Prep; c: Number=>Case }; -- e.g. 'ar' + Sg-Acc or Pl-Dat; Preposition may be skipped for simple case-baced valences
|
||||
|
||||
toAgr : Number -> Person -> Gender -> Agr = \n,p,g ->
|
||||
case p of {
|
||||
P1 => AgP1 n ;
|
||||
P2 => AgP2 n ;
|
||||
P3 => AgP3 n g
|
||||
} ;
|
||||
fromAgr : Agr -> {n : Number ; p : Person ; g : Gender} = \a -> case a of {
|
||||
AgP1 n => {n = n ; p = P1 ; g = Masc} ; --fixme 'es esmu skaista' failos...
|
||||
AgP2 n => {n = n ; p = P2 ; g = Masc} ; -- fixme 'tu esi skaista' failos...
|
||||
AgP3 n g => {n = n ; p = P3 ; g = g}
|
||||
} ;
|
||||
VerbMood = Ind Anteriority Tense | Rel Anteriority Tense | Deb Anteriority Tense | Condit Anteriority ;
|
||||
VerbConj = C2 | C3 ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
||||
let a = fromAgr a0 ; b = fromAgr b0
|
||||
in
|
||||
toAgr
|
||||
(conjNumber a.n b.n)
|
||||
(conjPerson a.p b.p) --FIXME - personu apvienoðana ir tricky un ir jâuztaisa korekti
|
||||
(conjGender a.g b.g) ;
|
||||
|
||||
conjGender : Gender -> Gender -> Gender = \a,b ->
|
||||
case a of {
|
||||
Fem => b ;
|
||||
_ => Masc
|
||||
} ;
|
||||
|
||||
agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ;
|
||||
|
||||
{-
|
||||
-- Agreement of $NP$ has 8 values. $Gender$ is needed for "who"/"which" and
|
||||
-- for "himself"/"herself"/"itself".
|
||||
--Agr = Ag Gender Number ;
|
||||
-- TODO: kāpēc P3 jāsaskaņo Gender? divdabju dēļ?
|
||||
Agr = AgP1 Number | AgP2 Number | AgP3 Number Gender ;
|
||||
|
||||
param
|
||||
Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl ;
|
||||
ThisOrThat = This | That ;
|
||||
CardOrd = NCard | NOrd ;
|
||||
DForm = unit | teen | ten ;
|
||||
|
||||
param
|
||||
Gender = Neutr | Masc | Fem ;
|
||||
oper
|
||||
vowel : pattern Str = #("a"|"ā"|"e"|"ē"|"i"|"ī"|"o"|"u"|"ū") ;
|
||||
|
||||
simpleCons : pattern Str = #("c"|"d"|"l"|"n"|"s"|"t"|"z") ;
|
||||
labialCons : pattern Str = #("b"|"m"|"p"|"v") ;
|
||||
sonantCons : pattern Str = #("l"|"m"|"n"|"r"|"ļ"|"ņ") ;
|
||||
doubleCons : pattern Str = #("ll"|"ln"|"nn"|"sl"|"sn"|"st"|"zl"|"zn") ;
|
||||
|
||||
--2 For $Verb$
|
||||
NON_EXISTENT : Str = "NON_EXISTENT" ;
|
||||
|
||||
-- Only these five forms are needed for open-lexicon verbs.
|
||||
Verb : Type = { s : Polarity => VerbForm => Str } ;
|
||||
|
||||
param
|
||||
VForm =
|
||||
VInf
|
||||
| VPres
|
||||
| VPPart
|
||||
| VPresPart
|
||||
| VPast --# notpresent
|
||||
;
|
||||
VP = { v : Verb ; s2 : Agr => Str } ; -- s2 = object(s), complements, adverbial modifiers
|
||||
|
||||
-- Auxiliary verbs have special negative forms.
|
||||
VPSlash = VP ** { p : prep } ;
|
||||
-- principā rekur ir objekts kuram jau kaut kas ir bet ir vēl viena brīva valence...
|
||||
|
||||
VVForm =
|
||||
VVF VForm
|
||||
| VVPresNeg
|
||||
| VVPastNeg --# notpresent
|
||||
;
|
||||
prep = { s : Str ; c : Number => Case } ;
|
||||
|
||||
-- The order of sentence is needed already in $VP$.
|
||||
--Valence : Type = { p : Prep ; c : Number => Case } ;
|
||||
-- e.g. 'ar' + Sg-Acc or Pl-Dat; Preposition may be skipped for simple case-baced valences
|
||||
|
||||
Order = ODir | OQuest ;
|
||||
|
||||
|
||||
--2 For $Adjective$
|
||||
|
||||
AForm = AAdj Degree Case | AAdv ;
|
||||
|
||||
--2 For $Relative$
|
||||
|
||||
RAgr = RNoAg | RAg Agr ;
|
||||
RCase = RPrep Gender | RC Gender Case ;
|
||||
|
||||
--2 For $Numeral$
|
||||
|
||||
CardOrd = NCard | NOrd ;
|
||||
DForm = unit | teen | ten ;
|
||||
|
||||
--2 Transformations between parameter types
|
||||
|
||||
oper
|
||||
toAgr : Number -> Person -> Gender -> Agr = \n,p,g ->
|
||||
case p of {
|
||||
P1 => AgP1 n ;
|
||||
P2 => AgP2 n ;
|
||||
P3 => case n of {
|
||||
Sg => AgP3Sg g ;
|
||||
Pl => AgP3Pl
|
||||
}
|
||||
} ;
|
||||
|
||||
fromAgr : Agr -> {n : Number ; p : Person ; g : Gender} = \a -> case a of {
|
||||
AgP1 n => {n = n ; p = P1 ; g = Masc} ;
|
||||
AgP2 n => {n = n ; p = P2 ; g = Masc} ;
|
||||
AgP3Pl => {n = Pl ; p = P3 ; g = Masc} ;
|
||||
AgP3Sg g => {n = Sg ; p = P3 ; g = g}
|
||||
} ;
|
||||
|
||||
agrP3 : Number -> Agr = \n -> agrgP3 n Neutr ;
|
||||
|
||||
agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
||||
let a = fromAgr a0 ; b = fromAgr b0
|
||||
in
|
||||
toAgr
|
||||
(conjNumber a.n b.n)
|
||||
(conjPerson a.p b.p) a.g ;
|
||||
|
||||
-- For $Lex$.
|
||||
|
||||
-- For each lexical category, here are the worst-case constructors.
|
||||
|
||||
mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} =
|
||||
\man,mans,men,mens -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Gen => mans ;
|
||||
_ => man
|
||||
} ;
|
||||
Pl => table {
|
||||
Gen => mens ;
|
||||
_ => men
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str; lock_A : {}} =
|
||||
\good,better,best,well -> lin A {
|
||||
s = table {
|
||||
AAdj Posit c => (regGenitiveS good) ! c ;
|
||||
AAdj Compar c => (regGenitiveS better) ! c ;
|
||||
AAdj Superl c => (regGenitiveS best) ! c ;
|
||||
AAdv => well
|
||||
}
|
||||
} ;
|
||||
|
||||
mkVerb : (_,_,_,_,_ : Str) -> Verb =
|
||||
\go,goes,went,gone,going -> {
|
||||
s = table {
|
||||
VInf => go ;
|
||||
VPres => goes ;
|
||||
VPast => went ; --# notpresent
|
||||
VPPart => gone ;
|
||||
VPresPart => going
|
||||
} ;
|
||||
isRefl = False
|
||||
} ;
|
||||
|
||||
mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
||||
\i,me,my,n -> let who = mkNP i me my n P3 Neutr in {
|
||||
s = who.s ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
|
||||
{s : Case => Str ; a : Agr} = \i,me,my,n,p,g ->
|
||||
{ s = table {
|
||||
Nom => i ;
|
||||
Acc => me ;
|
||||
Gen => my
|
||||
} ;
|
||||
a = toAgr n p g ;
|
||||
};
|
||||
|
||||
regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n ->
|
||||
mkNP that that (that + "'s") n P3 Neutr ;
|
||||
|
||||
regGenitiveS : Str -> Case => Str = \s ->
|
||||
table { Gen => genitiveS s; _ => s } ;
|
||||
|
||||
genitiveS : Str -> Str = \dog ->
|
||||
case last dog of {
|
||||
"s" => dog + "'" ;
|
||||
_ => dog + "'s"
|
||||
};
|
||||
|
||||
-- We have just a heuristic definition of the indefinite article.
|
||||
-- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic
|
||||
-- "o" ("one-sided"), vocalic "u" ("umbrella").
|
||||
|
||||
artIndef = pre {
|
||||
"eu" | "Eu" | "uni" | "up" => "a" ;
|
||||
"un" => "an" ;
|
||||
"a" | "e" | "i" | "o" | "A" | "E" | "I" | "O" => "an" ;
|
||||
_ => "a"
|
||||
} ;
|
||||
|
||||
artDef = "the" ;
|
||||
|
||||
-- For $Verb$.
|
||||
|
||||
Verb : Type = {
|
||||
s : VForm => Str ;
|
||||
isRefl : Bool
|
||||
toAgr : Number -> Person -> Gender -> Agr = \n,p,g ->
|
||||
case p of {
|
||||
P1 => AgP1 n ;
|
||||
P2 => AgP2 n ;
|
||||
P3 => AgP3 n g
|
||||
} ;
|
||||
|
||||
param
|
||||
CPolarity =
|
||||
CPos
|
||||
| CNeg Bool ; -- contracted or not
|
||||
|
||||
oper
|
||||
contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of {
|
||||
Pos => CPos ;
|
||||
Neg => CNeg b
|
||||
fromAgr : Agr -> { n : Number ; p : Person ; g : Gender } = \a ->
|
||||
case a of {
|
||||
AgP1 n => { n = n ; p = P1 ; g = Masc } ; -- FIXME: 'es esmu skaista'
|
||||
AgP2 n => { n = n ; p = P2 ; g = Masc } ; -- FIXME: 'tu esi skaista'
|
||||
AgP3 n g => { n = n ; p = P3 ; g = g }
|
||||
} ;
|
||||
|
||||
VerbForms : Type =
|
||||
Tense => Anteriority => CPolarity => Order => Agr =>
|
||||
{aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept
|
||||
|
||||
VP : Type = {
|
||||
s : VerbForms ;
|
||||
prp : Str ; -- present participle
|
||||
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
||||
ad : Str ; -- sentence adverb
|
||||
s2 : Agr => Str -- complement
|
||||
} ;
|
||||
|
||||
|
||||
SlashVP = VP ** {c2 : Str} ;
|
||||
|
||||
predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb ->
|
||||
predV verb ** {c2 = verb.c2} ;
|
||||
|
||||
predV : Verb -> VP = \verb -> {
|
||||
s = \\t,ant,b,ord,agr =>
|
||||
let
|
||||
inf = verb.s ! VInf ;
|
||||
fin = presVerb verb agr ;
|
||||
part = verb.s ! VPPart ;
|
||||
in
|
||||
case <t,ant,b,ord> of {
|
||||
<Pres,Simul,CPos,ODir> => vff fin [] ;
|
||||
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
|
||||
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
||||
<Past,Simul,CPos,ODir> => vff (verb.s ! VPast) [] ; --# notpresent
|
||||
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
|
||||
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
|
||||
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
||||
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
|
||||
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
|
||||
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
|
||||
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
||||
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
|
||||
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
|
||||
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
|
||||
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||
<Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf
|
||||
} ;
|
||||
prp = verb.s ! VPresPart ;
|
||||
inf = verb.s ! VInf ;
|
||||
ad = [] ;
|
||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
||||
} ;
|
||||
|
||||
predAux : Aux -> VP = \verb -> {
|
||||
s = \\t,ant,cb,ord,agr =>
|
||||
let
|
||||
b = case cb of {
|
||||
CPos => Pos ;
|
||||
_ => Neg
|
||||
} ;
|
||||
inf = verb.inf ;
|
||||
fin = verb.pres ! b ! agr ;
|
||||
finp = verb.pres ! Pos ! agr ;
|
||||
part = verb.ppart ;
|
||||
in
|
||||
case <t,ant,cb,ord> of {
|
||||
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
||||
<Past,Simul,CPos, _> => vf (verb.past ! b ! agr) [] ; --# notpresent
|
||||
<Past,Simul,CNeg c, _> => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent
|
||||
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
||||
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
|
||||
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
|
||||
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
|
||||
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
||||
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
|
||||
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
|
||||
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
|
||||
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||
<Pres,Simul,CPos, _> => vf fin [] ;
|
||||
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
||||
} ;
|
||||
prp = verb.prpart ;
|
||||
inf = verb.inf ;
|
||||
ad = [] ;
|
||||
s2 = \\_ => []
|
||||
} ;
|
||||
|
||||
vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y ->
|
||||
{aux = [] ; adv = [] ; fin = x ; inf = y} ;
|
||||
|
||||
vf : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> vfn True x x y ;
|
||||
|
||||
vfn : Bool -> Str -> Str -> Str -> {aux, fin, adv, inf : Str} =
|
||||
\contr,x,y,z ->
|
||||
case contr of {
|
||||
True => {aux = y ; adv = [] ; fin = [] ; inf = z} ;
|
||||
False => {aux = x ; adv = "not" ; fin = [] ; inf = z}
|
||||
} ;
|
||||
|
||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
prp = vp.prp ;
|
||||
inf = vp.inf ;
|
||||
ad = vp.ad ;
|
||||
s2 = \\a => vp.s2 ! a ++ obj ! a
|
||||
} ;
|
||||
|
||||
insertObjPre : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
prp = vp.prp ;
|
||||
inf = vp.inf ;
|
||||
ad = vp.ad ;
|
||||
s2 = \\a => obj ! a ++ vp.s2 ! a
|
||||
} ;
|
||||
|
||||
insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp ->
|
||||
insertObj obj vp ** {c2 = vp.c2} ;
|
||||
|
||||
--- The adverb should be before the finite verb.
|
||||
|
||||
insertAdV : Str -> VP -> VP = \ad,vp -> {
|
||||
s = vp.s ;
|
||||
prp = vp.prp ;
|
||||
inf = vp.inf ;
|
||||
ad = vp.ad ++ ad ;
|
||||
s2 = \\a => vp.s2 ! a
|
||||
} ;
|
||||
|
||||
--
|
||||
|
||||
predVV : {s : VVForm => Str ; isAux : Bool} -> VP = \verb ->
|
||||
let verbs = verb.s
|
||||
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
||||
let
|
||||
a = fromAgr a0 ;
|
||||
b = fromAgr b0
|
||||
in
|
||||
case verb.isAux of {
|
||||
True => predAux {
|
||||
pres = table {
|
||||
Pos => \\_ => verbs ! VVF VPres ;
|
||||
Neg => \\_ => verbs ! VVPresNeg
|
||||
} ;
|
||||
past = table { --# notpresent
|
||||
Pos => \\_ => verbs ! VVF VPast ; --# notpresent
|
||||
Neg => \\_ => verbs ! VVPastNeg --# notpresent
|
||||
} ; --# notpresent
|
||||
inf = verbs ! VVF VInf ;
|
||||
ppart = verbs ! VVF VPPart ;
|
||||
prpart = verbs ! VVF VPresPart ;
|
||||
} ;
|
||||
_ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False}
|
||||
} ;
|
||||
toAgr
|
||||
(conjNumber a.n b.n)
|
||||
(conjPerson a.p b.p) -- FIXME: personu apvienošana ir tricky un ir jāuztaisa korekti
|
||||
(conjGender a.g b.g) ;
|
||||
|
||||
presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
||||
agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
||||
|
||||
infVP : Bool -> VP -> Agr -> Str = \isAux,vp,a ->
|
||||
vp.ad ++
|
||||
case isAux of {True => [] ; False => "to"} ++
|
||||
vp.inf ++ vp.s2 ! a ;
|
||||
|
||||
agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
|
||||
case agr of {
|
||||
AgP3Sg _ => has ;
|
||||
_ => have
|
||||
} ;
|
||||
|
||||
have = agrVerb "has" "have" ;
|
||||
havent = agrVerb "hasn't" "haven't" ;
|
||||
does = agrVerb "does" "do" ;
|
||||
doesnt = agrVerb "doesn't" "don't" ;
|
||||
|
||||
Aux = {
|
||||
pres : Polarity => Agr => Str ;
|
||||
past : Polarity => Agr => Str ; --# notpresent
|
||||
inf,ppart,prpart : Str
|
||||
conjGender : Gender -> Gender -> Gender = \a,b ->
|
||||
case a of {
|
||||
Fem => b ;
|
||||
_ => Masc
|
||||
} ;
|
||||
|
||||
auxBe : Aux = {
|
||||
pres = \\b,a => case <b,a> of {
|
||||
<Pos,AgP1 Sg> => "am" ;
|
||||
<Neg,AgP1 Sg> => ["am not"] ; --- am not I
|
||||
_ => agrVerb (posneg b "is") (posneg b "are") a
|
||||
} ;
|
||||
past = \\b,a => case a of { --# notpresent
|
||||
AgP1 Sg | AgP3Sg _ => posneg b "was" ; --# notpresent
|
||||
_ => (posneg b "were") --# notpresent
|
||||
} ; --# notpresent
|
||||
inf = "be" ;
|
||||
ppart = "been" ;
|
||||
prpart = "being"
|
||||
} ;
|
||||
agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ;
|
||||
|
||||
posneg : Polarity -> Str -> Str = \p,s -> case p of {
|
||||
Pos => s ;
|
||||
Neg => s + "n't"
|
||||
} ;
|
||||
|
||||
conjThat : Str = "that" ;
|
||||
|
||||
reflPron : Agr => Str = table {
|
||||
AgP1 Sg => "myself" ;
|
||||
AgP2 Sg => "yourself" ;
|
||||
AgP3Sg Masc => "himself" ;
|
||||
AgP3Sg Fem => "herself" ;
|
||||
AgP3Sg Neutr => "itself" ;
|
||||
AgP1 Pl => "ourselves" ;
|
||||
AgP2 Pl => "yourselves" ;
|
||||
AgP3Pl => "themselves"
|
||||
} ;
|
||||
|
||||
-- For $Sentence$.
|
||||
|
||||
Clause : Type = {
|
||||
s : Tense => Anteriority => CPolarity => Order => Str
|
||||
} ;
|
||||
|
||||
mkClause : Str -> Agr -> VP -> Clause =
|
||||
\subj,agr,vp -> {
|
||||
s = \\t,a,b,o =>
|
||||
let
|
||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||
compl = vp.s2 ! agr
|
||||
in
|
||||
case o of {
|
||||
ODir => subj ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl ;
|
||||
OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
-- For $Numeral$.
|
||||
|
||||
mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Case => Str} =
|
||||
\two, twelve, twenty, second ->
|
||||
{s = table {
|
||||
unit => table {NCard => regGenitiveS two ; NOrd => regGenitiveS second} ;
|
||||
teen => \\c => mkCard c twelve ;
|
||||
ten => \\c => mkCard c twenty
|
||||
}
|
||||
} ;
|
||||
|
||||
regNum : Str -> {s : DForm => CardOrd => Case => Str} =
|
||||
\six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ;
|
||||
|
||||
regCardOrd : Str -> {s : CardOrd => Case => Str} = \ten ->
|
||||
{s = table {NCard => regGenitiveS ten ;
|
||||
NOrd => regGenitiveS (regOrd ten)} } ;
|
||||
|
||||
mkCard : CardOrd -> Str -> Case => Str = \o,ten ->
|
||||
(regCardOrd ten).s ! o ;
|
||||
|
||||
regOrd : Str -> Str = \ten ->
|
||||
case last ten of {
|
||||
"y" => init ten + "ieth" ;
|
||||
_ => ten + "th"
|
||||
} ;
|
||||
|
||||
mkQuestion :
|
||||
{s : Str} -> Clause ->
|
||||
{s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl ->
|
||||
{
|
||||
s = \\t,a,p =>
|
||||
let
|
||||
cls = cl.s ! t ! a ! p ;
|
||||
why = wh.s
|
||||
in table {
|
||||
QDir => why ++ cls ! OQuest ;
|
||||
QIndir => why ++ cls ! ODir
|
||||
}
|
||||
} ;
|
||||
|
||||
-}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,73 @@
|
||||
concrete SentenceLav of Sentence = CatLav ** open Prelude, ResLav, VerbLav in {
|
||||
flags optimize=all_subs ;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete SentenceLav of Sentence = CatLav ** open
|
||||
Prelude,
|
||||
ResLav,
|
||||
VerbLav
|
||||
in {
|
||||
|
||||
flags
|
||||
optimize = all_subs ;
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
PredVP np vp = mkClause np vp;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\pol, n => vp.v.s ! pol ! (Imperative n) ++ vp.s2 ! (AgP2 n)
|
||||
} ;
|
||||
|
||||
SlashVP np vp =
|
||||
mkClause np vp ** {p = vp.p} ;
|
||||
PredVP np vp = mkClause np vp ;
|
||||
|
||||
PredSCVP sc vp = mkClauseSC sc vp ;
|
||||
|
||||
ImpVP vp = { s = \\pol, n => vp.v.s ! pol ! (Imperative n) ++ vp.s2 ! (AgP2 n) } ;
|
||||
|
||||
SlashVP np vp = mkClause np vp ** { p = vp.p } ;
|
||||
|
||||
AdvSlash slash adv = {
|
||||
s = \\m,p => slash.s ! m ! p ++ adv.s ;
|
||||
p = slash.p
|
||||
s = \\m,p => slash.s ! m ! p ++ adv.s ;
|
||||
p = slash.p
|
||||
} ;
|
||||
SlashPrep cl prep = cl ** {p = prep};
|
||||
SlashVS np vs slash = mkClause np (lin VP {v = vs; s2 = \\_ => "," ++ vs.subj.s ++ slash.s}) ** {p = slash.p};
|
||||
|
||||
ComplVS v s = {v = v; s2 = \\_ => "," ++ v.subj.s ++ s.s};
|
||||
|
||||
EmbedS s = {s = "ka" ++ s.s} ; --TODO - noèekot kâpçc te ir tieði 'ka'
|
||||
EmbedQS qs = {s = qs.s } ;
|
||||
EmbedVP vp = {s = build_VP vp Pos Infinitive (AgP3 Pl Masc)} ; --FIXME - neesmu lîdz galam droðs vai agreement ir tieði (AgPr Pl)
|
||||
|
||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p} ;
|
||||
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p} ;
|
||||
UseRCl t p cl =
|
||||
SlashPrep cl prep = cl ** { p = prep } ;
|
||||
|
||||
SlashVS np vs slash =
|
||||
mkClause np (lin VP { v = vs ; s2 = \\_ => "," ++ vs.subj.s ++ slash.s }) ** { p = slash.p } ;
|
||||
|
||||
ComplVS v s = { v = v ; s2 = \\_ => "," ++ v.subj.s ++ s.s } ;
|
||||
|
||||
-- TODO: nočekot kāpēc te ir tieši 'ka'
|
||||
EmbedS s = { s = "ka" ++ s.s } ;
|
||||
|
||||
EmbedQS qs = { s = qs.s } ;
|
||||
|
||||
-- FIXME: neesmu līdz galam drošs vai agreement ir tieši (AgPr Pl)
|
||||
EmbedVP vp = { s = build_VP vp Pos Infinitive (AgP3 Pl Masc) } ;
|
||||
|
||||
UseCl t p cl = { s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p } ;
|
||||
UseQCl t p cl = { s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p } ;
|
||||
|
||||
UseRCl t p cl =
|
||||
{ s = \\ag => t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p ! ag } |
|
||||
{ s = \\ag => t.s ++ p.s ++ cl.s ! (Rel t.a t.t) ! p.p ! ag };
|
||||
UseSlash t p slash = {s = t.s ++ p.s ++ slash.s ! (Ind t.a t.t) ! p.p; p = slash.p};
|
||||
|
||||
--FIXME placeholder
|
||||
{ s = \\ag => t.s ++ p.s ++ cl.s ! (Rel t.a t.t) ! p.p ! ag } ;
|
||||
|
||||
UseSlash t p slash = { s = t.s ++ p.s ++ slash.s ! (Ind t.a t.t) ! p.p ; p = slash.p } ;
|
||||
|
||||
-- FIXME: placeholder
|
||||
AdvS a s = { s = NON_EXISTENT } ;
|
||||
|
||||
|
||||
oper
|
||||
mkClause : NP -> VP -> Cl = \np,vp -> lin Cl {
|
||||
s = \\mood,pol =>
|
||||
case mood of { -- Subject
|
||||
Deb _ _ => np.s ! Dat ; -- FIXME jâèeko valences, reizçm arî îstenîbas izteiksmç - 'man patîk kaut kas'
|
||||
_ => np.s ! Nom
|
||||
} ++
|
||||
buildVerb vp.v mood pol np.a ++ -- Verb
|
||||
vp.s2 ! np.a -- Object(s), complements, adverbial modifiers;
|
||||
} ;
|
||||
|
||||
{-
|
||||
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
|
||||
mkClause : NP -> VP -> Cl = \np,vp -> lin Cl {
|
||||
s = \\mood,pol =>
|
||||
case mood of { -- Subject
|
||||
-- FIXME: jāčeko valences, reizēm arī īstenības izteiksmē - 'man patīk kaut kas'
|
||||
Deb _ _ => np.s ! Dat ;
|
||||
_ => np.s ! Nom
|
||||
} ++
|
||||
buildVerb vp.v mood pol np.a ++ -- Verb
|
||||
vp.s2 ! np.a -- Object(s), complements, adverbial modifiers
|
||||
} ;
|
||||
|
||||
-- FIXME: quick&dirty - lai kompilētos pret RGL API
|
||||
-- Eng: PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp
|
||||
-- Ar SC nav iespējams neko saskaņot (sk. Cat.gf un Common.gf)
|
||||
mkClauseSC : SC -> VP -> Cl = \sc,vp -> lin Cl {
|
||||
s = \\mood,pol => sc.s ++ buildVerb vp.v mood pol (AgP3 Sg Masc) ++ vp.s2 ! (AgP3 Sg Masc)
|
||||
} ;
|
||||
|
||||
AdvS a s = {s = a.s ++ "," ++ s.s} ;
|
||||
|
||||
SSubjS a s b = {s = a.s ++ s.s ++ b.s} ;
|
||||
|
||||
RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ;
|
||||
|
||||
oper
|
||||
ctr = contrNeg True ; -- contracted negations
|
||||
-}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
concrete StructuralLav of Structural = CatLav **
|
||||
open MorphoLav, ResLav, ParadigmsLav, ParadigmsPronounsLav, MakeStructuralLav, Prelude in {
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete StructuralLav of Structural = CatLav ** open
|
||||
Prelude,
|
||||
ResLav,
|
||||
ParadigmsLav,
|
||||
ParadigmsPronounsLav,
|
||||
NounLav
|
||||
in {
|
||||
|
||||
flags
|
||||
optimize = all ;
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
|
||||
coding = utf8 ;
|
||||
|
||||
lin
|
||||
language_title_Utt = ss "Latviešu valoda" ;
|
||||
|
||||
-- TODO: kā ar loģikā lietotajiem 'visi', 'katrs' ?
|
||||
every_Det = {
|
||||
s = (\\g,c => (mkPronoun_Gend "ikviens").s ! g ! Sg ! c) ; -- TODO - kā ar loģikā lietotajiem 'visi', 'katrs' ?
|
||||
s = (\\g,c => (mkPronoun_Gend "ikviens").s ! g ! Sg ! c) ;
|
||||
n = Sg ;
|
||||
d = Indef
|
||||
} ;
|
||||
@@ -18,23 +27,42 @@ lin
|
||||
n = Sg ;
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
somePl_Det = {
|
||||
s = (\\g,c => (mkPronoun_Gend "kāds").s ! g ! Pl ! c) ; -- lai atļautu arī tukšo, jāliek (\\_,_ => []) | klāt
|
||||
n = Pl ;
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
|
||||
few_Det = {
|
||||
s = (\\g,c => (mkPronoun_Gend "dažs").s ! g ! Pl ! c) ;
|
||||
n = Pl ;
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
many_Det = {
|
||||
s = (\\g,c => (mkPronoun_Gend "daudzs").s ! g ! Pl ! c) ; -- 'daudzs' izlocīsies korekti uz daudzskaitļa 'daudzi'
|
||||
n = Pl ;
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
much_Det = {
|
||||
s = (\\g,c => "daudz") ; -- FIXME - ņem saistību ar ģenitīvu; kā to realizēt?
|
||||
n = Sg ;
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
this_Quant = {
|
||||
s = (mkPronoun_ThisThat This).s ;
|
||||
d = Def
|
||||
} ;
|
||||
|
||||
|
||||
that_Quant = {
|
||||
s = (mkPronoun_ThisThat That).s ;
|
||||
d = Def
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
i_Pron = {
|
||||
s = table {
|
||||
Nom => "es";
|
||||
@@ -42,7 +70,7 @@ lin
|
||||
Dat => "man";
|
||||
Acc => "mani";
|
||||
Loc => "manī";
|
||||
Voc => NON_EXISTENT
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
} ;
|
||||
possessive = table {
|
||||
Masc => table {
|
||||
@@ -52,7 +80,7 @@ lin
|
||||
Dat => "manam";
|
||||
Acc => "manu";
|
||||
Loc => "manā";
|
||||
Voc => "mans"
|
||||
ResLav.Voc => "mans"
|
||||
};
|
||||
Pl => table {
|
||||
Nom => "mani";
|
||||
@@ -60,7 +88,7 @@ lin
|
||||
Dat => "maniem";
|
||||
Acc => "manus";
|
||||
Loc => "manos";
|
||||
Voc => "mani"
|
||||
ResLav.Voc => "mani"
|
||||
}
|
||||
} ;
|
||||
Fem => table {
|
||||
@@ -70,7 +98,7 @@ lin
|
||||
Dat => "manai";
|
||||
Acc => "manu";
|
||||
Loc => "manā";
|
||||
Voc => "mana"
|
||||
ResLav.Voc => "mana"
|
||||
};
|
||||
Pl => table {
|
||||
Nom => "manas";
|
||||
@@ -78,7 +106,7 @@ lin
|
||||
Dat => "manām";
|
||||
Acc => "manas";
|
||||
Loc => "manās";
|
||||
Voc => "manas"
|
||||
ResLav.Voc => "manas"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
@@ -92,15 +120,15 @@ lin
|
||||
Dat => "mums";
|
||||
Acc => "mūs";
|
||||
Loc => "mūsos";
|
||||
Voc => NON_EXISTENT
|
||||
} ;
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
} ;
|
||||
possessive = table {
|
||||
_ => table {
|
||||
_ => table {
|
||||
_ => "mūsu"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP1 Pl ;
|
||||
} ;
|
||||
|
||||
@@ -111,7 +139,7 @@ lin
|
||||
Dat => "tev";
|
||||
Acc => "tevi";
|
||||
Loc => "tevī";
|
||||
Voc => "tu"
|
||||
ResLav.Voc => "tu"
|
||||
} ;
|
||||
possessive = table {
|
||||
Masc => table {
|
||||
@@ -121,7 +149,7 @@ lin
|
||||
Dat => "tavam";
|
||||
Acc => "tavu";
|
||||
Loc => "tavā" ;
|
||||
Voc => "tavs"
|
||||
ResLav.Voc => "tavs"
|
||||
};
|
||||
Pl => table {
|
||||
Nom => "tavi";
|
||||
@@ -129,7 +157,7 @@ lin
|
||||
Dat => "taviem";
|
||||
Acc => "tavus";
|
||||
Loc => "tavos";
|
||||
Voc => "tavi"
|
||||
ResLav.Voc => "tavi"
|
||||
}
|
||||
} ;
|
||||
Fem => table {
|
||||
@@ -139,7 +167,7 @@ lin
|
||||
Dat => "tavai";
|
||||
Acc => "tavu";
|
||||
Loc => "tavā";
|
||||
Voc => "tava"
|
||||
ResLav.Voc => "tava"
|
||||
};
|
||||
Pl => table {
|
||||
Nom => "tavas";
|
||||
@@ -147,10 +175,10 @@ lin
|
||||
Dat => "tavām";
|
||||
Acc => "tavas";
|
||||
Loc => "tavās";
|
||||
Voc => "tavas"
|
||||
ResLav.Voc => "tavas"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP2 Sg ;
|
||||
} ;
|
||||
|
||||
@@ -161,7 +189,7 @@ lin
|
||||
Dat => "jums";
|
||||
Acc => "jūs";
|
||||
Loc => "jūsos";
|
||||
Voc => "jūs"
|
||||
ResLav.Voc => "jūs"
|
||||
} ;
|
||||
possessive = table {
|
||||
_ => table {
|
||||
@@ -169,10 +197,10 @@ lin
|
||||
_ => "jūsu"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP2 Pl ;
|
||||
} ;
|
||||
|
||||
|
||||
youPol_Pron = {
|
||||
s = table {
|
||||
Nom => "jūs";
|
||||
@@ -180,7 +208,7 @@ lin
|
||||
Dat => "jums";
|
||||
Acc => "jūs";
|
||||
Loc => "jūsos";
|
||||
Voc => "jūs"
|
||||
ResLav.Voc => "jūs"
|
||||
} ;
|
||||
possessive = table {
|
||||
_ => table {
|
||||
@@ -188,10 +216,10 @@ lin
|
||||
_ => "jūsu"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP2 Pl ;
|
||||
} ;
|
||||
|
||||
|
||||
he_Pron = {
|
||||
s = (\\c => (mkPronoun_Gend "viņš").s ! Masc ! Sg ! c) ;
|
||||
possessive = table {
|
||||
@@ -200,7 +228,7 @@ lin
|
||||
_ => "viņa"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP3 Sg Masc ;
|
||||
} ;
|
||||
|
||||
@@ -212,10 +240,10 @@ lin
|
||||
_ => "viņas"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP3 Sg Fem ;
|
||||
} ;
|
||||
|
||||
|
||||
they_Pron = {
|
||||
s = (\\c => (mkPronoun_Gend "viņš").s ! Masc ! Pl ! c) ;
|
||||
possessive = table {
|
||||
@@ -224,9 +252,9 @@ lin
|
||||
_ => "viņu"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP3 Pl Masc ;
|
||||
} |
|
||||
} |
|
||||
{
|
||||
s = (\\c => (mkPronoun_Gend "viņš").s ! Fem ! Pl ! c) ;
|
||||
possessive = table {
|
||||
@@ -235,10 +263,10 @@ lin
|
||||
_ => "viņu"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
a = AgP3 Pl Fem ;
|
||||
} ;
|
||||
|
||||
|
||||
it_Pron = {
|
||||
s = \\c => (mkPronoun_ThisThat That).s ! Masc ! Sg ! c;
|
||||
possessive = table { _ => table { _ => table { _ => "tā" }}};
|
||||
@@ -247,15 +275,15 @@ lin
|
||||
s = \\c => (mkPronoun_ThisThat That).s ! Fem ! Sg ! c;
|
||||
possessive = table { _ => table { _ => table { _ => "tās" }}};
|
||||
a = AgP3 Sg Fem
|
||||
};
|
||||
|
||||
-- manuprāt prievārdi tomēr ir valodas-specifiski un nebūtu tieši 1-pret-1 jātulko
|
||||
};
|
||||
|
||||
-- manuprāt prievārdi tomēr ir valodas-specifiski un nebūtu tieši 1-pret-1 jātulko
|
||||
above_Prep = mkPrep "virs" Gen Dat;
|
||||
after_Prep = mkPrep "pēc" Gen Dat;
|
||||
before_Prep = mkPrep "pirms" Gen Dat;
|
||||
behind_Prep = mkPrep "aiz" Gen Dat;
|
||||
between_Prep = mkPrep "starp" Acc Dat;
|
||||
for_Prep = mkPrep "priekš" Gen Dat;
|
||||
for_Prep = mkPrep "priekš" Gen Dat;
|
||||
from_Prep = mkPrep "no" Gen Dat;
|
||||
on_Prep = mkPrep "uz" Gen Dat;
|
||||
with_Prep = mkPrep "ar" Acc Dat; -- ar sievu, ar sievām
|
||||
@@ -265,7 +293,14 @@ lin
|
||||
under_Prep = mkPrep "zem" Gen Dat;
|
||||
with_Prep = mkPrep "ar" Acc Dat;
|
||||
without_Prep = mkPrep "bez" Gen Dat;
|
||||
|
||||
by8agent_Prep = nom_Prep; --- A was attacked by B -> A-Dat uzbruka B-Nom
|
||||
by8means_Prep = mkPrep "ar" Acc Dat;
|
||||
during_Prep = mkPrep "laikā" Gen Gen; --FIXME nevaru saprast. laikam postfix 'X laikā' jāliek
|
||||
in8front_Prep = mkPrep "priekšā" Dat Dat;
|
||||
part_Prep = mkPrep Gen ; --FIXME - reku vajadzētu vārdu secību otrādi, ka pirms paskaidrojamā vārda likt
|
||||
through_Prep = mkPrep "cauri" Dat Dat;
|
||||
except_Prep = mkPrep "izņemot" Acc Acc;
|
||||
|
||||
very_AdA = mkAdA "ļoti" ;
|
||||
almost_AdA = mkAdA "gandrīz" ;
|
||||
so_AdA = mkAdA "tik" ;
|
||||
@@ -273,17 +308,25 @@ lin
|
||||
|
||||
and_Conj = mkConj "un" ;
|
||||
or_Conj = mkConj "vai" Sg ;
|
||||
if_then_Conj = mkConj "ja" "tad";
|
||||
|
||||
but_PConj = ss "bet" ;
|
||||
otherwise_PConj = ss "tomēr" ; --?
|
||||
therefore_PConj = ss "tātad" ; --?
|
||||
|
||||
more_CAdv = (mkCAdv [] "nekā" Compar) | (mkCAdv "vairāk" "nekā" Posit);
|
||||
less_CAdv = mkCAdv "mazāk" "nekā" Posit;
|
||||
|
||||
more_CAdv = (mkCAdv [] "nekā" Compar) | (mkCAdv "vairāk" "nekā" Posit);
|
||||
less_CAdv = mkCAdv "mazāk" "nekā" Posit;
|
||||
as_CAdv = mkCAdv "tikpat" "kā" Posit;
|
||||
|
||||
|
||||
here_Adv = mkAdv "šeit" ;
|
||||
there_Adv = mkAdv "tur" ;
|
||||
everywhere_Adv = mkAdv "visur" ;
|
||||
here7to_Adv = mkAdv ["uz šejieni"] ;
|
||||
here7from_Adv = mkAdv ["no šejienes"] ;
|
||||
there7to_Adv = mkAdv "uz turieni" ;
|
||||
there7from_Adv = mkAdv "no turienes";
|
||||
somewhere_Adv = mkAdv "kaut kur" ;
|
||||
quite_Adv = mkAdv "diezgan" ;
|
||||
|
||||
both7and_DConj = mkConj "gan" ("," ++ "gan"); --FIXME - komati nav tā kā vajag
|
||||
either7or_DConj = mkConj ("vai" ++ "nu") ("," ++ "vai") Sg ; --FIXME - komati nav tā kā vajag
|
||||
@@ -297,7 +340,7 @@ lin
|
||||
Dat => "kuram";
|
||||
Acc => "kuru";
|
||||
Loc => "kurā";
|
||||
Voc => NON_EXISTENT
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
};
|
||||
n = Sg
|
||||
};
|
||||
@@ -308,50 +351,79 @@ lin
|
||||
Dat => "kuriem";
|
||||
Acc => "kurus";
|
||||
Loc => "kuros";
|
||||
Voc => NON_EXISTENT
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
};
|
||||
n = Pl
|
||||
};
|
||||
|
||||
whatSg_IP = {
|
||||
s = table {
|
||||
Nom => "kas"; -- FIXME - Fem? standarta locīšana?
|
||||
Gen => "kā";
|
||||
Dat => "kam";
|
||||
Acc => "ko";
|
||||
Loc => "kur";
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
};
|
||||
n = Sg
|
||||
};
|
||||
whatPl_IP = {
|
||||
s = table {
|
||||
Nom => "kas"; -- FIXME - Fem? standarta locīšana?
|
||||
Gen => "kā";
|
||||
Dat => "kam";
|
||||
Acc => "ko";
|
||||
Loc => "kur";
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
};
|
||||
n = Pl
|
||||
};
|
||||
|
||||
why_IAdv = ss "kāpēc" ;
|
||||
how_IAdv = ss "kā" ;
|
||||
how8much_IAdv = ss "cik daudz" ;
|
||||
when_IAdv = ss "kad" ;
|
||||
where_IAdv = ss "kur" ;
|
||||
|
||||
|
||||
which_IQuant = {s = table {
|
||||
Masc => table { Sg => "kurš"; Pl => "kuri"};
|
||||
Fem => table { Sg => "kura"; Pl => "kuras"}
|
||||
}
|
||||
} ;
|
||||
|
||||
when_Subj = ss "kad" ;
|
||||
|
||||
when_Subj = ss "kad" ;
|
||||
although_Subj = ss "kaut arī" ;
|
||||
because_Subj = ss "jo" ;
|
||||
if_Subj = ss "ja" ;
|
||||
that_Subj = ss "ka" ; -- ja pareizi saprotu šo konkrēto 'that' pielietojumu
|
||||
|
||||
|
||||
all_Predet = { s = table {
|
||||
Masc => "visi";
|
||||
Fem => "visas"
|
||||
}
|
||||
};
|
||||
only_Predet = { s = table { _ => "tikai"} };
|
||||
only_Predet = { s = table { _ => "tikai"} };
|
||||
most_Predet = { s = table { _ => "vairums"} };
|
||||
|
||||
|
||||
yes_Utt = ss "jā" ;
|
||||
please_Voc = ss "lūdzu" ;
|
||||
|
||||
almost_AdN = mkAdN "gandrīz" ;
|
||||
at_least_AdN = mkAdN "vismaz" ;
|
||||
at_most_AdN = mkAdN "ne vairāk kā" ;
|
||||
|
||||
|
||||
always_AdV = mkAdV "vienmēr" ;
|
||||
|
||||
--FIXME placeholder
|
||||
by8agent_Prep = mkPrep NON_EXISTENT Nom Nom;
|
||||
whatSg_IP = {s = \\_ => NON_EXISTENT; n= Sg};
|
||||
|
||||
|
||||
|
||||
how8many_IDet = { s = table { _ => "cik daudz"}; n = Sg }; --TODO jātestē kā to pielieto un vai nevajag vēl kaut ko
|
||||
|
||||
|
||||
everybody_NP = DetCN emptyPl_Det (UseN (mkN "visi"));
|
||||
everything_NP = DetCN emptySg_Det (UseN (mkN "viss"));
|
||||
nobody_NP = DetCN emptySg_Det (UseN (mkN "neviens"));
|
||||
nothing_NP = DetCN emptySg_Det (UseN (mkN "nekas"));
|
||||
somebody_NP = DetCN emptySg_Det (UseN (mkN "kāds"));
|
||||
something_NP = DetCN emptySg_Det (UseN (mkN "kaut kas"));
|
||||
|
||||
oper
|
||||
reflPron : Case => Str = table {
|
||||
Nom => NON_EXISTENT;
|
||||
@@ -359,17 +431,28 @@ oper
|
||||
Dat => "sev";
|
||||
Acc => "sevi";
|
||||
Loc => "sevī";
|
||||
Voc => NON_EXISTENT
|
||||
ResLav.Voc => NON_EXISTENT
|
||||
} ;
|
||||
|
||||
lai_Subj = ss "lai" ;
|
||||
kameer_Subj = ss "kamēr" ;
|
||||
|
||||
|
||||
lai_Subj = ss "lai" ;
|
||||
kameer_Subj = ss "kamēr" ;
|
||||
|
||||
emptyPl_Det = {
|
||||
s:Gender => Case => Str = \\_,_ => [];
|
||||
n = Pl ;
|
||||
d = Indef
|
||||
} ;
|
||||
emptySg_Det = {
|
||||
s:Gender => Case => Str = \\_,_ => [];
|
||||
n = Sg ;
|
||||
d = Indef
|
||||
} ;
|
||||
|
||||
no_Utt = ss "nē" ;
|
||||
|
||||
{-
|
||||
by8agent_Prep = mkPrep "by" ;
|
||||
by8means_Prep = mkPrep "by" ;
|
||||
can8know_VV, can_VV = {
|
||||
s = table {
|
||||
s = table {
|
||||
VVF VInf => ["be able to"] ;
|
||||
VVF VPres => "can" ;
|
||||
VVF VPPart => ["been able to"] ;
|
||||
@@ -380,19 +463,6 @@ oper
|
||||
} ;
|
||||
isAux = True
|
||||
} ;
|
||||
during_Prep = mkPrep "during" ;
|
||||
everybody_NP = regNP "everybody" singular ;
|
||||
every_Det = mkDeterminer singular "every" ;
|
||||
everything_NP = regNP "everything" singular ;
|
||||
everywhere_Adv = mkAdv "everywhere" ;
|
||||
few_Det = mkDeterminer plural "few" ;
|
||||
--- first_Ord = ss "first" ; DEPRECATED
|
||||
here7to_Adv = mkAdv ["to here"] ;
|
||||
here7from_Adv = mkAdv ["from here"] ;
|
||||
how8many_IDet = mkDeterminer plural ["how many"] ;
|
||||
in8front_Prep = mkPrep ["in front of"] ;
|
||||
many_Det = mkDeterminer plural "many" ;
|
||||
much_Det = mkDeterminer singular "much" ;
|
||||
must_VV = {
|
||||
s = table {
|
||||
VVF VInf => ["have to"] ;
|
||||
@@ -405,39 +475,12 @@ oper
|
||||
} ;
|
||||
isAux = True
|
||||
} ;
|
||||
---b no_Phr = ss "no" ;
|
||||
no_Utt = ss "no" ;
|
||||
---- one_Quant = mkDeterminer singular "one" ; -- DEPRECATED
|
||||
part_Prep = mkPrep "of" ;
|
||||
quite_Adv = mkAdv "quite" ;
|
||||
somebody_NP = regNP "somebody" singular ;
|
||||
something_NP = regNP "something" singular ;
|
||||
somewhere_Adv = mkAdv "somewhere" ;
|
||||
that_Quant = mkQuant "that" "those" ;
|
||||
there7to_Adv = mkAdv "there" ;
|
||||
there7from_Adv = mkAdv ["from there"] ;
|
||||
this_Quant = mkQuant "this" "these" ;
|
||||
through_Prep = mkPrep "through" ;
|
||||
|
||||
whatPl_IP = mkIP "what" "what" "what's" plural ;
|
||||
whatSg_IP = mkIP "what" "what" "what's" singular ;
|
||||
---b whichPl_IDet = mkDeterminer plural ["which"] ;
|
||||
---b whichSg_IDet = mkDeterminer singular ["which"] ;
|
||||
whoPl_IP = mkIP "who" "whom" "whose" plural ;
|
||||
whoSg_IP = mkIP "who" "whom" "whose" singular ;
|
||||
|
||||
---b yes_Phr = ss "yes" ;
|
||||
|
||||
not_Predet = {s = "not" ; lock_Predet = <>} ;
|
||||
no_Quant = mkQuant "no" "no" "none" "none" ;
|
||||
if_then_Conj = mkConj "if" "then" singular ;
|
||||
nobody_NP = regNP "nobody" singular ;
|
||||
nothing_NP = regNP "nothing" singular ;
|
||||
|
||||
except_Prep = mkPrep "except" ;
|
||||
|
||||
have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
|
||||
lin language_title_Utt = ss "English" ;
|
||||
|
||||
-}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,44 +1,11 @@
|
||||
--# -path=.:../abstract:../common
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete SymbolLav of Symbol = CatLav ** open Prelude, ResLav in {
|
||||
{-
|
||||
lin
|
||||
SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
NumPN i = {s = i.s ; g = Neutr} ;
|
||||
CNIntNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! c ;
|
||||
a = agrgP3 Sg cn.g
|
||||
} ;
|
||||
CNSymbNP det cn xs = {
|
||||
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ;
|
||||
a = agrgP3 det.n cn.g
|
||||
} ;
|
||||
CNNumNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Nom ++ i.s ! c ;
|
||||
a = agrgP3 Sg cn.g
|
||||
} ;
|
||||
concrete SymbolLav of Symbol = CatLav ** open
|
||||
Prelude,
|
||||
ResLav
|
||||
in {
|
||||
|
||||
SymbS sy = sy ;
|
||||
flags
|
||||
coding = utf8 ;
|
||||
|
||||
SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
|
||||
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
|
||||
|
||||
lincat
|
||||
|
||||
Symb, [Symb] = SS ;
|
||||
|
||||
lin
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS "and" ;
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
oper
|
||||
-- Note: this results in a space before 's, but there's
|
||||
-- not mauch we can do about that.
|
||||
addGenitiveS : Str -> Case => Str = \s ->
|
||||
table { Gen => s ++ "'s"; _ => s } ;
|
||||
-}
|
||||
}
|
||||
|
||||
@@ -1,87 +1,105 @@
|
||||
concrete VerbLav of Verb = CatLav ** open ResLav, ParadigmsVerbsLav, StructuralLav in {
|
||||
--FIXME - module relations. VerbLav is included in many places because of buldVerb, and includes ParadigmsVerbsLav because of mkVerb_toBe - they need to be reallocated somehow to ResLav or something similar. not so simple since morphology itself needs ResLav & friends.
|
||||
flags optimize=all_subs ;
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
lin
|
||||
|
||||
UseV v = {v = v ; s2 = \\_ => []} ; -- TODO - rewrite ðo uz valencçm, lai ir semantiskâs saites
|
||||
|
||||
ComplVV v vp = {v = v; s2 = \\agr => build_VP vp Pos Infinitive agr};
|
||||
ComplVS v s = {v = v; s2 = \\_ => "," ++ v.subj.s ++ s.s};
|
||||
ComplVQ v q = {v = v; s2 = \\_ => "," ++ q.s};
|
||||
ComplVA v ap = {v = v; s2 = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom };
|
||||
|
||||
SlashV2a v = {v = v ; s2 = \\_ => []; p = v.p};
|
||||
Slash2V3 v np = insertObjc (\\_ => v.p1.s ++ np.s ! (v.p1.c ! (fromAgr np.a).n)) {v = v; s2 = \\_ => []; p = v.p2};
|
||||
Slash3V3 v np = insertObjc (\\_ => v.p2.s ++ np.s ! (v.p2.c ! (fromAgr np.a).n)) {v = v; s2 = \\_ => []; p = v.p1};
|
||||
-- FIXME: module relations. VerbLav is included in many places because of buildVerb,
|
||||
-- and includes ParadigmsVerbsLav because of mkVerb_toBe -
|
||||
-- they need to be reallocated somehow to ResLav or something similar.
|
||||
-- Not so simple since morphology itself needs ResLav & friends.
|
||||
|
||||
SlashV2V v vp = {v = v; s2 = \\agr => build_VP vp Pos Infinitive agr; p = v.p};
|
||||
SlashV2S v s = {v = v; s2 = \\_ => "," ++ v.subj.s ++ s.s; p = v.p};
|
||||
SlashV2Q v q = {v = v; s2 = \\_ => "," ++ q.s; p = v.p};
|
||||
SlashV2A v ap = {v = v; s2 = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom ; p = v.p};
|
||||
|
||||
ComplSlash vp np = insertObjPre (\\_ => vp.p.s ++ np.s ! (vp.p.c ! (fromAgr np.a).n)) vp;
|
||||
|
||||
CompAP ap = {s = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom } ;
|
||||
CompNP np = {s = \\_ => np.s ! Nom} ;
|
||||
CompAdv a = {s = \\_ => a.s} ;
|
||||
|
||||
ReflVP vp = insertObjPre ( \\a => vp.p.s ++ reflPron ! (vp.p.c ! (fromAgr a).n)) vp;
|
||||
UseComp comp = {v = lin V mkVerb_toBe; s2 = \\agr => comp.s ! agr};
|
||||
|
||||
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||
AdVVP adv vp = insertObjPre (\\_ => adv.s) vp ;
|
||||
|
||||
oper
|
||||
build_VP : ResLav.VP -> Polarity -> VerbForm -> Agr -> Str = \vp,p,vf,agr -> vp.v.s ! p ! vf ++ vp.s2 ! agr;
|
||||
|
||||
insertObj : (Agr => Str) -> {v : Verb ; s2 : Agr => Str} -> {v : Verb ; s2 : Agr => Str} = \obj,vp -> {
|
||||
v = vp.v ;
|
||||
s2 = \\a => vp.s2 ! a ++ obj ! a
|
||||
} ;
|
||||
insertObjPre : (Agr => Str) -> {v : Verb ; s2 : Agr => Str} -> {v : Verb ; s2 : Agr => Str} = \obj,vp -> {
|
||||
v = vp.v ;
|
||||
s2 = \\a => obj ! a ++ vp.s2 ! a
|
||||
} ;
|
||||
insertObjc : (Agr => Str) -> {v : Verb ; s2 : Agr => Str; p: Prep} -> {v : Verb ; s2 : Agr => Str; p: Prep} = \obj,vp ->
|
||||
insertObj obj vp ** {p = vp.p};
|
||||
|
||||
buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Str = \v,mood,pol,ag -> let
|
||||
ag = fromAgr ag;
|
||||
part = v.s ! ResLav.Pos ! (Participle ag.g ag.n Nom)
|
||||
in case mood of { -- Verb
|
||||
Ind Simul tense => v.s ! pol ! (Indicative ag.p ag.n tense) ;
|
||||
Ind Anter tense => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n tense) ++ part ;
|
||||
concrete VerbLav of Verb = CatLav ** open
|
||||
ResLav,
|
||||
ParadigmsVerbsLav,
|
||||
StructuralLav
|
||||
in {
|
||||
|
||||
Rel _ Past => ResLav.NON_EXISTENT ; -- FIXME (?)
|
||||
Rel Simul tense => v.s ! pol ! (Relative tense) ;
|
||||
Rel Anter tense => mkVerb_toBe.s ! pol ! (Relative tense) ++ part ;
|
||||
flags
|
||||
optimize = all_subs ;
|
||||
coding = utf8 ;
|
||||
|
||||
Deb Simul tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++
|
||||
v.s ! ResLav.Pos ! Debitive ;
|
||||
Deb Anter tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++
|
||||
mkVerb_toBe.s ! ResLav.Pos ! (Participle Masc Sg Nom) ++ v.s ! ResLav.Pos ! Debitive ;
|
||||
lin
|
||||
-- TODO: rewrite šo uz valencēm, lai ir semantiskās saites
|
||||
UseV v = { v = v ; s2 = \\_ => [] } ;
|
||||
|
||||
Condit Simul => v.s ! pol ! (Indicative ag.p ag.n Cond) ;
|
||||
Condit Anter => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n Cond) ++ part
|
||||
};
|
||||
ComplVV v vp = { v = v ; s2 = \\agr => build_VP vp Pos Infinitive agr } ;
|
||||
ComplVS v s = { v = v ; s2 = \\_ => "," ++ v.subj.s ++ s.s } ;
|
||||
ComplVQ v q = { v = v ; s2 = \\_ => "," ++ q.s } ;
|
||||
ComplVA v ap = { v = v ; s2 = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom } ;
|
||||
|
||||
SlashV2a v = { v = v ; s2 = \\_ => [] ; p = v.p } ;
|
||||
|
||||
Slash2V3 v np =
|
||||
insertObjc (\\_ => v.p1.s ++ np.s ! (v.p1.c ! (fromAgr np.a).n))
|
||||
{ v = v ; s2 = \\_ => [] ; p = v.p2 } ;
|
||||
|
||||
Slash3V3 v np =
|
||||
insertObjc (\\_ => v.p2.s ++ np.s ! (v.p2.c ! (fromAgr np.a).n))
|
||||
{ v = v ; s2 = \\_ => [] ; p = v.p1 } ;
|
||||
|
||||
SlashV2V v vp = { v = v ; s2 = \\agr => build_VP vp Pos Infinitive agr ; p = v.p } ;
|
||||
SlashV2S v s = { v = v ; s2 = \\_ => "," ++ v.subj.s ++ s.s ; p = v.p } ;
|
||||
SlashV2Q v q = { v = v ; s2 = \\_ => "," ++ q.s ; p = v.p } ;
|
||||
SlashV2A v ap = { v = v ; s2 = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom ; p = v.p } ;
|
||||
|
||||
ComplSlash vp np = insertObjPre (\\_ => vp.p.s ++ np.s ! (vp.p.c ! (fromAgr np.a).n)) vp ;
|
||||
|
||||
CompAP ap = { s = \\agr => ap.s ! Indef ! (fromAgr agr).g ! (fromAgr agr).n ! Nom } ;
|
||||
CompNP np = { s = \\_ => np.s ! Nom } ;
|
||||
CompAdv a = { s = \\_ => a.s } ;
|
||||
CompCN cn = { s = \\agr => cn.s ! Indef ! (fromAgr agr).n ! Nom } ;
|
||||
|
||||
ReflVP vp = insertObjPre (\\a => vp.p.s ++ reflPron ! (vp.p.c ! (fromAgr a).n)) vp ;
|
||||
|
||||
UseComp comp = { v = lin V mkVerb_toBe ; s2 = \\agr => comp.s ! agr } ;
|
||||
|
||||
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||
AdVVP adv vp = insertObjPre (\\_ => adv.s) vp ;
|
||||
|
||||
oper
|
||||
build_VP : ResLav.VP -> Polarity -> VerbForm -> Agr -> Str = \vp,p,vf,agr ->
|
||||
vp.v.s ! p ! vf ++ vp.s2 ! agr ;
|
||||
|
||||
insertObj : (Agr => Str) -> { v : Verb ; s2 : Agr => Str } -> { v : Verb ; s2 : Agr => Str } =
|
||||
\obj,vp -> {
|
||||
v = vp.v ;
|
||||
s2 = \\a => vp.s2 ! a ++ obj ! a
|
||||
} ;
|
||||
|
||||
insertObjPre : (Agr => Str) -> { v : Verb ; s2 : Agr => Str } -> { v : Verb ; s2 : Agr => Str } =
|
||||
\obj,vp -> {
|
||||
v = vp.v ;
|
||||
s2 = \\a => obj ! a ++ vp.s2 ! a
|
||||
} ;
|
||||
|
||||
insertObjc : (Agr => Str) -> { v : Verb ; s2 : Agr => Str ; p : Prep } -> { v : Verb ; s2 : Agr => Str ; p : Prep } =
|
||||
\obj,vp -> insertObj obj vp ** { p = vp.p } ;
|
||||
|
||||
buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Str = \v,mood,pol,ag ->
|
||||
let
|
||||
ag = fromAgr ag ;
|
||||
part = v.s ! ResLav.Pos ! (Participle ag.g ag.n Nom)
|
||||
in case mood of {
|
||||
Ind Simul tense => v.s ! pol ! (Indicative ag.p ag.n tense) ;
|
||||
Ind Anter tense => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n tense) ++ part ;
|
||||
|
||||
Rel _ Past => ResLav.NON_EXISTENT ; -- FIXME (?)
|
||||
Rel Simul tense => v.s ! pol ! (Relative tense) ;
|
||||
Rel Anter tense => mkVerb_toBe.s ! pol ! (Relative tense) ++ part ;
|
||||
|
||||
Deb Simul tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++ v.s ! ResLav.Pos ! Debitive ;
|
||||
Deb Anter tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++
|
||||
mkVerb_toBe.s ! ResLav.Pos ! (Participle Masc Sg Nom) ++ v.s ! ResLav.Pos ! Debitive ;
|
||||
|
||||
Condit Simul => v.s ! pol ! (Indicative ag.p ag.n Cond) ;
|
||||
Condit Anter => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n Cond) ++ part
|
||||
} ;
|
||||
|
||||
-- TODO: nav testēts
|
||||
lin
|
||||
SlashVV vv vp = { v = vv ; s2 = \\agr => build_VP vp Pos Infinitive agr ; p = vp.p } ;
|
||||
SlashV2VNP vv np vp =
|
||||
insertObjc (\\_ => vv.p.s ++ np.s ! (vv.p.c ! (fromAgr np.a).n))
|
||||
{ v = vv ; s2 = \\agr => build_VP vp Pos Infinitive agr ; p = vp.p } ;
|
||||
|
||||
-- FIXME: placeholder
|
||||
PassV2 v = { v = v ; s2 = \\_ => NON_EXISTENT } ;
|
||||
|
||||
--FIXME nav testçts
|
||||
lin
|
||||
SlashVV vv vp = {v = vv; s2 = \\agr => build_VP vp Pos Infinitive agr; p = vp.p};
|
||||
SlashV2VNP vv np vp = insertObjc (\\_ => vv.p.s ++ np.s ! (vv.p.c ! (fromAgr np.a).n)){v = vv; s2 = \\agr => build_VP vp Pos Infinitive agr; p = vp.p};
|
||||
--FIXME placeholder
|
||||
PassV2 v = {v = v; s2 = \\_ => NON_EXISTENT};
|
||||
|
||||
{-
|
||||
SlashVV vv vp =
|
||||
insertObj (\\a => infVP vv.isAux vp a) (predVV vv) **
|
||||
{c2 = vp.c2} ;
|
||||
SlashV2VNP vv np vp =
|
||||
insertObjPre (\\_ => vv.c2 ++ np.s ! Acc)
|
||||
(insertObjc (\\a => infVP vv.isAux vp a) (predVc vv)) **
|
||||
{c2 = vp.c2} ;
|
||||
|
||||
PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ;
|
||||
-}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user