forked from GitHub/gf-rgl
Merge remote-tracking branch 'upstream/master' into por
This commit is contained in:
@@ -2,19 +2,19 @@ concrete AdverbChi of Adverb = CatChi **
|
|||||||
open ResChi, Prelude in {
|
open ResChi, Prelude in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
PositAdvAdj a = {s = a.s ++ "地" ; advType = ATManner} ; ---- for all adjs?
|
PositAdvAdj a = {s = a.s ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs?
|
||||||
|
|
||||||
PrepNP prep np = ss (appPrep prep np.s) ** {advType = prep.advType} ; --- should depend on np too ?
|
PrepNP prep np = ss (appPrep prep np.s) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- should depend on np too ?
|
||||||
|
|
||||||
ComparAdvAdj cadv a np = ss (a.s ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner} ;
|
ComparAdvAdj cadv a np = ss (a.s ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner ; hasDe = False} ;
|
||||||
|
|
||||||
ComparAdvAdjS cadv a s = ss (a.s ++ cadv.s ++ cadv.p ++ s.s) ** {advType = ATManner} ;
|
ComparAdvAdjS cadv a s = ss (a.s ++ cadv.s ++ cadv.p ++ s.s) ** {advType = ATManner ; hasDe = False} ;
|
||||||
|
|
||||||
AdAdv adv ad = ss (ad.s ++ adv.s) ** {advType = ad.advType} ;
|
AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ;
|
||||||
|
|
||||||
SubjS subj s = ss (subj.prePart ++ s.s ++ subj.sufPart) ** {advType = ATTime} ;
|
SubjS subj s = ss (subj.prePart ++ s.s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ;
|
||||||
|
|
||||||
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner} ; -----
|
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; -----
|
||||||
|
|
||||||
PositAdAAdj a = {s = a.s} ; ----
|
PositAdAAdj a = {s = a.s} ; ----
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
Ord = {s : Str} ;
|
Ord = {s : Str} ;
|
||||||
Num = {s : Str ; numType : NumType} ;
|
Num = {s : Str ; numType : NumType} ;
|
||||||
|
|
||||||
Adv = {s : Str ; advType : AdvType} ;
|
Adv = {s : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
ConjS c = conjunctDistrSS (c.s ! CSent) ;
|
ConjS c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType} ; ---- ??
|
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ??
|
||||||
ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ;
|
ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ;
|
||||||
ConjAP c as = conjunctDistrSS (c.s ! CPhr CAPhrase) as ** {monoSyl = False ; hasAdA = True} ; ---- ??
|
ConjAP c as = conjunctDistrSS (c.s ! CPhr CAPhrase) as ** {monoSyl = notB as.monoSyl ; hasAdA = True} ; ---- add de iff as doesn't
|
||||||
ConjRS c = conjunctDistrSS (c.s ! CSent) ;
|
ConjRS c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ;
|
ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ;
|
||||||
|
|
||||||
@@ -13,12 +13,12 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
BaseS = twoSS ;
|
BaseS = twoSS ;
|
||||||
ConsS = consrSS duncomma ;
|
ConsS = consrSS duncomma ;
|
||||||
BaseAdv x y = twoSS x y ** {advType = x.advType} ; ---- ??
|
BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ??
|
||||||
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType} ; ---- ??
|
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
||||||
BaseNP = twoSS ;
|
BaseNP = twoSS ;
|
||||||
ConsNP = consrSS duncomma ;
|
ConsNP = consrSS duncomma ;
|
||||||
BaseAP = twoSS ;
|
BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ;
|
||||||
ConsAP = consrSS duncomma ;
|
ConsAP x xs = consrSS duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
||||||
BaseRS = twoSS ;
|
BaseRS = twoSS ;
|
||||||
ConsRS = consrSS duncomma ;
|
ConsRS = consrSS duncomma ;
|
||||||
BaseCN x y = twoSS x y ** {c = x.c} ; --- classified comes from first part ; should it rather be ge?
|
BaseCN x y = twoSS x y ** {c = x.c} ; --- classified comes from first part ; should it rather be ge?
|
||||||
@@ -26,9 +26,9 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
[S] = {s1,s2 : Str} ;
|
||||||
[Adv] = {s1,s2 : Str ; advType : AdvType} ;
|
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
[NP] = {s1,s2 : Str} ;
|
[NP] = {s1,s2 : Str} ;
|
||||||
[AP] = {s1,s2 : Str} ;
|
[AP] = {s1,s2 : Str ; monoSyl : Bool} ;
|
||||||
[RS] = {s1,s2 : Str} ;
|
[RS] = {s1,s2 : Str} ;
|
||||||
[CN] = {s1,s2 : Str ; c : Str} ;
|
[CN] = {s1,s2 : Str ; c : Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -36,16 +36,16 @@ lincat
|
|||||||
Month = N ;
|
Month = N ;
|
||||||
Year = NP ;
|
Year = NP ;
|
||||||
lin
|
lin
|
||||||
weekdayPunctualAdv w = lin Adv {s = w.s ; advType = timeAdvType} ;
|
weekdayPunctualAdv w = lin Adv {s = w.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
weekdayHabitualAdv w = lin Adv {s = w.s ; advType = timeAdvType} ;
|
weekdayHabitualAdv w = lin Adv {s = w.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
weekdayNextAdv w = lin Adv {s = "下" ++ w.s ; advType = timeAdvType} ;
|
weekdayNextAdv w = lin Adv {s = "下" ++ w.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
weekdayLastAdv w = lin Adv {s = "上" ++ w.s ; advType = timeAdvType} ;
|
weekdayLastAdv w = lin Adv {s = "上" ++ w.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
|
|
||||||
monthAdv m = lin Adv {s = m.s ; advType = timeAdvType} ;
|
monthAdv m = lin Adv {s = m.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
yearAdv y = lin Adv {s = y.s ++ "年" ; advType = timeAdvType} ;
|
yearAdv y = lin Adv {s = y.s ++ "年" ; advType = timeAdvType ; hasDe = False} ;
|
||||||
dayMonthAdv d m = lin Adv {s = m.s ++ d.s ++ "日" ; advType = timeAdvType} ;
|
dayMonthAdv d m = lin Adv {s = m.s ++ d.s ++ "日" ; advType = timeAdvType ; hasDe = False} ;
|
||||||
monthYearAdv m y = lin Adv {s = y.s ++ "年" ++ m.s ; advType = timeAdvType} ;
|
monthYearAdv m y = lin Adv {s = y.s ++ "年" ++ m.s ; advType = timeAdvType ; hasDe = False} ;
|
||||||
dayMonthYearAdv d m y = lin Adv {s = y.s ++ "年" ++ m.s ++ d.s ++ "日" ; advType = timeAdvType} ;
|
dayMonthYearAdv d m y = lin Adv {s = y.s ++ "年" ++ m.s ++ d.s ++ "日" ; advType = timeAdvType ; hasDe = False} ;
|
||||||
|
|
||||||
intYear i = lin NP i ;
|
intYear i = lin NP i ;
|
||||||
intMonthday i = lin NP i ;
|
intMonthday i = lin NP i ;
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
PPartNP np v2 = mkNP ((predV v2 v2.part).verb.s ++ possessive_s ++ np.s) ; ---- ??
|
PPartNP np v2 = mkNP ((predV v2 v2.part).verb.s ++ possessive_s ++ np.s) ; ---- ??
|
||||||
|
|
||||||
AdvNP np adv = mkNP (adv.s ++ possessiveIf adv.advType ++ np.s) ;
|
AdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ np.s) ;
|
||||||
ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.advType ++ embedInCommas np.s) ; ---- commas?
|
ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s) ; ---- commas?
|
||||||
|
|
||||||
DetQuant quant num = {
|
DetQuant quant num = {
|
||||||
s = case num.numType of {
|
s = case num.numType of {
|
||||||
@@ -85,7 +85,7 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ;
|
RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ;
|
||||||
AdvCN cn ad = {s = ad.s ++ possessiveIf ad.advType ++ cn.s ; c = cn.c} ;
|
AdvCN cn ad = {s = ad.s ++ possessiveIf ad.hasDe ++ cn.s ; c = cn.c} ;
|
||||||
SentCN cn cs = {s = cs.s ++ cn.s ; c = cn.c} ;
|
SentCN cn cs = {s = cs.s ++ cn.s ; c = cn.c} ;
|
||||||
ApposCN cn np = {s = np.s ++ cn.s ; c = cn.c} ;
|
ApposCN cn np = {s = np.s ++ cn.s ; c = cn.c} ;
|
||||||
|
|
||||||
|
|||||||
@@ -145,13 +145,13 @@ oper
|
|||||||
|
|
||||||
mkAdv = overload {
|
mkAdv = overload {
|
||||||
mkAdv : Str -> Adv
|
mkAdv : Str -> Adv
|
||||||
= \s -> lin Adv {s = word s ; advType = getAdvType s} ;
|
= \s -> let at = getAdvType s in lin Adv {s = word s ; advType = at ; hasDe = advTypeHasDe at} ;
|
||||||
mkAdv : Str -> Str -> Adv
|
mkAdv : Str -> Str -> Adv
|
||||||
= \s,t -> lin Adv {s = word (s + t) ; advType = getAdvType s} ; ----
|
= \s,t -> let at = getAdvType s in lin Adv {s = word (s + t) ; advType = at ; hasDe = advTypeHasDe at} ; ----
|
||||||
mkAdv : Str -> AdvType -> Adv
|
mkAdv : Str -> AdvType -> Adv
|
||||||
= \s,at -> lin Adv {s = word s ; advType = at} ;
|
= \s,at -> lin Adv {s = word s ; advType = at ; hasDe = advTypeHasDe at} ;
|
||||||
mkAdv : Adv -> AdvType -> Adv -- To fix the AdvType in an Adv produced by SyntaxChi.mkAdv
|
mkAdv : Adv -> AdvType -> Adv -- To fix the AdvType in an Adv produced by SyntaxChi.mkAdv
|
||||||
= \adv,at -> adv ** {advType = at} ;
|
= \adv,at -> adv ** {advType = at ; hasDe = advTypeHasDe at} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -250,12 +250,18 @@ oper
|
|||||||
s = word s
|
s = word s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType} ;
|
Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
|
|
||||||
mkPreposition : Str -> Str -> AdvType -> Preposition = \s1,s2,at -> {
|
mkPreposition : Str -> Str -> AdvType -> Preposition = \s1,s2,at -> {
|
||||||
prepPre = word s1 ;
|
prepPre = word s1 ;
|
||||||
prepPost = word s2 ;
|
prepPost = word s2 ;
|
||||||
advType = at
|
advType = at ;
|
||||||
|
hasDe = advTypeHasDe at ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
advTypeHasDe : AdvType -> Bool = \at -> case at of {
|
||||||
|
ATPoss => True ;
|
||||||
|
_ => False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
getAdvType : Str -> AdvType = \s -> case s of {
|
getAdvType : Str -> AdvType = \s -> case s of {
|
||||||
@@ -264,8 +270,8 @@ oper
|
|||||||
_ => ATPlace False -- uncertain whether ATPlace
|
_ => ATPlace False -- uncertain whether ATPlace
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
possessiveIf : AdvType -> Str = \at -> case at of {
|
possessiveIf : Bool -> Str = \hasDe -> case hasDe of {
|
||||||
ATPoss => [] ; --- to avoid double "de"
|
True => [] ; --- to avoid double "de"
|
||||||
_ => possessive_s
|
_ => possessive_s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
|
|||||||
A2 = A ** {c2 : Compl} ;
|
A2 = A ** {c2 : Compl} ;
|
||||||
|
|
||||||
N = Noun ;
|
N = Noun ;
|
||||||
N2 = CommonNoun ** {c2 : Compl ; isPre : Bool ; lock_N2 : {}} ;
|
N2 = Noun ** {c2 : Compl ; isPre : Bool ; lock_N2 : {}} ;
|
||||||
N3 = CommonNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool ; lock_N3 : {}} ;
|
N3 = Noun ** {c2,c3 : Compl ; isPre,isPre2 : Bool ; lock_N3 : {}} ;
|
||||||
PN = {s : Case => Str} ;
|
PN = {s : Case => Str} ;
|
||||||
|
|
||||||
oper Verb1 = Verb ** { sc : NPForm} ; --what is this for? --subject case, i.e. "ma näen kassi"/"mul on kass"
|
oper Verb1 = Verb ** { sc : NPForm} ; --what is this for? --subject case, i.e. "ma näen kassi"/"mul on kass"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ concrete ExtendEst of Extend =
|
|||||||
Coordination,
|
Coordination,
|
||||||
Prelude,
|
Prelude,
|
||||||
MorphoEst,
|
MorphoEst,
|
||||||
|
LexiconEst,
|
||||||
ParadigmsEst in {
|
ParadigmsEst in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
@@ -44,7 +45,7 @@ concrete ExtendEst of Extend =
|
|||||||
|
|
||||||
-- : Num -> CN -> RP ; -- whose car
|
-- : Num -> CN -> RP ; -- whose car
|
||||||
GenRP num cn = {
|
GenRP num cn = {
|
||||||
s = \\n,c => let k = npform2case num.n c in relPron ! n ! Gen ++ cn.s ! NCase num.n k ;
|
s = \\n,c => let k = npform2case num.n c in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ;
|
||||||
a = RNoAg
|
a = RNoAg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -115,26 +116,34 @@ concrete ExtendEst of Extend =
|
|||||||
mkVPI : VP -> VPI = \vp -> lin VPI {} ;
|
mkVPI : VP -> VPI = \vp -> lin VPI {} ;
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
lin
|
|
||||||
ICompAP ap = {} ; ---- IComp should have agr!
|
|
||||||
|
|
||||||
IAdvAdv adv = {} ;
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
lin
|
||||||
|
-- : AP -> IComp ; -- "how old"
|
||||||
|
ICompAP ap = icompAP "kui" ap ;
|
||||||
|
|
||||||
|
-- : Adv -> IAdv ; -- "how often"
|
||||||
|
IAdvAdv adv = { s = "kui" ++ adv.s } ;
|
||||||
|
|
||||||
-- : VP -> AP ; -- (the man) looking at Mary / filme vaatav (mees)
|
-- : VP -> AP ; -- (the man) looking at Mary / filme vaatav (mees)
|
||||||
PresPartAP vp = {
|
PresPartAP vp = {
|
||||||
s = \\_,_ => vp2adv vp True VIPresPart ;
|
s = \\_,_ => vp2adv vp True VIPresPart ;
|
||||||
infl = Invariable
|
infl = Invariable
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{- TODO: need to change VP to get this to work properly:
|
{- TODO: need to change VP to get the following 3 functions to work properly:
|
||||||
1) Add "mine" form into VP (or switch to a BIND solution and just add a stem)
|
1) Add "mine" form into VP (or switch to a BIND solution and just add a stem)
|
||||||
2) Change s2 in VP so that we can manipulate the complement to be in genitive!
|
2) Change s2 in VP so that we can manipulate the complement to be in genitive!
|
||||||
-- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore)
|
-- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore)
|
||||||
EmbedPresPart vp =
|
EmbedPresPart vp =
|
||||||
let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! }
|
let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! }
|
||||||
{s = vp2adv vp True VI } ;
|
{s = vp2adv vp True VI } ;
|
||||||
|
|
||||||
|
-- : VP -> CN -- publishing of the document (can get a determiner)
|
||||||
|
GerundCN vp = {} ;
|
||||||
|
|
||||||
|
-- : VP -> NP -- publishing the document (by nature definite)
|
||||||
|
GerundNP vp = {} ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
-- : VPSlash -> AP ; -- täna leitud
|
-- : VPSlash -> AP ; -- täna leitud
|
||||||
@@ -147,13 +156,7 @@ concrete ExtendEst of Extend =
|
|||||||
s = \\_,_ => np.s ! NPCase Gen ++ "poolt"
|
s = \\_,_ => np.s ! NPCase Gen ++ "poolt"
|
||||||
++ vp2adv vp True (VIPass Past) ;
|
++ vp2adv vp True (VIPass Past) ;
|
||||||
infl = Invariable } ;
|
infl = Invariable } ;
|
||||||
{-
|
|
||||||
-- : VP -> CN -- publishing of the document (can get a determiner)
|
|
||||||
GerundCN vp = {} ;
|
|
||||||
|
|
||||||
-- : VP -> NP -- publishing the document (by nature definite)
|
|
||||||
GerundNP vp = {} ;
|
|
||||||
-}
|
|
||||||
-- : VP -> Adv
|
-- : VP -> Adv
|
||||||
GerundAdv vp =
|
GerundAdv vp =
|
||||||
{ s = vp2adv vp True (VIInf InfDes) } ;
|
{ s = vp2adv vp True (VIInf InfDes) } ;
|
||||||
@@ -192,22 +195,38 @@ lin
|
|||||||
ComplBareVS v s = insertExtra s.s (predV v) ;
|
ComplBareVS v s = insertExtra s.s (predV v) ;
|
||||||
SlashBareV2S v s = insertExtrac s.s (predVc v) ;
|
SlashBareV2S v s = insertExtrac s.s (predVc v) ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
-- : N -> N -> N ; -- control system / controls system / control-system
|
-- : N -> N -> N ; -- control system / controls system / control-system
|
||||||
CompoundN noun cn = lin N {
|
CompoundN noun cn = lin N {
|
||||||
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf ---- AR genitive best?
|
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf
|
||||||
} ;
|
} ;
|
||||||
{-
|
{-
|
||||||
|
-- : N -> A -> AP ; -- language independent / language-independent
|
||||||
CompoundAP noun adj = {} ;
|
CompoundAP noun adj = {} ;
|
||||||
|
|
||||||
FrontExtPredVP np vp = {} ;
|
-- : VS -> Utt -> VP ; -- say: "today"
|
||||||
|
ComplDirectVS vs utt = {} ;
|
||||||
InvFrontExtPredVP np vp = {} ;
|
-- : VQ -> Utt -> VP ; -- ask: "when"
|
||||||
|
ComplDirectVQ vq utt = {} ;
|
||||||
|
|
||||||
|
-- : NP -> VS -> Utt -> Cl ; -- "I am here", she said
|
||||||
|
FrontComplDirectVS np vs utt = {} ;
|
||||||
|
-- : NP -> VQ -> Utt -> Cl ; -- "where", she asked
|
||||||
|
FrontComplDirectVQ np vq utt = {} ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
-- : AP -> VP -> Cl ; -- it is good to walk / on hea kõndida
|
||||||
|
PredAPVP ap vp =
|
||||||
|
let heaOllaVP : VP = insertObj (\\_,_ => ap.s) vp ; -- puts AP into the s2 field
|
||||||
|
heaOllaComp : Comp = CompVP ASimul PPos heaOlla ; -- chooses InfDa, fixes word order
|
||||||
|
heaOlla : VP = UseComp heaOllaComp -- looks silly, but I want to reuse the abstract syntax funs :-P
|
||||||
|
in existClause noSubj (agrP3 Sg) heaOlla ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
testCl = PredAPVP (PositA good_A) (UseV walk_V) ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
-}
|
|
||||||
-- : AP -> CN ; -- a green one ; en grön (Swe)
|
-- : AP -> CN ; -- a green one ; en grön (Swe)
|
||||||
AdjAsCN ap = { s = ap.s ! True } ; -- True = it's a modifier, not a predicate
|
AdjAsCN ap = { s = ap.s ! True } ; -- True = it's a modifier, not a predicate
|
||||||
|
|
||||||
@@ -224,7 +243,10 @@ lin
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
||||||
|
|
||||||
|
-- : RNP
|
||||||
ReflPron = {s = reflPron} ;
|
ReflPron = {s = reflPron} ;
|
||||||
|
|
||||||
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! Nom ++ cn.s ! num.n ! Nom} ;
|
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! Nom ++ cn.s ! num.n ! Nom} ;
|
||||||
PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;
|
PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,16 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
GenCN = caseCN Gen ; -- auton merkki
|
GenCN = caseCN Gen ; -- soome mees
|
||||||
ComitCN = caseCN Comit ; -- puudega mets
|
ComitCN = caseCN Comit ; -- puudega mets
|
||||||
ElatCN = caseCN Elat ; -- puust laud
|
ElatCN = caseCN Elat ; -- puust laud
|
||||||
|
AbessCN = caseCN Abess ; -- autota pere
|
||||||
|
TerminCN = caseCN Termin ; -- maani kleit
|
||||||
|
|
||||||
GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
|
GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
|
||||||
|
|
||||||
GenRP num cn = {
|
GenRP num cn = {
|
||||||
s = \\n,c => let k = npform2case num.n c in relPron ! n ! Gen ++ cn.s ! NCase num.n k ;
|
s = \\n,c => let k = npform2case num.n c in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ;
|
||||||
a = RNoAg
|
a = RNoAg
|
||||||
--- a = RAg (agrP3 num.n)
|
--- a = RAg (agrP3 num.n)
|
||||||
} ;
|
} ;
|
||||||
@@ -190,8 +192,9 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
a = p.a
|
a = p.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- : Pron -> Quant ;
|
||||||
ProDropPoss p = {
|
ProDropPoss p = {
|
||||||
s = \\_,_ => "oma" ; --???
|
s = \\_,_ => "oma" ;
|
||||||
sp = \\_,_ => p.s ! NPCase Gen ;
|
sp = \\_,_ => p.s ! NPCase Gen ;
|
||||||
isNum = False ;
|
isNum = False ;
|
||||||
isDef = True ;
|
isDef = True ;
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ abstract ExtraEstAbs = Extra [
|
|||||||
|
|
||||||
flags coding=utf8 ;
|
flags coding=utf8 ;
|
||||||
fun
|
fun
|
||||||
GenCN : NP -> CN -> CN ; -- auton merkki
|
GenCN : NP -> CN -> CN ; -- soome mees
|
||||||
ComitCN : NP -> CN -> CN ; -- põlenud puudega mets
|
ComitCN : NP -> CN -> CN ; -- põlenud puudega mets
|
||||||
ElatCN : NP -> CN -> CN ; -- puust laud
|
ElatCN : NP -> CN -> CN ; -- puust laud
|
||||||
|
AbessCN : NP -> CN -> CN ; -- autota pere
|
||||||
|
TerminCN : NP -> CN -> CN ; -- maani kleit
|
||||||
|
|
||||||
AdvExistNP : Adv -> NP -> Cl ; -- kuvassa olemme me
|
AdvExistNP : Adv -> NP -> Cl ; -- kuvassa olemme me
|
||||||
AdvPredNP : Adv -> V -> NP -> Cl ; -- kuvassa hymyilee Veikko
|
AdvPredNP : Adv -> V -> NP -> Cl ; -- kuvassa hymyilee Veikko
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ lin
|
|||||||
love_N = mkN "armastus" ;
|
love_N = mkN "armastus" ;
|
||||||
love_V2 = mkV2 (mkV "armastama") partitive ;
|
love_V2 = mkV2 (mkV "armastama") partitive ;
|
||||||
man_N = mkN "mees" "mehe" "meest" "mehesse" "meeste" "mehi" ;
|
man_N = mkN "mees" "mehe" "meest" "mehesse" "meeste" "mehi" ;
|
||||||
married_A2 = mkA2 (mkA "abielus") (casePrep comitative) ;
|
married_A2 = mkA2 (invA "abielus") (casePrep comitative) ;
|
||||||
meat_N = mkN "liha" ;
|
meat_N = mkN "liha" ;
|
||||||
milk_N = mkN "piim" "piima" "piima" ;
|
milk_N = mkN "piim" "piima" "piima" ;
|
||||||
moon_N = mkN "kuu" ;
|
moon_N = mkN "kuu" ;
|
||||||
|
|||||||
@@ -487,10 +487,10 @@ These used to be here:
|
|||||||
-- for Structural
|
-- for Structural
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
caseTable : Number -> Noun -> Case => Str = \n,cn ->
|
||||||
\\c => cn.s ! NCase n c ;
|
\\c => cn.s ! NCase n c ;
|
||||||
|
|
||||||
mkDet : Number -> CommonNoun -> {
|
mkDet : Number -> Noun -> {
|
||||||
s,sp : Case => Str ; -- minun kolme
|
s,sp : Case => Str ; -- minun kolme
|
||||||
n : Number ; -- Pl (agreement feature for verb)
|
n : Number ; -- Pl (agreement feature for verb)
|
||||||
isNum : Bool ; -- True (a numeral is present)
|
isNum : Bool ; -- True (a numeral is present)
|
||||||
@@ -563,23 +563,17 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
|||||||
x => shortMa.s ! x } } ;
|
x => shortMa.s ! x } } ;
|
||||||
|
|
||||||
|
|
||||||
-- The relative pronoun, "joka", is inflected in case and number,
|
|
||||||
-- like common nouns, but it does not take possessive suffixes.
|
|
||||||
-- The inflextion shows a surprising similarity with "suo".
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
relPron : Number => Case => Str =
|
relPron : NForm => Str =
|
||||||
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida") in
|
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida")
|
||||||
\\n,c => case <n,c> of {
|
in fixPlNom "mis" mis.s ;
|
||||||
<Pl,Nom> => "mis" ;
|
|
||||||
<> => mis.s ! NCase n c } ;
|
|
||||||
|
|
||||||
kesPron : Number => Case => Str =
|
kesPron : NForm => Str =
|
||||||
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda") in
|
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda")
|
||||||
\\n,c => case <n,c> of {
|
in fixPlNom "kes" kes.s ;
|
||||||
<Pl,Nom> => "kes" ;
|
|
||||||
<> => kes.s ! NCase n c } ;
|
|
||||||
|
|
||||||
ProperName = {s : Case => Str} ;
|
ProperName = {s : Case => Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ concrete RelativeEst of Relative = CatEst ** open Prelude, ResEst, MorphoEst in
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
IdRP = {
|
IdRP = {
|
||||||
s = \\n,c => relPron ! n ! npform2case n c ;
|
s = \\n,c => relPron ! NCase n (npform2case n c) ;
|
||||||
a = RNoAg
|
a = RNoAg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ oper
|
|||||||
let
|
let
|
||||||
agrfin = case vp.sc of {
|
agrfin = case vp.sc of {
|
||||||
NPCase Nom => <agr,True> ;
|
NPCase Nom => <agr,True> ;
|
||||||
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
|
_ => <agrP3 Sg,False> -- minule meeldib, minul on
|
||||||
} ;
|
} ;
|
||||||
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
||||||
in {subj = sub b ;
|
in {subj = sub b ;
|
||||||
@@ -566,17 +566,14 @@ oper
|
|||||||
vforms2V (regVForms kinkima kinkida kingib kingitakse) ;
|
vforms2V (regVForms kinkima kinkida kingib kingitakse) ;
|
||||||
|
|
||||||
|
|
||||||
noun2adj : CommonNoun -> Adj = noun2adjComp True ;
|
noun2adj : Noun -> Adj = noun2adjComp True ;
|
||||||
-- noun2adj : Noun -> Adj = noun2adjComp True ;
|
|
||||||
|
|
||||||
-- TODO: remove the unused arguments and clean up the code
|
|
||||||
-- TODO: AAdv is current just Sg Ablat, which seems OK in most cases, although
|
-- TODO: AAdv is current just Sg Ablat, which seems OK in most cases, although
|
||||||
-- ilus -> ilusti | ilusalt?
|
-- ilus -> ilusti | ilusalt?
|
||||||
-- hea -> hästi
|
-- hea -> hästi
|
||||||
-- parem -> paremini
|
-- parem -> paremini
|
||||||
-- parim -> kõige paremini | parimalt?
|
-- parim -> kõige paremini | parimalt?
|
||||||
noun2adjComp : Bool -> CommonNoun -> Adj = \isPos,tuore ->
|
noun2adjComp : Bool -> Noun -> Adj = \isPos,tuore ->
|
||||||
-- noun2adjComp : Bool -> Noun -> Adj = \isPos,tuore ->
|
|
||||||
let
|
let
|
||||||
tuoreesti = Predef.tk 1 (tuore.s ! NCase Sg Gen) + "sti" ;
|
tuoreesti = Predef.tk 1 (tuore.s ! NCase Sg Gen) + "sti" ;
|
||||||
tuoreemmin = Predef.tk 2 (tuore.s ! NCase Sg Gen) + "in"
|
tuoreemmin = Predef.tk 2 (tuore.s ! NCase Sg Gen) + "in"
|
||||||
@@ -587,34 +584,52 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
CommonNoun = {s : NForm => Str} ;
|
Noun = {s : NForm => Str} ;
|
||||||
|
|
||||||
|
|
||||||
-- To form an adjective, it is usually enough to give a noun declension: the
|
-- To form an adjective, it is usually enough to give a noun declension: the
|
||||||
-- adverbial form is regular.
|
-- adverbial form is regular.
|
||||||
|
|
||||||
Adj : Type = {s : AForm => Str} ;
|
Adj : Type = {s : AForm => Str} ;
|
||||||
|
|
||||||
|
-- Helper functions to form Comps.
|
||||||
|
compAP = icompAP [] ;
|
||||||
|
|
||||||
|
icompAP : Str -> {s : Bool => NForm => Str} -> {s : Agr => Str} = \kui,ap ->
|
||||||
|
{ s = \\agr =>
|
||||||
|
let n = complNumAgr agr ;
|
||||||
|
in kui ++ ap.s ! False ! NCase n Nom } ;
|
||||||
|
|
||||||
|
compCN : Noun -> {s : Agr => Str} = \cn ->
|
||||||
|
{ s = \\agr =>
|
||||||
|
let n = complNumAgr agr ;
|
||||||
|
in cn.s ! NCase n Nom } ;
|
||||||
|
|
||||||
|
|
||||||
-- Reflexive pronoun.
|
-- Reflexive pronoun.
|
||||||
--- Possessive could be shared with the more general $NounFin.DetCN$.
|
--- Possessive could be shared with the more general $NounFin.DetCN$.
|
||||||
|
|
||||||
--oper
|
|
||||||
--Estonian version started
|
|
||||||
reflPron : Agr -> NP = \agr ->
|
reflPron : Agr -> NP = \agr ->
|
||||||
let
|
let
|
||||||
ise = nForms2N (nForms6 "ise" "enda" "ennast" "endasse" "IGNORE" "IGNORE")
|
ise = nForms2N (nForms6 "ise" "enda" "ennast" "endasse" "endi" "endid") ;
|
||||||
|
n = case agr of {
|
||||||
|
AgPol => Sg ;
|
||||||
|
Ag n _ => n } ;
|
||||||
in {
|
in {
|
||||||
s = table {
|
s = table {
|
||||||
NPAcc => "ennast" ;
|
NPAcc => "ennast" ;
|
||||||
NPCase c => ise.s ! NCase Sg c
|
NPCase c => fixPlNom "endid" ise.s ! NCase n c
|
||||||
} ;
|
} ;
|
||||||
a = agr ;
|
a = agr ;
|
||||||
isPron = False -- no special acc form
|
isPron = False -- no special acc form
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- Using nForms6 as a shortcut works pretty nicely, but plural nominative is often wrong.
|
||||||
|
-- This is used at least 3 times :-D
|
||||||
|
fixPlNom : Str -> (NForm => Str) -> (NForm => Str) = \mis,n ->
|
||||||
|
table { NCase Pl Nom => mis ;
|
||||||
|
x => n ! x } ;
|
||||||
|
|
||||||
|
|
||||||
Noun = CommonNoun ** {lock_N : {}} ;
|
|
||||||
NForms : Type = Predef.Ints 5 => Str ;
|
NForms : Type = Predef.Ints 5 => Str ;
|
||||||
|
|
||||||
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms =
|
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms =
|
||||||
@@ -628,7 +643,7 @@ oper
|
|||||||
5 => jogesid
|
5 => jogesid
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
n2nforms : CommonNoun -> NForms = \ukko -> table {
|
n2nforms : Noun -> NForms = \ukko -> table {
|
||||||
0 => ukko.s ! NCase Sg Nom ;
|
0 => ukko.s ! NCase Sg Nom ;
|
||||||
1 => ukko.s ! NCase Sg Gen ;
|
1 => ukko.s ! NCase Sg Gen ;
|
||||||
2 => ukko.s ! NCase Sg Part ;
|
2 => ukko.s ! NCase Sg Part ;
|
||||||
@@ -639,7 +654,7 @@ oper
|
|||||||
|
|
||||||
-- Converts 6 given strings (Nom, Gen, Part, Illat, Gen, Part) into Noun
|
-- Converts 6 given strings (Nom, Gen, Part, Illat, Gen, Part) into Noun
|
||||||
-- http://www.eki.ee/books/ekk09/index.php?p=3&p1=5&id=226
|
-- http://www.eki.ee/books/ekk09/index.php?p=3&p1=5&id=226
|
||||||
nForms2N : NForms -> CommonNoun = \f ->
|
nForms2N : NForms -> Noun = \f ->
|
||||||
let
|
let
|
||||||
jogi = f ! 0 ;
|
jogi = f ! 0 ;
|
||||||
joe = f ! 1 ;
|
joe = f ! 1 ;
|
||||||
|
|||||||
@@ -97,19 +97,8 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
|
|||||||
|
|
||||||
----b UseVS, UseVQ = \v -> v ** {c2 = {s = [] ; c = NPAcc ; isPre = True}} ;
|
----b UseVS, UseVQ = \v -> v ** {c2 = {s = [] ; c = NPAcc ; isPre = True}} ;
|
||||||
|
|
||||||
CompAP ap = {
|
CompAP = compAP ;
|
||||||
s = \\agr =>
|
CompCN = compCN ;
|
||||||
let
|
|
||||||
n = complNumAgr agr ;
|
|
||||||
in ap.s ! False ! (NCase n Nom)
|
|
||||||
} ;
|
|
||||||
|
|
||||||
CompCN cn = {
|
|
||||||
s = \\agr =>
|
|
||||||
let
|
|
||||||
n = complNumAgr agr ;
|
|
||||||
in cn.s ! (NCase n Nom)
|
|
||||||
} ;
|
|
||||||
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
|
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
|
||||||
CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ lin
|
|||||||
{s = \\agr => infVPAnt ant.a (NPCase Nom) pol.p agr vp InfDa } ;
|
{s = \\agr => infVPAnt ant.a (NPCase Nom) pol.p agr vp InfDa } ;
|
||||||
|
|
||||||
-- TODO: revisit pronouns? Looks a bit overly complicated. /IL
|
-- TODO: revisit pronouns? Looks a bit overly complicated. /IL
|
||||||
who_RP = { s = \\n,c => MorphoEst.kesPron ! n ! npform2case n c ;
|
who_RP = { s = \\n,c => MorphoEst.kesPron ! NCase n (npform2case n c) ;
|
||||||
a = RNoAg } ;
|
a = RNoAg } ;
|
||||||
|
|
||||||
that_RP = which_RP ;
|
that_RP = which_RP ;
|
||||||
|
|||||||
Reference in New Issue
Block a user