forked from GitHub/gf-rgl
Merge branch 'master' of github.com:GrammaticalFramework/gf-rgl
This commit is contained in:
@@ -27,6 +27,7 @@ Jpn,Japanese,japanese,,,,,,,,y
|
|||||||
Kor,Korean,korean,,,n,y,y,y,n,n
|
Kor,Korean,korean,,,n,y,y,y,n,n
|
||||||
Lat,Latin,latin,,,,,y,y,n,y
|
Lat,Latin,latin,,,,,y,y,n,y
|
||||||
Lav,Latvian,latvian,,,,,,,y,y
|
Lav,Latvian,latvian,,,,,,,y,y
|
||||||
|
May,Malay,malay,,,y,,,,n,y
|
||||||
Mlt,Maltese,maltese,,,,,,,,y
|
Mlt,Maltese,maltese,,,,,,,,y
|
||||||
Mon,Mongolian,mongolian,,,,,,n,,y
|
Mon,Mongolian,mongolian,,,,,,n,,y
|
||||||
Nep,Nepali,nepali,,,,,,n,,y
|
Nep,Nepali,nepali,,,,,,n,,y
|
||||||
|
|||||||
|
268
src/Lang.labels
268
src/Lang.labels
@@ -1,157 +1,157 @@
|
|||||||
PredVP nsubj head
|
PredVP nsubj head
|
||||||
PredVPS nsubj head
|
PredVPS nsubj head
|
||||||
DirectComplVQ empty nsubj head ccomp -- Temp argument can only be empty in English
|
DirectComplVQ empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||||
DirectComplVS empty nsubj head ccomp -- Temp argument can only be empty in English
|
DirectComplVS empty nsubj head ccomp -- Temp argument can only be empty in English
|
||||||
SlashVP nsubj head
|
SlashVP nsubj head
|
||||||
SlashVS nsubj head ccomp
|
SlashVS nsubj head ccomp
|
||||||
FocusObjS nsubj head -- again might be wrong; more correct to call it dobj
|
FocusObjS nsubj head -- again might be wrong; more correct to call it obj
|
||||||
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
|
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
|
||||||
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
|
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
|
||||||
QuestQVP nsubj head
|
QuestQVP nsubj head
|
||||||
QuestSlash obj head
|
QuestSlash obj head
|
||||||
QuestVP nsubj head
|
QuestVP nsubj head
|
||||||
IdetCN det head
|
IdetCN det head
|
||||||
|
|
||||||
PredSCVP csubj head
|
PredSCVP csubj head
|
||||||
|
|
||||||
ComplSlash head obj
|
ComplSlash head obj
|
||||||
ComplSlashIP head obj
|
ComplSlashIP head obj
|
||||||
Slash3V3 head obj
|
Slash3V3 head obj
|
||||||
SlashV2VNP head obj xcomp
|
SlashV2VNP head obj xcomp
|
||||||
PastPartAgentAP head obj
|
PastPartAgentAP head obj
|
||||||
AdvQVP head obj
|
AdvQVP head obj
|
||||||
|
|
||||||
Slash2V3 head iobj
|
Slash2V3 head iobj
|
||||||
|
|
||||||
ComplVS head ccomp
|
ComplVS head ccomp
|
||||||
ComplVQ head ccomp
|
ComplVQ head ccomp
|
||||||
SlashV2S head ccomp
|
SlashV2S head ccomp
|
||||||
SlashV2Q head ccomp
|
SlashV2Q head ccomp
|
||||||
CleftAdv head advcl -- not sure
|
CleftAdv head advcl -- not sure
|
||||||
|
|
||||||
ComplVA head xcomp
|
ComplVA head xcomp
|
||||||
ComplVV head xcomp
|
ComplVV head xcomp
|
||||||
SlashVV head acl
|
SlashVV head acl
|
||||||
SlashV2A head xcomp
|
SlashV2A head xcomp
|
||||||
SlashV2V head xcomp
|
SlashV2V head xcomp
|
||||||
|
|
||||||
AdvNP head nmod -- not sure
|
AdvNP head nmod -- not sure
|
||||||
ExtAdvNP head nmod -- not sure
|
ExtAdvNP head nmod -- not sure
|
||||||
PassAgentVPSlash head nmod -- not sure
|
PassAgentVPSlash head nmod -- not sure
|
||||||
CleftNP head acl -- this cannot be nmod, not with type RS
|
CleftNP head acl -- this cannot be nmod, not with type RS
|
||||||
|
|
||||||
SSubjS head mark advcl
|
SSubjS head mark advcl
|
||||||
RelS head advcl
|
RelS head advcl
|
||||||
|
|
||||||
AdNum advmod head
|
AdNum advmod head
|
||||||
AdAP advmod head
|
AdAP advmod head
|
||||||
AdvAP head advmod
|
AdvAP head advmod
|
||||||
ComparAdvAdj advmod amod head
|
ComparAdvAdj advmod amod head
|
||||||
ComparAdvAdjS advmod amod head
|
ComparAdvAdjS advmod amod head
|
||||||
AdvIAdv advmod head
|
AdvIAdv advmod head
|
||||||
AdVVP advmod head
|
AdVVP advmod head
|
||||||
AdvVP head advmod
|
AdvVP head advmod
|
||||||
ExtAdvVP head advmod
|
ExtAdvVP head advmod
|
||||||
AddAdvQVP head advmod
|
AddAdvQVP head advmod
|
||||||
AdVVPSlash advmod head
|
AdVVPSlash advmod head
|
||||||
AdvVPSlash head advmod
|
AdvVPSlash head advmod
|
||||||
AdvSlash head advmod
|
AdvSlash head advmod
|
||||||
ExistIPAdv head advmod
|
ExistIPAdv head advmod
|
||||||
AdvS advmod head
|
AdvS advmod head
|
||||||
ExtAdvS advmod head
|
ExtAdvS advmod head
|
||||||
|
|
||||||
SubjS mark head
|
SubjS mark head
|
||||||
RelVP mark head
|
RelVP mark head
|
||||||
RelSlash mark head
|
RelSlash mark head
|
||||||
|
|
||||||
ComplN2 head nmod
|
ComplN2 head nmod
|
||||||
ComplN3 nmod head
|
ComplN3 nmod head
|
||||||
AdvCN head nmod
|
AdvCN head nmod
|
||||||
PossNP head nmod
|
PossNP head nmod
|
||||||
PartNP head nmod
|
PartNP head nmod
|
||||||
ExistNPAdv head nmod
|
ExistNPAdv head nmod
|
||||||
|
|
||||||
OrdNumeralSuperl nummod head -- quite wrong; cannot find relevant details in the documentation; but most probably head lies outside the score of this function
|
OrdNumeralSuperl nummod head -- quite wrong; cannot find relevant details in the documentation; but most probably head lies outside the score of this function
|
||||||
DetQuant head nummod -- quite wrong; I think the head lies outside the scope of the function
|
DetQuant head nummod -- quite wrong; I think the head lies outside the scope of the function
|
||||||
CNNumNP head nummod
|
CNNumNP head nummod
|
||||||
|
|
||||||
ApposCN head appos
|
ApposCN head appos
|
||||||
ApposNP head appos
|
ApposNP head appos
|
||||||
|
|
||||||
RelNP head acl
|
RelNP head acl
|
||||||
RelCN head acl
|
RelCN head acl
|
||||||
SentCN head acl
|
SentCN head acl
|
||||||
SentAP head acl
|
SentAP head acl
|
||||||
|
|
||||||
DetQuantOrd head nummod amod -- quite wrong; again for same reason as DetQuant function
|
DetQuantOrd head nummod amod -- quite wrong; again for same reason as DetQuant function
|
||||||
DetCN det head
|
DetCN det head
|
||||||
IdetCN det head
|
IdetCN det head
|
||||||
IdetQuant head nummod
|
IdetQuant head nummod
|
||||||
CountNP det head
|
CountNP det head
|
||||||
PredetNP det head
|
PredetNP det head
|
||||||
PPartNP head amod -- only in core RGL
|
PPartNP head amod -- only in core RGL
|
||||||
|
|
||||||
AdjCN amod head
|
AdjCN amod head
|
||||||
AdjDAP head amod
|
AdjDAP head amod
|
||||||
CAdvAP case amod head
|
CAdvAP case amod head
|
||||||
ComparA amod head
|
ComparA amod head
|
||||||
ComplA2 amod head
|
ComplA2 amod head
|
||||||
CompoundAP head amod
|
CompoundAP head amod
|
||||||
AdAdV amod head
|
AdAdV amod head
|
||||||
AdAdv amod head
|
AdAdv amod head
|
||||||
|
|
||||||
CompoundN compound head
|
CompoundN compound head
|
||||||
|
|
||||||
IIDig head goeswith
|
IIDig head goeswith
|
||||||
|
|
||||||
PrepNP case head
|
PrepNP case head
|
||||||
PrepIP case head
|
PrepIP case head
|
||||||
SlashPrep head case
|
SlashPrep head case
|
||||||
VPSlashPrep head case
|
VPSlashPrep head case
|
||||||
|
|
||||||
UttImpPl empty head
|
UttImpPl empty head
|
||||||
UttImpPol empty head
|
UttImpPol empty head
|
||||||
UttImpSg empty head
|
UttImpSg empty head
|
||||||
|
|
||||||
MkVPS empty empty head
|
MkVPS empty empty head
|
||||||
|
|
||||||
UseCl empty empty head
|
UseCl empty empty head
|
||||||
UseQCl empty empty head
|
UseQCl empty empty head
|
||||||
UseRCl empty empty head
|
UseRCl empty empty head
|
||||||
UseSlash empty empty head
|
UseSlash empty empty head
|
||||||
UseVC empty empty head
|
UseVC empty empty head
|
||||||
|
|
||||||
BaseAP head conj
|
BaseAP head conj
|
||||||
BaseAdV head conj
|
BaseAdV head conj
|
||||||
BaseAdv head conj
|
BaseAdv head conj
|
||||||
BaseCN head conj
|
BaseCN head conj
|
||||||
BaseDAP head conj
|
BaseDAP head conj
|
||||||
BaseIAdv head conj
|
BaseIAdv head conj
|
||||||
BaseNP head conj
|
BaseNP head conj
|
||||||
BaseRS head conj
|
BaseRS head conj
|
||||||
BaseS head conj
|
BaseS head conj
|
||||||
ConsAP head conj
|
ConsAP head conj
|
||||||
ConsAdV head conj
|
ConsAdV head conj
|
||||||
ConsAdv head conj
|
ConsAdv head conj
|
||||||
ConsCN head conj
|
ConsCN head conj
|
||||||
ConsDAP head conj
|
ConsDAP head conj
|
||||||
ConsIAdv head conj
|
ConsIAdv head conj
|
||||||
ConsNP head conj
|
ConsNP head conj
|
||||||
ConsRS head conj
|
ConsRS head conj
|
||||||
ConsS head conj
|
ConsS head conj
|
||||||
ConjAP cc head
|
ConjAP cc head
|
||||||
ConjAdV cc head
|
ConjAdV cc head
|
||||||
ConjAdv cc head
|
ConjAdv cc head
|
||||||
ConjCN cc head
|
ConjCN cc head
|
||||||
ConjDet cc head
|
ConjDet cc head
|
||||||
ConjIAdv cc head
|
ConjIAdv cc head
|
||||||
ConjNP cc head
|
ConjNP cc head
|
||||||
ConjRS cc head
|
ConjRS cc head
|
||||||
ConjS cc head
|
ConjS cc head
|
||||||
PhrUtt cc head discourse
|
PhrUtt cc head discourse
|
||||||
|
|
||||||
PlusChunk head dep
|
PlusChunk head dep
|
||||||
TTAnt empty empty head
|
TTAnt empty empty head
|
||||||
|
|
||||||
TExclMark head dep -- punctuation in the middle in these three
|
TExclMark head dep -- punctuation in the middle in these three
|
||||||
TFullStop head dep
|
TFullStop head dep
|
||||||
@@ -159,13 +159,13 @@ TQuestMark head dep
|
|||||||
|
|
||||||
ComplV2 head obj -- shortcuts in App
|
ComplV2 head obj -- shortcuts in App
|
||||||
ComplV2V head obj xcomp
|
ComplV2V head obj xcomp
|
||||||
ComplV3 head iobj obj ---- could be dobj dobj
|
ComplV3 head iobj obj ---- could be obj obj
|
||||||
PassAgentV2 head ncomp -- not sure
|
PassAgentV2 head ncomp -- not sure
|
||||||
RelV2 mark nsubj head
|
RelV2 mark nsubj head
|
||||||
QuestV2 obj nsubj head
|
QuestV2 obj nsubj head
|
||||||
|
|
||||||
ModCN amod head -- in ResourceDemo
|
ModCN amod head -- in ResourceDemo
|
||||||
RSubjS mark advcl head
|
RSubjS mark advcl head
|
||||||
SlashV2 nsubj head
|
SlashV2 nsubj head
|
||||||
RAdvCN head case nmod
|
RAdvCN head case nmod
|
||||||
SubjCl head mark advcl
|
SubjCl head mark advcl
|
||||||
@@ -181,7 +181,7 @@ AdV ADV
|
|||||||
Adv ADV
|
Adv ADV
|
||||||
CAdv ADV
|
CAdv ADV
|
||||||
Card NUM
|
Card NUM
|
||||||
Conj CONJ
|
Conj CCONJ
|
||||||
Det DET
|
Det DET
|
||||||
Digits NUM
|
Digits NUM
|
||||||
IAdv ADV
|
IAdv ADV
|
||||||
@@ -194,7 +194,7 @@ N2 NOUN
|
|||||||
N3 NOUN
|
N3 NOUN
|
||||||
Numeral NUM
|
Numeral NUM
|
||||||
Ord NUM
|
Ord NUM
|
||||||
PConj CONJ
|
PConj CCONJ
|
||||||
PN PROPN
|
PN PROPN
|
||||||
Predet DET
|
Predet DET
|
||||||
Prep ADP
|
Prep ADP
|
||||||
@@ -214,7 +214,3 @@ VA VERB
|
|||||||
VQ VERB
|
VQ VERB
|
||||||
VS VERB
|
VS VERB
|
||||||
VV VERB
|
VV VERB
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
--# -path=.:../abstract:../common:../api:../prelude
|
--# -path=.:../abstract:../common:../api:../prelude
|
||||||
|
|
||||||
concrete AllAra of AllAraAbs = LangAra ;
|
concrete AllAra of AllAraAbs = LangAra, ExtendAra ;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
--# -path=.:../abstract:../common:prelude
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
abstract AllAraAbs = Lang ;
|
abstract AllAraAbs = Lang, Extend ;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ concrete ExtendAra of Extend =
|
|||||||
EmptyRelSlash, PredAPVP,
|
EmptyRelSlash, PredAPVP,
|
||||||
ComplDirectVS, ComplDirectVQ, -- because of Utt
|
ComplDirectVS, ComplDirectVQ, -- because of Utt
|
||||||
VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS,
|
VPS, MkVPS, PredVPS, BaseVPS, ConsVPS, ConjVPS,
|
||||||
EmbedSSlash, AdjAsNP
|
EmbedSSlash, AdjAsNP, GerundNP
|
||||||
]
|
]
|
||||||
with (Grammar=GrammarAra)
|
with (Grammar=GrammarAra)
|
||||||
** open
|
** open
|
||||||
@@ -44,7 +44,7 @@ lin
|
|||||||
DetNPFem det = emptyNP ** {s = det.s ! NoHum ! Fem} ;
|
DetNPFem det = emptyNP ** {s = det.s ! NoHum ! Fem} ;
|
||||||
|
|
||||||
-- : AP -> NP
|
-- : AP -> NP
|
||||||
AdjAsNP ap =
|
AdjAsNP ap =
|
||||||
let adjAsN : Noun = {
|
let adjAsN : Noun = {
|
||||||
s = ap.s ! NoHum ! Masc ;
|
s = ap.s ! NoHum ! Masc ;
|
||||||
s2 = emptyNTable ;
|
s2 = emptyNTable ;
|
||||||
@@ -59,6 +59,11 @@ lin
|
|||||||
-- : SSlash -> SC
|
-- : SSlash -> SC
|
||||||
EmbedSSlash = Grammar.EmbedS ;
|
EmbedSSlash = Grammar.EmbedS ;
|
||||||
|
|
||||||
|
-- : VP -> NP
|
||||||
|
GerundNP vp = emptyNP ** {
|
||||||
|
s = \\_ => uttVP VPGer vp ! Masc ; -- NB. NP should inflect in case, but there are no cases for masdar in the inflection table of VP. If desired, can add here with BIND. /IL
|
||||||
|
} ; -- The Gender param here doesn't make a difference, because the VPGer in VP's inflection table doesn't have gender to start with. So we could equally well choose Fem too.
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
VPS = {s : PerGenNum => Str} ; -- finite VP's with tense and polarity
|
VPS = {s : PerGenNum => Str} ; -- finite VP's with tense and polarity
|
||||||
[VPS] = {s1,s2 : PerGenNum => Str} ;
|
[VPS] = {s1,s2 : PerGenNum => Str} ;
|
||||||
|
|||||||
@@ -4,26 +4,58 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
PositA a = a ** {hasAdA = False} ;
|
PositA a = a ** {hasAdA = False} ;
|
||||||
|
|
||||||
--ComparA a np = complexAP (a.s ++ than_s ++ np.s) ;
|
ComparA a np = a ** {
|
||||||
ComparA a np = complexAP (than_s ++ np.s ++ a.s) ;
|
s = table {_=> than_s ++ np.s ++ a.s!Attr};
|
||||||
|
hasAdA = False
|
||||||
|
|
||||||
UseComparA a = complexAP (geng_s ++ a.s) ;
|
};
|
||||||
|
|
||||||
AdjOrd ord = complexAP ord.s ;
|
UseComparA a = a ** {
|
||||||
|
s = table { _=> geng_s ++ a.s!Attr};
|
||||||
|
hasAdA = False
|
||||||
|
};
|
||||||
|
|
||||||
-- CAdvAP ad ap np = complexAP (ap.s ++ ad.s ++ ad.p ++ np.s) ;
|
AdjOrd ord = ord ** {
|
||||||
CAdvAP ad ap np = complexAP (ad.s++ np.s++ad.p++ap.s ) ; --modified by ChenPeng 11.24
|
s = table {
|
||||||
|
adjPlace => ord.s
|
||||||
|
-- Attr => ord.s; --"first is he" ;
|
||||||
|
-- Pred => ord.s --"he is first"
|
||||||
|
} ;
|
||||||
|
hasAdA = False;
|
||||||
|
monoSyl = True -- to do and figure out in relation to Ord = {s : Str}
|
||||||
|
};
|
||||||
|
|
||||||
ComplA2 a np = complexAP (appPrep a.c2 np.s ++ a.s) ;
|
CAdvAP ad ap np = ap ** {
|
||||||
|
s = table {adjPlace => ad.s ++ np.s ++ ad.p ++ ap.s!adjPlace}
|
||||||
|
};
|
||||||
|
|
||||||
ReflA2 a = complexAP (a.s ++ appPrep a.c2 reflPron) ;
|
ComplA2 a np = a ** {
|
||||||
|
s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace};
|
||||||
|
hasAdA = False
|
||||||
|
};
|
||||||
|
|
||||||
SentAP ap sc = complexAP (ap.s ++ sc.s) ;
|
|
||||||
|
|
||||||
AdAP ada ap = {s = ada.s ++ ap.s ; monoSyl = False ; hasAdA = True} ;
|
ReflA2 a = a ** {
|
||||||
|
s = table {adjPlace => a.s!adjPlace ++ appPrep a.c2 reflPron};
|
||||||
|
hasAdA = False
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
SentAP ap sc = ap ** {
|
||||||
|
s = table { adjPlace => ap.s ! adjPlace ++ sc.s }
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- AdAP ada ap = {s = ada.s ++ ap.s ; monoSyl = False ; hasAdA = True} ;
|
||||||
|
AdAP ada ap = ap ** {
|
||||||
|
s = table { adjPlace => ada.s ++ ap.s ! adjPlace };
|
||||||
|
monoSyl = False;
|
||||||
|
hasAdA = True
|
||||||
|
};
|
||||||
|
|
||||||
UseA2 a = a ** {hasAdA = False} ;
|
UseA2 a = a ** {hasAdA = False} ;
|
||||||
|
|
||||||
AdvAP ap adv = complexAP (adv.s ++ ap.s) ; ----
|
AdvAP ap adv = ap ** {
|
||||||
|
s = table { adjPlace => adv.s ++ ap.s ! adjPlace }
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
concrete AdverbChi of Adverb = CatChi **
|
concrete AdverbChi of Adverb = CatChi **
|
||||||
open ResChi, Prelude in {
|
open ResChi, Prelude in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
PositAdvAdj a = {s = a.s ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs?
|
PositAdvAdj a = {s = a.s!Attr ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs?
|
||||||
|
|
||||||
PrepNP prep np = ss (appPrep prep np.s) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- 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 ; hasDe = False} ;
|
ComparAdvAdj cadv a np = ss (a.s!Attr ++ 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 ; hasDe = False} ;
|
ComparAdvAdjS cadv a s = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ linS s) ** {advType = ATManner ; hasDe = False} ;
|
||||||
|
|
||||||
AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ;
|
AdAdv ad adv = adv ** {s = ad.s ++ adv.s} ;
|
||||||
|
|
||||||
SubjS subj s = ss (subj.prePart ++ s.s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ;
|
SubjS subj s = ss (subj.prePart ++ linS s ++ subj.sufPart) ** {advType = ATTime ; hasDe = False} ;
|
||||||
|
|
||||||
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; -----
|
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner ; hasDe = False} ; -----
|
||||||
|
|
||||||
PositAdAAdj a = {s = a.s} ; ----
|
PositAdAAdj a = {s = a.s!Attr} ; ----
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
-- Tensed/Untensed
|
-- Tensed/Untensed
|
||||||
|
|
||||||
S = {s : Str} ;
|
S = Sentence ;
|
||||||
QS = {s : Bool => Str} ; -- True = direct question (with ma for sentential questions)
|
QS = {s : Bool => Str} ; -- True = direct question (with ma for sentential questions)
|
||||||
RS = {s : Str} ;
|
RS = {s : Str} ;
|
||||||
SSlash = {s : Str ; c2 : Preposition} ;
|
SSlash = {s : Str ; c2 : Preposition} ;
|
||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = Clause ; -- {s : Polarity => Aspect => Str ; np: Str ; vp: Polarity => Aspect => Str} ;
|
Cl = Clause ; -- {s : Polarity => Aspect => Str ; np: Str ; vp: Polarity => Aspect => Str} ;
|
||||||
|
|
||||||
ClSlash = Clause ** {c2 : Preposition} ;
|
ClSlash = Clause ** {c2 : Preposition} ;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
QCl = {s : Bool => Polarity => Aspect => Str} ; -- True = direct question
|
QCl = {s : Bool => Polarity => Aspect => Str} ; -- True = direct question
|
||||||
IP = {s : Str} ;
|
IP = {s : Str} ;
|
||||||
IComp = {s : Str} ;
|
IComp = {s : Str} ;
|
||||||
IDet = {s : Str ; detType : DetType} ;
|
IDet = {s : Str ; detType : DetType} ;
|
||||||
IQuant = {s : Str} ;
|
IQuant = {s : Str} ;
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = ResChi.VP ;
|
VP = ResChi.VP ;
|
||||||
Comp = ResChi.VP ;
|
Comp = ResChi.VP ;
|
||||||
VPSlash = ResChi.VP ** {c2 : Preposition ; isPre : Bool} ; -- whether the missing arg is before verb
|
VPSlash = ResChi.VP ** {c2 : Preposition ; isPre : Bool} ; -- whether the missing arg is before verb
|
||||||
|
|
||||||
@@ -59,13 +59,16 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
|
|
||||||
-- Structural
|
-- Structural
|
||||||
|
|
||||||
Conj = {s : ConjForm => {s1,s2 : Str}} ;
|
Conj = {
|
||||||
|
s : ConjForm => {s1,s2 : Str} ; -- different form whether it's used for S, A, N, ...
|
||||||
|
conjType : ConjType -- different placement whether it's and,or,... or if-then
|
||||||
|
} ;
|
||||||
Subj = {prePart : Str ; sufPart : Str} ;
|
Subj = {prePart : Str ; sufPart : Str} ;
|
||||||
Prep = Preposition ;
|
Prep = Preposition ;
|
||||||
|
|
||||||
-- Open lexical classes, e.g. Lexicon
|
-- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
V, VS, VQ, VA = Verb ;
|
V, VS, VQ, VA = Verb ;
|
||||||
V2, V2Q, V2S = Verb ** {c2 : Preposition ; hasPrep : Bool ; part : Str} ;
|
V2, V2Q, V2S = Verb ** {c2 : Preposition ; hasPrep : Bool ; part : Str} ;
|
||||||
V3, V2A, V2V = Verb ** {c2, c3 : Preposition ; hasPrep : Bool ; part : Str} ;
|
V3, V2A, V2V = Verb ** {c2, c3 : Preposition ; hasPrep : Bool ; part : Str} ;
|
||||||
VV = Verb ;
|
VV = Verb ;
|
||||||
@@ -84,4 +87,6 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
|
|||||||
Tense = {s : Str ; t : Aspect} ;
|
Tense = {s : Str ; t : Aspect} ;
|
||||||
Ant = {s : Str ; t : Aspect} ;
|
Ant = {s : Str ; t : Aspect} ;
|
||||||
|
|
||||||
|
linref
|
||||||
|
S = linS ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,33 +2,47 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
ConjS c = conjunctDistrSS (c.s ! CSent) ;
|
ConjS c ss =
|
||||||
|
let conj = c.s ! CSent
|
||||||
|
in case c.conjType of {
|
||||||
|
Jiu => {preJiu = conj.s1 ++ ss.s1 ++ comma ++ ss.preJiu ;
|
||||||
|
postJiu = conj.s2 ++ ss.postJiu} ;
|
||||||
|
NotJiu => {preJiu = conj.s1 ++ ss.s1 ++ conj.s2 ++ ss.preJiu ;
|
||||||
|
postJiu = ss.postJiu}
|
||||||
|
} ;
|
||||||
ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ??
|
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 = notB as.monoSyl ; hasAdA = True} ; ---- add de iff as doesn't
|
ConjAP c as = conjunctDistrTable AdjPlace (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} ;
|
||||||
|
|
||||||
-- These fun's are generated from the list cat's.
|
-- These fun's are generated from the list cat's.
|
||||||
|
|
||||||
BaseS = twoSS ;
|
BaseS s t = t ** {
|
||||||
ConsS = consrSS duncomma ;
|
s1 = linS s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConsS s ss = -- here we do the same thing actually, the crucial split has happened in BaseS
|
||||||
|
ss ** {s1 = linS s ++ comma ++ ss.s1};
|
||||||
|
|
||||||
|
|
||||||
BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ??
|
BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ??
|
||||||
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ??
|
||||||
BaseNP = twoSS ;
|
BaseNP = twoSS ;
|
||||||
ConsNP = consrSS duncomma ;
|
ConsNP = consrSS duncomma ;
|
||||||
BaseAP x y = twoSS x y ** {monoSyl = y.monoSyl} ;
|
BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ;
|
||||||
ConsAP x xs = consrSS duncomma x xs ** {monoSyl = xs.monoSyl} ;
|
ConsAP x xs = consrTable AdjPlace 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?
|
||||||
ConsCN x xs = consrSS duncomma x xs ** {c = x.c} ;
|
ConsCN x xs = consrSS duncomma x xs ** {c = x.c} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
--[S] = ConjType => {s1,s2 : Str} ;
|
||||||
|
[S] = {s1,preJiu,postJiu : Str} ;
|
||||||
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
[Adv] = {s1,s2 : Str ; advType : AdvType ; hasDe : Bool} ;
|
||||||
[NP] = {s1,s2 : Str} ;
|
[NP] = {s1,s2 : Str} ;
|
||||||
[AP] = {s1,s2 : Str ; monoSyl : Bool} ;
|
[AP] = {s1,s2 : AdjPlace => Str ; monoSyl : Bool} ;
|
||||||
[RS] = {s1,s2 : Str} ;
|
[RS] = {s1,s2 : Str} ;
|
||||||
[CN] = {s1,s2 : Str ; c : Str} ;
|
[CN] = {s1,s2 : Str ; c : Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
concrete DocumentationChi of Documentation = CatChi ** open
|
concrete DocumentationChi of Documentation = CatChi ** open
|
||||||
ResChi,
|
ResChi,
|
||||||
HTML
|
HTML
|
||||||
in {
|
in {
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
@@ -19,9 +19,9 @@ lin
|
|||||||
InflectionA, InflectionA2 = \adj -> {
|
InflectionA, InflectionA2 = \adj -> {
|
||||||
t = "a" ;
|
t = "a" ;
|
||||||
s1 = heading1 "Adjective" ;
|
s1 = heading1 "Adjective" ;
|
||||||
s2 = adj.s
|
s2 = adj.s!Attr
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||||
t = "adv" ;
|
t = "adv" ;
|
||||||
s1 = heading1 "Adverb" ;
|
s1 = heading1 "Adverb" ;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
concrete ExtraChi of ExtraChiAbs = CatChi **
|
concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||||
open ResChi, Coordination, (S = StructuralChi), Prelude in {
|
open ResChi, Coordination, (S = StructuralChi), Prelude in {
|
||||||
|
|
||||||
flags coding = utf8 ;
|
flags coding = utf8 ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
VPS = {s : Str} ;
|
VPS = {s : Str} ;
|
||||||
[VPS] = {s1,s2 : Str} ;
|
[VPS] = {s1,s2 : Str} ;
|
||||||
VPI = {s : Str} ; --- ???
|
VPI = {s : Str} ; --- ???
|
||||||
@@ -18,7 +18,7 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
|||||||
BaseVPS = twoSS ;
|
BaseVPS = twoSS ;
|
||||||
ConsVPS = consrSS duncomma ;
|
ConsVPS = consrSS duncomma ;
|
||||||
|
|
||||||
PredVPS np vps = {s = np.s ++ vps.s} ;
|
PredVPS np vps = {preJiu = np.s ; postJiu = vps.s} ;
|
||||||
|
|
||||||
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
||||||
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
||||||
@@ -37,19 +37,20 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
|||||||
Aspect = {s : Str ; a : ResChi.Aspect} ;
|
Aspect = {s : Str ; a : ResChi.Aspect} ;
|
||||||
lin
|
lin
|
||||||
CompBareAP ap = case ap.hasAdA of {
|
CompBareAP ap = case ap.hasAdA of {
|
||||||
True => insertObj (mkNP ap.s) (predV nocopula []) ;
|
True => insertObj (mkNP (ap.s!Pred)) (predV nocopula []) ;
|
||||||
False => insertObj (mkNP ap.s) (predV hen_copula [])
|
False => insertObj (mkNP (ap.s!Pred)) (predV hen_copula [])
|
||||||
} ;
|
} ;
|
||||||
QuestRepV cl = {
|
QuestRepV cl = {
|
||||||
s = \\_,p,a => ---- also for indirect questions?
|
s = \\_,p,a => ---- also for indirect questions?
|
||||||
let
|
let
|
||||||
v = cl.vp.verb ;
|
v = cl.vp.verb ;
|
||||||
verb = case a of {
|
verb = case a of {
|
||||||
APlain => v.s ++ v.neg ++ v.sn ;
|
APlain => v.s ++ v.neg ++ v.sn ;
|
||||||
APerf => v.s ++ "不" ++ v.sn ++ v.pp ;
|
APerf => v.s ++ "不" ++ v.sn ++ v.pp ;
|
||||||
ADurStat => v.s ++ "不" ++ v.sn ;
|
ADurStat => v.s ++ "不" ++ v.sn ;
|
||||||
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep
|
AExper => v.s ++ v.neg ++ v.sn ++ v.ep ;
|
||||||
|
AFut => jiu_s ++ v.s ++ v.neg ++ v.sn ++ v.ep -- TODO check placement of jiang
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl
|
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl
|
||||||
@@ -57,4 +58,4 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
|||||||
|
|
||||||
TopicAdvVP vp adv = insertTopic adv vp ;
|
TopicAdvVP vp adv = insertTopic adv vp ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in {
|
|||||||
---- it is John who did it
|
---- it is John who did it
|
||||||
CleftNP np rs = mkClause rs.s copula np.s ; -- did it + de + is I
|
CleftNP np rs = mkClause rs.s copula np.s ; -- did it + de + is I
|
||||||
|
|
||||||
CleftAdv ad s = mkClause (s.s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
CleftAdv ad s = mkClause (linS s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here
|
||||||
|
|
||||||
ExistNP np = mkClause [] (regVerb you_s) np.s ; ---- infl of you
|
ExistNP np = mkClause [] (regVerb you_s) np.s ; ---- infl of you
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
concrete LexiconChi of Lexicon = CatChi **
|
concrete LexiconChi of Lexicon = CatChi **
|
||||||
open ParadigmsChi, ResChi, Prelude in {
|
open ParadigmsChi, ResChi, Prelude in {
|
||||||
|
|
||||||
flags
|
flags
|
||||||
coding = utf8 ;
|
coding = utf8 ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
@@ -14,13 +14,13 @@ lin
|
|||||||
tree_N = mkN "树" "棵"; -- "shu" "ke"
|
tree_N = mkN "树" "棵"; -- "shu" "ke"
|
||||||
big_A = mkA "大" ; -- "da"
|
big_A = mkA "大" ; -- "da"
|
||||||
small_A = mkA "小" ; -- "xiao"
|
small_A = mkA "小" ; -- "xiao"
|
||||||
green_A = mkA "绿" ; -- "lv"
|
green_A = colourA "绿" ; -- "lv"
|
||||||
walk_V = mkV "走" ; -- "zou"
|
walk_V = mkV "走" ; -- "zou"
|
||||||
sleep_V = mkV "睡觉" ; -- "shui"
|
sleep_V = mkV "睡觉" ; -- "shui"
|
||||||
love_V2 = mkV2 "爱" ; -- "ai"
|
love_V2 = mkV2 "爱" ; -- "ai"
|
||||||
watch_V2 = mkV2 "看" ; -- "kan"
|
watch_V2 = mkV2 "看" ; -- "kan"
|
||||||
know_VS = mkV "知道" ; -- "zhidao"
|
know_VS = mkV "知道" ; -- "zhidao"
|
||||||
wonder_VQ = mkV "好奇" ; -- "haoqi"
|
wonder_VQ = mkV "好奇" ; -- "haoqi"
|
||||||
john_PN = mkPN "约翰" ; -- "yuehan"
|
john_PN = mkPN "约翰" ; -- "yuehan"
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ horn_N = mkN "角" "根";
|
|||||||
tail_N = mkN "尾巴" "条"; -- [mark] "尾" -> "尾巴" , "尾" is often treated as morpheme, or if stands alone, it is a classifier itself
|
tail_N = mkN "尾巴" "条"; -- [mark] "尾" -> "尾巴" , "尾" is often treated as morpheme, or if stands alone, it is a classifier itself
|
||||||
feather_N = mkN "羽毛" "根";
|
feather_N = mkN "羽毛" "根";
|
||||||
hair_N = mkN "头发" "根"; -- [mark] several classifiers , "根"(single hair), "把"(several hairs)
|
hair_N = mkN "头发" "根"; -- [mark] several classifiers , "根"(single hair), "把"(several hairs)
|
||||||
head_N = mkN "头" "颗";
|
head_N = mkN "头" "颗";
|
||||||
ear_N = mkN "耳朵" "只";
|
ear_N = mkN "耳朵" "只";
|
||||||
eye_N = mkN "眼睛" "只";
|
eye_N = mkN "眼睛" "只";
|
||||||
nose_N = mkN "鼻子" ;
|
nose_N = mkN "鼻子" ;
|
||||||
@@ -79,7 +79,7 @@ wing_N = mkN "翅膀" "只"; -- [mark] "翼" -> "翅膀", "翅膀" is the common
|
|||||||
belly_N = mkN "肚子" ;
|
belly_N = mkN "肚子" ;
|
||||||
guts_N = mkN "肠子" "根";
|
guts_N = mkN "肠子" "根";
|
||||||
neck_N = mkN "脖子" ;
|
neck_N = mkN "脖子" ;
|
||||||
back_N = mkN "背" ;
|
back_N = mkN "背" ;
|
||||||
breast_N = mkN "胸" ;
|
breast_N = mkN "胸" ;
|
||||||
heart_N = mkN "心脏" "颗";
|
heart_N = mkN "心脏" "颗";
|
||||||
liver_N = mkN "肝" ;
|
liver_N = mkN "肝" ;
|
||||||
@@ -101,7 +101,7 @@ live_V = mkV "活" ;
|
|||||||
die_V = mkV "死" ;
|
die_V = mkV "死" ;
|
||||||
kill_V2 = mkV2 "杀" ;
|
kill_V2 = mkV2 "杀" ;
|
||||||
fight_V2 = mkV2 "打架" ; -- [mark] "吵架" -> "打架", "吵架" = quarrel, argue
|
fight_V2 = mkV2 "打架" ; -- [mark] "吵架" -> "打架", "吵架" = quarrel, argue
|
||||||
hunt_V2 = mkV2 "打猎" ; -- [mark] "打猎" is iv, can't think of proper translation in v2 form for hunt
|
hunt_V2 = mkV2 "打猎" ; -- [mark] "打猎" is iv, can't think of proper translation in v2 form for hunt
|
||||||
hit_V2 = mkV2 "打" ;
|
hit_V2 = mkV2 "打" ;
|
||||||
cut_V2 = mkV2 "割" ;
|
cut_V2 = mkV2 "割" ;
|
||||||
split_V2 = mkV2 "劈开" ;
|
split_V2 = mkV2 "劈开" ;
|
||||||
@@ -159,10 +159,10 @@ ashes_N = mkN "灰" [];
|
|||||||
burn_V = mkV "烧" ;
|
burn_V = mkV "烧" ;
|
||||||
road_N = mkN "路" "条";
|
road_N = mkN "路" "条";
|
||||||
mountain_N = mkN "山" "座";
|
mountain_N = mkN "山" "座";
|
||||||
red_A = mkA "红" ;
|
red_A = colourA "红" ;
|
||||||
yellow_A = mkA "黄" ;
|
yellow_A = colourA "黄" ;
|
||||||
white_A = mkA "白" ;
|
white_A = colourA "白" ;
|
||||||
black_A = mkA "黑" ;
|
black_A = colourA "黑" ;
|
||||||
night_N = mkN "夜晚" ; -- [mark] "夜晚" 's classifier is "个"
|
night_N = mkN "夜晚" ; -- [mark] "夜晚" 's classifier is "个"
|
||||||
day_N = mkN "白天" []; -- [mark] "白天" -> "天", "天" itself is classifier
|
day_N = mkN "白天" []; -- [mark] "白天" -> "天", "天" itself is classifier
|
||||||
year_N = mkN "年" [] ; -- [mark] "年" itself is classifier
|
year_N = mkN "年" [] ; -- [mark] "年" itself is classifier
|
||||||
@@ -343,7 +343,7 @@ shirt_N = mkN "衬衫" "件" ;
|
|||||||
silver_N = mkN "银子" "块"; -- [mark] "银" --> "银子"
|
silver_N = mkN "银子" "块"; -- [mark] "银" --> "银子"
|
||||||
sister_N = mkN "妹妹" ;
|
sister_N = mkN "妹妹" ;
|
||||||
sock_N = mkN "袜子" "只";
|
sock_N = mkN "袜子" "只";
|
||||||
steel_N = mkN "钢" "块";
|
steel_N = mkN "钢" "块";
|
||||||
stove_N = mkN "炉子" ;
|
stove_N = mkN "炉子" ;
|
||||||
village_N = mkN "村庄" "座";
|
village_N = mkN "村庄" "座";
|
||||||
war_N = mkN "战争" "场" ; -- [mark] rewritten
|
war_N = mkN "战争" "场" ; -- [mark] rewritten
|
||||||
@@ -353,29 +353,27 @@ wood_N = mkN "木头" "块" ; -- [mark] "木" --> "木头"
|
|||||||
-- from scratch, by Jolene
|
-- from scratch, by Jolene
|
||||||
|
|
||||||
lin
|
lin
|
||||||
alas_Interj = ssword "唉" ;
|
alas_Interj = ssword "唉" ;
|
||||||
beg_V2V = mkV2V (mkV "乞求") ; -- beg him to do something
|
beg_V2V = mkV2V (mkV "乞求") ; -- beg him to do something
|
||||||
break_V2 = mkV2 "打破" ;
|
break_V2 = mkV2 "打破" ;
|
||||||
broad_A = mkA "宽" ;
|
broad_A = mkA "宽" ;
|
||||||
brown_A = mkA "棕" ;
|
brown_A = colourA "棕" ;
|
||||||
clever_A = mkA "聪明" ;
|
clever_A = mkA "聪明" ;
|
||||||
close_V2 = mkV2 "关闭" ;
|
close_V2 = mkV2 "关闭" ;
|
||||||
easy_A2V = mkA2 "简单" ;
|
easy_A2V = mkA2 "简单" ;
|
||||||
empty_A = mkA "空" ;
|
empty_A = mkA "空" ;
|
||||||
fun_AV = mkA "有趣" ;
|
fun_AV = mkA "有趣" ;
|
||||||
hate_V2 = mkV2 "讨厌" ;
|
hate_V2 = mkV2 "讨厌" ;
|
||||||
married_A2 = mkA2 "结婚" ;
|
married_A2 = mkA2 "结婚" ;
|
||||||
paris_PN = mkPN "巴黎" ;
|
paris_PN = mkPN "巴黎" ;
|
||||||
probable_AS = mkA "可能" ;
|
probable_AS = mkA "可能" ;
|
||||||
ready_A = mkA "准备好" ; -- [mark] "准备好": 准备(v) + 好(adj,complement)
|
ready_A = mkA "准备好" ; -- [mark] "准备好": 准备(v) + 好(adj,complement)
|
||||||
seek_V2 = mkV2 "寻求" ;
|
seek_V2 = mkV2 "寻求" ;
|
||||||
stop_V = mkV "停止" ;
|
stop_V = mkV "停止" ;
|
||||||
stupid_A = mkA "笨" ;
|
stupid_A = mkA "笨" ;
|
||||||
switch8off_V2 = mkV2 "关" ;
|
switch8off_V2 = mkV2 "关" ;
|
||||||
switch8on_V2 = mkV2 "开" ;
|
switch8on_V2 = mkV2 "开" ;
|
||||||
ugly_A = mkA "丑" ;
|
ugly_A = mkA "丑" ;
|
||||||
uncertain_A = mkA "不确定" ; -- [mark] "不确定": 不("un-") + 确定("certain")
|
uncertain_A = mkA "不确定" ; -- [mark] "不确定": 不("un-") + 确定("certain")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
@@ -12,6 +12,7 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
DetNP det = {s = case det.detType of {
|
DetNP det = {s = case det.detType of {
|
||||||
DTFull Pl => det.s ++ xie_s ;
|
DTFull Pl => det.s ++ xie_s ;
|
||||||
|
DTPoss => det.s ;
|
||||||
_ => det.s ++ ge_s
|
_ => det.s ++ ge_s
|
||||||
} ;
|
} ;
|
||||||
} ; ----
|
} ; ----
|
||||||
@@ -28,7 +29,7 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
NTFull => quant.pl ++ num.s ; -- to avoid yi in indef
|
NTFull => quant.pl ++ num.s ; -- to avoid yi in indef
|
||||||
NTVoid Pl => quant.pl ++ num.s ;
|
NTVoid Pl => quant.pl ++ num.s ;
|
||||||
_ => quant.s ++ num.s
|
_ => quant.s ++ num.s
|
||||||
} ;
|
} ;
|
||||||
detType = case num.numType of {
|
detType = case num.numType of {
|
||||||
NTFull => DTNum ; -- five
|
NTFull => DTNum ; -- five
|
||||||
NTVoid n => case quant.detType of {
|
NTVoid n => case quant.detType of {
|
||||||
@@ -63,8 +64,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
AdNum adn num = {s = adn.s ++ num.s ; hasC = True} ;
|
AdNum adn num = {s = adn.s ++ num.s ; hasC = True} ;
|
||||||
|
|
||||||
OrdSuperl a = {s = superlative_s ++ a.s} ;
|
OrdSuperl a = {s = superlative_s ++ a.s ! Attr} ;
|
||||||
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s} ; ---- to check AR 24/8/2014
|
OrdNumeralSuperl n a = {s = ordinal_s ++ n.s ++ superlative_s ++ a.s ! Attr} ; ---- to check AR 24/8/2014
|
||||||
|
|
||||||
DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s
|
DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s
|
||||||
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
|
IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural
|
||||||
@@ -80,8 +81,8 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ;
|
ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ;
|
||||||
|
|
||||||
AdjCN ap cn = case ap.monoSyl of {
|
AdjCN ap cn = case ap.monoSyl of {
|
||||||
True => {s = ap.s ++ cn.s ; c = cn.c} ;
|
True => {s = ap.s ! Attr ++ cn.s ; c = cn.c} ;
|
||||||
False => {s = ap.s ++ possessive_s ++ cn.s ; c = cn.c}
|
False => {s = ap.s ! Attr ++ possessive_s ++ cn.s ; c = cn.c}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ;
|
RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ;
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ flags coding = utf8 ;
|
|||||||
flags coding=utf8;
|
flags coding=utf8;
|
||||||
oper
|
oper
|
||||||
mkN = overload {
|
mkN = overload {
|
||||||
mkN : (man : Str) -> N
|
mkN : (man : Str) -> N
|
||||||
= \n -> lin N (regNoun n ge_s) ;
|
= \n -> lin N (regNoun n ge_s) ;
|
||||||
mkN : (man : Str) -> Str -> N
|
mkN : (man : Str) -> Str -> N
|
||||||
= \n,c -> lin N (regNoun n c)
|
= \n,c -> lin N (regNoun n c)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkN2 = overload {
|
mkN2 = overload {
|
||||||
mkN2 : Str -> N2
|
mkN2 : Str -> N2
|
||||||
@@ -21,7 +21,7 @@ oper
|
|||||||
mkN3 : N -> Prep -> Prep -> N3
|
mkN3 : N -> Prep -> Prep -> N3
|
||||||
= \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
|
= \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
|
||||||
|
|
||||||
|
|
||||||
mkPN : (john : Str) -> PN
|
mkPN : (john : Str) -> PN
|
||||||
= \s -> lin PN {s = word s} ; -- normal name, in Chinese characters
|
= \s -> lin PN {s = word s} ; -- normal name, in Chinese characters
|
||||||
|
|
||||||
@@ -29,11 +29,14 @@ oper
|
|||||||
= \s -> lin PN {s = s} ; -- foreign name, in Latin or other non-Chinese characters
|
= \s -> lin PN {s = s} ; -- foreign name, in Latin or other non-Chinese characters
|
||||||
|
|
||||||
mkA = overload {
|
mkA = overload {
|
||||||
mkA : (small : Str) -> A
|
mkA : (small : Str) -> A
|
||||||
= \a -> lin A (simpleAdj a) ;
|
= \a -> lin A (simpleAdj a) ;
|
||||||
mkA : (small : Str) -> Bool -> A
|
mkA : (small : Str) -> Bool -> A
|
||||||
= \a,b -> lin A (mkAdj a b) ;
|
= \a,b -> lin A (mkAdj a b) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
colourA : Str -> A ; -- colour Adjectives have a "色" when used as predicative
|
||||||
|
colourA colour = lin A (colourAdj colour);
|
||||||
|
|
||||||
mkA2 = overload {
|
mkA2 = overload {
|
||||||
mkA2 : Str -> A2
|
mkA2 : Str -> A2
|
||||||
@@ -43,32 +46,32 @@ oper
|
|||||||
mkA2 : A -> Prep -> A2
|
mkA2 : A -> Prep -> A2
|
||||||
= \a,p -> lin A2 (a ** {c2 = p}) ;
|
= \a,p -> lin A2 (a ** {c2 = p}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV = overload {
|
mkV = overload {
|
||||||
mkV : (walk : Str) -> V
|
mkV : (walk : Str) -> V
|
||||||
= \walk -> case walk of {
|
= \walk -> case walk of {
|
||||||
v + "+" + p => lin V (regVerb (v + p)) ;
|
v + "+" + p => lin V (regVerb (v + p)) ;
|
||||||
_ => lin V (regVerb walk)
|
_ => lin V (regVerb walk)
|
||||||
} ;
|
} ;
|
||||||
mkV : (walk,out : Str) -> V
|
mkV : (walk,out : Str) -> V
|
||||||
= \v,p -> lin V (regVerb (v + p)) ; ----
|
= \v,p -> lin V (regVerb (v + p)) ; ----
|
||||||
mkV : (arrive : Str) -> Str -> Str -> Str -> Str -> V
|
mkV : (arrive : Str) -> Str -> Str -> Str -> Str -> V
|
||||||
= \arrive,pp,ds,dp,ep -> lin V (mkVerb arrive pp ds dp ep neg_s) ;
|
= \arrive,pp,ds,dp,ep -> lin V (mkVerb arrive pp ds dp ep neg_s) ;
|
||||||
mkV : (arrive : Str) -> Str -> Str -> Str -> Str -> Str -> V
|
mkV : (arrive : Str) -> Str -> Str -> Str -> Str -> Str -> V
|
||||||
= \arrive,pp,ds,dp,ep,neg -> lin V (mkVerb arrive pp ds dp ep neg) ;
|
= \arrive,pp,ds,dp,ep,neg -> lin V (mkVerb arrive pp ds dp ep neg) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV2 = overload {
|
mkV2 = overload {
|
||||||
mkV2 : Str -> V2
|
mkV2 : Str -> V2
|
||||||
= \s -> case s of {
|
= \s -> case s of {
|
||||||
v + "+" + p => lin V2 (regVerb v ** {c2 = emptyPrep ; hasPrep = False ; part = word p}) ;
|
v + "+" + p => lin V2 (regVerb v ** {c2 = emptyPrep ; hasPrep = False ; part = word p}) ;
|
||||||
v + "*" + p => lin V2 (regVerb v **
|
v + "*" + p => lin V2 (regVerb v **
|
||||||
{c2 = ResChi.mkPreposition p [] (getAdvType p) ; hasPrep = True ; part = []}) ;
|
{c2 = ResChi.mkPreposition p [] (getAdvType p) ; hasPrep = True ; part = []}) ;
|
||||||
_ => lin V2 (regVerb s ** {c2 = emptyPrep ; hasPrep = False ; part = []})
|
_ => lin V2 (regVerb s ** {c2 = emptyPrep ; hasPrep = False ; part = []})
|
||||||
} ;
|
} ;
|
||||||
mkV2 : V -> V2
|
mkV2 : V -> V2
|
||||||
= \v -> lin V2 (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
= \v -> lin V2 (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
mkV2 : V -> Prep -> V2
|
mkV2 : V -> Prep -> V2
|
||||||
= \v,p -> lin V2 (v ** {c2 = p ; hasPrep = True ; part = []}) ;
|
= \v,p -> lin V2 (v ** {c2 = p ; hasPrep = True ; part = []}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -110,47 +113,47 @@ oper
|
|||||||
|
|
||||||
mkV2Q = overload {
|
mkV2Q = overload {
|
||||||
mkV2Q : V -> V2Q =
|
mkV2Q : V -> V2Q =
|
||||||
\v -> lin V2Q (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
\v -> lin V2Q (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
mkV2Q : Str -> V2Q =
|
mkV2Q : Str -> V2Q =
|
||||||
\v -> lin V2Q (regVerb v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
\v -> lin V2Q (regVerb v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV2V= overload {
|
mkV2V= overload {
|
||||||
mkV2V : Str -> V2V =
|
mkV2V : Str -> V2V =
|
||||||
\s -> lin V2V (regVerb s ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
\s -> lin V2V (regVerb s ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
|
|
||||||
mkV2V : V -> V2V =
|
mkV2V : V -> V2V =
|
||||||
\v -> lin V2V (v ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
\v -> lin V2V (v ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
---- mkV2V : V -> Str -> Str -> V2V =
|
---- mkV2V : V -> Str -> Str -> V2V =
|
||||||
---- \v,p,q -> lin V2V (v ** {c2 = mkPrep p ; c3 = mkPrep q}) ;
|
---- \v,p,q -> lin V2V (v ** {c2 = mkPrep p ; c3 = mkPrep q}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV2S = overload {
|
mkV2S = overload {
|
||||||
mkV2S : Str -> V2S =
|
mkV2S : Str -> V2S =
|
||||||
\s -> lin V2S (regVerb s ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
\s -> lin V2S (regVerb s ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
mkV2S : V -> V2S =
|
mkV2S : V -> V2S =
|
||||||
\v -> lin V2S (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
\v -> lin V2S (v ** {c2 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
---- mkV2S : V -> Str -> V2S =
|
---- mkV2S : V -> Str -> V2S =
|
||||||
---- \v,p -> lin V2S (v ** {c2 = mkPrep p}) ;
|
---- \v,p -> lin V2S (v ** {c2 = mkPrep p}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV2A = overload {
|
mkV2A = overload {
|
||||||
mkV2A : Str -> V2A
|
mkV2A : Str -> V2A
|
||||||
= \s -> lin V2A (regVerb s ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
= \s -> lin V2A (regVerb s ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
mkV2A : V -> V2A
|
mkV2A : V -> V2A
|
||||||
= \v -> lin V2A (v ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
= \v -> lin V2A (v ** {c2 = emptyPrep ; c3 = emptyPrep ; hasPrep = False ; part = []}) ;
|
||||||
} ;
|
} ;
|
||||||
---- mkV2A : V -> Str -> Str -> V2A
|
---- mkV2A : V -> Str -> Str -> V2A
|
||||||
---- = \v,p,q -> lin V2A (v ** {c2 = mkPrep p ; c3 = mkPrep q}) ;
|
---- = \v,p,q -> lin V2A (v ** {c2 = mkPrep p ; c3 = mkPrep q}) ;
|
||||||
|
|
||||||
mkAdv = overload {
|
mkAdv = overload {
|
||||||
mkAdv : Str -> Adv
|
mkAdv : Str -> Adv
|
||||||
= \s -> let at = getAdvType s in lin Adv {s = word s ; advType = at ; hasDe = advTypeHasDe at} ;
|
= \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 -> let at = getAdvType s in lin Adv {s = word (s + t) ; advType = at ; hasDe = advTypeHasDe at} ; ----
|
= \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 ; hasDe = advTypeHasDe 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 ; hasDe = advTypeHasDe at} ;
|
= \adv,at -> adv ** {advType = at ; hasDe = advTypeHasDe at} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
@@ -165,50 +168,50 @@ oper
|
|||||||
= ATTime ;
|
= ATTime ;
|
||||||
mannerAdvType : AdvType
|
mannerAdvType : AdvType
|
||||||
= ATManner ;
|
= ATManner ;
|
||||||
|
|
||||||
mkPrep = overload { -- first pre part, then optional post part
|
mkPrep = overload { -- first pre part, then optional post part
|
||||||
mkPrep : Str -> Prep
|
mkPrep : Str -> Prep
|
||||||
= \s -> lin Prep (ResChi.mkPreposition s [] (getAdvType s)) ;
|
= \s -> lin Prep (ResChi.mkPreposition s [] (getAdvType s)) ;
|
||||||
mkPrep : Str -> Str -> Prep
|
mkPrep : Str -> Str -> Prep
|
||||||
= \s,t -> lin Prep (ResChi.mkPreposition s t (getAdvType s)) ;
|
= \s,t -> lin Prep (ResChi.mkPreposition s t (getAdvType s)) ;
|
||||||
mkPrep : Str -> Str -> AdvType -> Prep
|
mkPrep : Str -> Str -> AdvType -> Prep
|
||||||
= \s,t,a -> lin Prep (ResChi.mkPreposition s t a) ;
|
= \s,t,a -> lin Prep (ResChi.mkPreposition s t a) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkInterj : Str -> Interj
|
mkInterj : Str -> Interj
|
||||||
= \s -> lin Interj {s = word s} ;
|
= \s -> lin Interj {s = word s} ;
|
||||||
|
|
||||||
emptyPrep : Preposition = mkPrep [] ;
|
emptyPrep : Preposition = mkPrep [] ;
|
||||||
|
|
||||||
mkpNP : Str -> CatChi.NP
|
mkpNP : Str -> CatChi.NP
|
||||||
= \s -> lin NP {s = word s} ;
|
= \s -> lin NP {s = word s} ;
|
||||||
mkAdV : Str -> AdV
|
mkAdV : Str -> AdV
|
||||||
= \s -> lin AdV {s = word s} ;
|
= \s -> lin AdV {s = word s} ;
|
||||||
mkAdN : Str -> AdN
|
mkAdN : Str -> AdN
|
||||||
= \s -> lin AdN {s = word s} ;
|
= \s -> lin AdN {s = word s} ;
|
||||||
mkSubj : Str -> Subj
|
mkSubj : Str -> Subj
|
||||||
= \s -> lin Subj (ResChi.mkSubj s []) ;
|
= \s -> lin Subj (ResChi.mkSubj s []) ;
|
||||||
mkConj = overload {
|
mkConj = overload {
|
||||||
mkConj : Str -> Conj
|
mkConj : Str -> Conj
|
||||||
= \s -> lin Conj {s = \\_ => mkConjForm s} ;
|
= \s -> lin Conj {s = \\_ => mkConjForm s ; conjType = NotJiu} ;
|
||||||
mkConj : (both,and : Str) -> Conj
|
mkConj : (both,and : Str) -> Conj
|
||||||
= \s,t -> lin Conj {s = \\_ => mkConjForm2 s t} ;
|
= \s,t -> lin Conj {s = \\_ => mkConjForm2 s t ; conjType = NotJiu} ;
|
||||||
} ;
|
} ;
|
||||||
mkpDet : Str -> Det
|
mkpDet : Str -> Det
|
||||||
= \s -> lin Det {s = word s ; detType = DTFull Sg} ;
|
= \s -> lin Det {s = word s ; detType = DTFull Sg} ;
|
||||||
mkQuant : Str -> Quant
|
mkQuant : Str -> Quant
|
||||||
= \s -> lin Quant {s,pl = word s ; detType = DTFull Sg} ;
|
= \s -> lin Quant {s,pl = word s ; detType = DTFull Sg} ;
|
||||||
mkAdA : Str -> AdA
|
mkAdA : Str -> AdA
|
||||||
= \s -> lin AdA {s = word s} ;
|
= \s -> lin AdA {s = word s} ;
|
||||||
mkNum : Str -> Num
|
mkNum : Str -> Num
|
||||||
= \s -> lin Num {s = word s ; numType = NTFull} ;
|
= \s -> lin Num {s = word s ; numType = NTFull} ;
|
||||||
mkPredet : Str -> Predet
|
mkPredet : Str -> Predet
|
||||||
= \s -> lin Predet {s = word s} ;
|
= \s -> lin Predet {s = word s} ;
|
||||||
mkIDet : Str -> IDet
|
mkIDet : Str -> IDet
|
||||||
= \s -> lin IDet {s = word s ; detType = DTNum} ; ----
|
= \s -> lin IDet {s = word s ; detType = DTNum} ; ----
|
||||||
mkPConj : Str -> PConj
|
mkPConj : Str -> PConj
|
||||||
= \s -> lin PConj {s = word s} ;
|
= \s -> lin PConj {s = word s} ;
|
||||||
mkRP : Str -> RP
|
mkRP : Str -> RP
|
||||||
= \s -> lin RP {s = table {True => [] ; False => word s}} ;
|
= \s -> lin RP {s = table {True => [] ; False => word s}} ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
|||||||
lin
|
lin
|
||||||
PhrUtt pconj utt voc = {s = pconj.s ++ voc.s ++ utt.s} ;
|
PhrUtt pconj utt voc = {s = pconj.s ++ voc.s ++ utt.s} ;
|
||||||
|
|
||||||
UttS s = s ;
|
UttS s = ss (linS s) ;
|
||||||
UttQS qs = ss (qs.s ! True) ;
|
UttQS qs = ss (qs.s ! True) ;
|
||||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p} ;
|
||||||
@@ -13,7 +13,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in {
|
|||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
UttNP np = np ;
|
UttNP np = np ;
|
||||||
UttCN cn = cn ;
|
UttCN cn = cn ;
|
||||||
UttAP ap = ap ;
|
UttAP ap = {s = ap.s!Attr} ;
|
||||||
UttCard x = x ;
|
UttCard x = x ;
|
||||||
UttVP vp = ss (infVP vp) ;
|
UttVP vp = ss (infVP vp) ;
|
||||||
UttAdv adv = adv ;
|
UttAdv adv = adv ;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete QuestionChi of Question = CatChi **
|
concrete QuestionChi of Question = CatChi **
|
||||||
open ResChi, Prelude in {
|
open ResChi, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
@@ -7,29 +7,15 @@ concrete QuestionChi of Question = CatChi **
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
QuestCl cl = {
|
QuestCl cl = {
|
||||||
s = table {
|
s = \\b,p,a => cl.s ! p ! a ++ question_s ; -- redup question as variant in ExtraChi
|
||||||
True => \\p,a => cl.s ! p ! a ++ question_s ; -- redup question as variant in ExtraChi
|
|
||||||
False => \\p,a => --- code copied from ExtraChi
|
|
||||||
let
|
|
||||||
v = cl.vp.verb ;
|
|
||||||
verb = case a of {
|
|
||||||
APlain => v.s ++ v.neg ++ v.sn ;
|
|
||||||
APerf => v.s ++ neg_s ++ v.sn ++ v.pp ;
|
|
||||||
ADurStat => v.s ++ neg_s ++ v.sn ;
|
|
||||||
ADurProg => v.s ++ v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
|
||||||
AExper => v.s ++ v.neg ++ v.sn ++ v.ep
|
|
||||||
}
|
|
||||||
in
|
|
||||||
cl.np ++ cl.vp.prePart ++ verb ++ cl.vp.compl
|
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestVP ip vp = {
|
QuestVP ip vp = {
|
||||||
s = \\_,p,a => ip.s ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl
|
s = \\_,p,a => ip.s ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestSlash ip cls = {s = \\_ => (mkClauseCompl cls.np (insertObj (ss (appPrep cls.c2 ip.s)) cls.vp) []).s} ;
|
QuestSlash ip cls = {s = \\_ => (mkClauseCompl cls.np (insertObj (ss (appPrep cls.c2 ip.s)) cls.vp) []).s} ;
|
||||||
|
|
||||||
QuestIAdv iadv cl = {s = \\_ => (mkClauseCompl cl.np (insertAdv iadv cl.vp) []).s} ;
|
QuestIAdv iadv cl = {s = \\_ => (mkClauseCompl cl.np (insertAdv iadv cl.vp) []).s} ;
|
||||||
|
|
||||||
QuestIComp icomp np = {s = \\_,p,a => np.s ++ icomp.s} ; ---- order
|
QuestIComp icomp np = {s = \\_,p,a => np.s ++ icomp.s} ; ---- order
|
||||||
@@ -49,13 +35,13 @@ concrete QuestionChi of Question = CatChi **
|
|||||||
IdetIP idet = idet ;
|
IdetIP idet = idet ;
|
||||||
|
|
||||||
IdetQuant iquant num = {
|
IdetQuant iquant num = {
|
||||||
s = iquant.s ++ num.s ;
|
s = iquant.s ++ num.s ;
|
||||||
detType = case num.numType of {
|
detType = case num.numType of {
|
||||||
NTFull => DTNum ; -- which five
|
NTFull => DTNum ; -- which five
|
||||||
NTVoid n => DTFull n ---- TODO: whose
|
NTVoid n => DTFull n ---- TODO: whose
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
AdvIAdv i a = ss (a.s ++ i.s) ;
|
AdvIAdv i a = ss (a.s ++ i.s) ;
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ resource ResChi = ParamX ** open Prelude in {
|
|||||||
geng_s = "更" ; -- more, in comparison
|
geng_s = "更" ; -- more, in comparison
|
||||||
hen_s = "很" ; -- very, or predicating a monosyllabic adjective
|
hen_s = "很" ; -- very, or predicating a monosyllabic adjective
|
||||||
taN_s = "它" ;
|
taN_s = "它" ;
|
||||||
|
jiu_s = "就" ;
|
||||||
|
hui_s = "会" ;
|
||||||
|
|
||||||
zai_V = mkVerb "在" [] [] [] [] "不" ;
|
zai_V = mkVerb "在" [] [] [] [] "不" ;
|
||||||
fullstop_s = "。" ;
|
fullstop_s = "。" ;
|
||||||
@@ -67,9 +69,9 @@ resource ResChi = ParamX ** open Prelude in {
|
|||||||
bword : Str -> Str -> Str = \x,y -> x ++ y ; -- change to x + y to treat words as single tokens
|
bword : Str -> Str -> Str = \x,y -> x ++ y ; -- change to x + y to treat words as single tokens
|
||||||
|
|
||||||
word : Str -> Str = \s -> case s of {
|
word : Str -> Str = \s -> case s of {
|
||||||
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? + c@? + d@? + e@? =>
|
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? + c@? + d@? + e@? =>
|
||||||
bword x (bword y (bword z (bword u (bword v (bword w (bword a (bword b (bword c (bword d e))))))))) ;
|
bword x (bword y (bword z (bword u (bword v (bword w (bword a (bword b (bword c (bword d e))))))))) ;
|
||||||
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? + c@? + d@? =>
|
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? + c@? + d@? =>
|
||||||
bword x (bword y (bword z (bword u (bword v (bword w (bword a (bword b (bword c d)))))))) ;
|
bword x (bword y (bword z (bword u (bword v (bword w (bword a (bword b (bword c d)))))))) ;
|
||||||
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? + c@? => bword x (bword y (bword z (bword u (bword v (bword w (bword a (bword b c))))))) ;
|
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? + c@? => bword x (bword y (bword z (bword u (bword v (bword w (bword a (bword b c))))))) ;
|
||||||
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? => bword x (bword y (bword z (bword u (bword v (bword w (bword a b)))))) ;
|
x@? + y@? + z@? + u@? + v@? + w@? + a@? + b@? => bword x (bword y (bword z (bword u (bword v (bword w (bword a b)))))) ;
|
||||||
@@ -89,144 +91,173 @@ resource ResChi = ParamX ** open Prelude in {
|
|||||||
-- parameters
|
-- parameters
|
||||||
|
|
||||||
param
|
param
|
||||||
Aspect = APlain | APerf | ADurStat | ADurProg | AExper ; ---- APlain added by AR
|
Aspect = APlain | APerf | ADurStat | ADurProg | AExper | AFut ; ---- APlain added by AR
|
||||||
ConjForm = CPhr CPosType | CSent;
|
ConjForm = CPhr CPosType | CSent;
|
||||||
|
ConjType = Jiu | NotJiu ; -- to put conjunction in the right place in ConjS: "I sleep *and* she walks" vs. "if I sleep, she *then* walks"
|
||||||
CPosType = CAPhrase | CNPhrase | CVPhrase ;
|
CPosType = CAPhrase | CNPhrase | CVPhrase ;
|
||||||
DeForm = DeNoun | NdNoun ; -- parameter created for noun with/out partical "de"
|
DeForm = DeNoun | NdNoun ; -- parameter created for noun with/out partical "de"
|
||||||
|
|
||||||
AdvType = ATPlace Bool | ATTime | ATManner | ATPoss ; -- ATPlace True = has zai_s already
|
AdvType = ATPlace Bool | ATTime | ATManner | ATPoss ; -- ATPlace True = has zai_s already
|
||||||
|
|
||||||
-- parts of speech
|
AdjPlace = Attr | Pred ; -- a green cat / the cat is green colour
|
||||||
|
|
||||||
|
-- parts of speech
|
||||||
oper
|
oper
|
||||||
|
|
||||||
VP = {
|
VP = {
|
||||||
topic : Str ; -- topicalized item, before subject
|
topic : Str ; -- topicalized item, before subject
|
||||||
prePart : Str ; -- between subject and verb
|
prePart : Str ; -- between subject and verb
|
||||||
verb : Verb ;
|
verb : Verb ;
|
||||||
compl : Str ; -- after verb
|
compl : Str ; -- after verb
|
||||||
isAdj : Bool ; -- whether it is an adjectival predication and behaves differently in relative
|
isAdj : Bool ; -- whether it is an adjectival predication and behaves differently in relative
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
NP = {s : Str} ;
|
NP = {s : Str} ;
|
||||||
|
|
||||||
-- for morphology
|
-- for morphology
|
||||||
|
|
||||||
Noun : Type = {s : Str ; c : Str} ;
|
Noun : Type = {s : Str ; c : Str} ;
|
||||||
Adj : Type = {s : Str ; monoSyl: Bool} ;
|
Adj : Type = {s : AdjPlace => Str ; monoSyl: Bool} ;
|
||||||
Verb : Type = {s,sn : Str ; pp,ds,dp,ep : Str ; neg : Str} ; --- sn=[] needed for "hen" as copula
|
Verb : Type = {s,sn : Str ; pp,ds,dp,ep : Str ; neg : Str} ; --- sn=[] needed for "hen" as copula
|
||||||
|
|
||||||
regNoun : Str -> Str -> Noun = \s,c -> {s = word s ; c = word c};
|
regNoun : Str -> Str -> Noun = \s,c -> {s = word s ; c = word c};
|
||||||
|
|
||||||
mkAdj : Str -> Bool -> Adj = \s,b -> {s = word s ; monoSyl = b};
|
mkAdj : Str -> Bool -> Adj = \s,b -> {s =
|
||||||
|
table {
|
||||||
|
_ => word s
|
||||||
|
};
|
||||||
|
monoSyl = b};
|
||||||
|
|
||||||
complexAP : Str -> Adj ** {hasAdA : Bool} =
|
complexAP : Str -> Adj ** {hasAdA : Bool} =
|
||||||
\s -> {s = s ; monoSyl = False ; hasAdA = False} ; --- not used for adding AdA
|
\s -> mkAdj s False ** {hasAdA = False} ; --- not used for adding AdA
|
||||||
|
|
||||||
simpleAdj : Str -> Adj = \s -> case s of {
|
simpleAdj : Str -> Adj = \s -> case s of {
|
||||||
? => mkAdj s True ; -- monosyllabic
|
? => mkAdj s True ; -- monosyllabic
|
||||||
_ => mkAdj s False
|
_ => mkAdj s False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
copula : Verb = mkVerb "是" [] [] [] [] "不" ;
|
colourAdj : Str -> Adj = \s -> {
|
||||||
hen_copula : Verb =
|
s = table {
|
||||||
{s = hen_s ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
Attr => word s ;
|
||||||
nocopula : Verb =
|
Pred => word s ++ "色"
|
||||||
{s = [] ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
};
|
||||||
adjcopula : Verb =
|
monoSyl = case s of {
|
||||||
{s = "是" ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
? => True ;
|
||||||
|
_ => False }
|
||||||
|
};
|
||||||
|
|
||||||
regVerb : (walk : Str) -> Verb = \v ->
|
copula : Verb = mkVerb "是" [] [] [] [] "不" ;
|
||||||
|
hen_copula : Verb =
|
||||||
|
{s = hen_s ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
||||||
|
nocopula : Verb =
|
||||||
|
{s = [] ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
||||||
|
adjcopula : Verb =
|
||||||
|
{s = "是" ; sn = [] ; pp = [] ; ds = [] ; dp = [] ; ep = [] ; neg = "不"} ; ---
|
||||||
|
|
||||||
|
regVerb : (walk : Str) -> Verb = \v ->
|
||||||
mkVerb v "了" "着" "在" "过" "不" ; -- 没" ;
|
mkVerb v "了" "着" "在" "过" "不" ; -- 没" ;
|
||||||
|
|
||||||
noVerb : Verb = regVerb [] ; ---?? -- used as copula for verbal adverbs
|
noVerb : Verb = regVerb [] ; ---?? -- used as copula for verbal adverbs
|
||||||
|
|
||||||
mkVerb : (v : Str) -> (pp,ds,dp,ep,neg : Str) -> Verb = \v,pp,ds,dp,ep,neg ->
|
mkVerb : (v : Str) -> (pp,ds,dp,ep,neg : Str) -> Verb = \v,pp,ds,dp,ep,neg ->
|
||||||
{s,sn = word v ; pp = pp ; ds = ds ; dp = dp ; ep = ep ; neg = neg} ;
|
{s,sn = word v ; pp = pp ; ds = ds ; dp = dp ; ep = ep ; neg = neg} ;
|
||||||
|
|
||||||
useVerb : Verb -> Polarity => Aspect => Str = \v ->
|
useVerb : Verb -> Polarity => Aspect => Str = \v ->
|
||||||
table {
|
table {
|
||||||
Pos => table {
|
Pos => table {
|
||||||
APlain => v.s ;
|
APlain => v.s ;
|
||||||
APerf => v.s ++ v.pp ;
|
APerf => v.s ++ v.pp ;
|
||||||
ADurStat => v.s ++ v.ds ;
|
ADurStat => v.s ++ v.ds ;
|
||||||
ADurProg => v.dp ++ v.s ;
|
ADurProg => v.dp ++ v.s ;
|
||||||
AExper => v.s ++ v.ep
|
AExper => v.s ++ v.ep ;
|
||||||
|
AFut => hui_s ++ v.s
|
||||||
} ;
|
} ;
|
||||||
Neg => table {
|
Neg => table {
|
||||||
APlain => v.neg ++ v.sn ; --- neg?
|
APlain => v.neg ++ v.sn ; --- neg?
|
||||||
APerf => "不" ++ v.sn ++ v.pp ;
|
APerf => "不" ++ v.sn ++ v.pp ;
|
||||||
ADurStat => "不" ++ v.sn ;
|
ADurStat => "不" ++ v.sn ;
|
||||||
ADurProg => v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
ADurProg => v.neg ++ v.dp ++ v.sn ; -- mei or bu
|
||||||
AExper => v.neg ++ v.sn ++ v.ep
|
AExper => v.neg ++ v.sn ++ v.ep ;
|
||||||
|
AFut => "不" ++ hui_s ++ v.s
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
infVP : VP -> Str = \vp -> vp.topic ++ vp.prePart ++ vp.verb.s ++ vp.compl ;
|
infVP : VP -> Str = \vp -> vp.topic ++ vp.prePart ++ vp.verb.s ++ vp.compl ;
|
||||||
|
|
||||||
predV : Verb -> Str -> VP = \v,part -> {
|
predV : Verb -> Str -> VP = \v,part -> {
|
||||||
verb = v ;
|
verb = v ;
|
||||||
compl = part ;
|
compl = part ;
|
||||||
prePart, topic = [] ;
|
prePart, topic = [] ;
|
||||||
isAdj = False ;
|
isAdj = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertObj : NP -> VP -> VP = \np,vp -> vp ** {
|
insertObj : NP -> VP -> VP = \np,vp -> vp ** {
|
||||||
compl = np.s ++ vp.compl ;
|
compl = np.s ++ vp.compl ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertObjPost : NP -> VP -> VP = \np,vp -> vp ** {
|
insertObjPost : NP -> VP -> VP = \np,vp -> vp ** {
|
||||||
compl = vp.compl ++ np.s ;
|
compl = vp.compl ++ np.s ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdv : SS -> VP -> VP = \adv,vp -> vp ** {
|
insertAdv : SS -> VP -> VP = \adv,vp -> vp ** {
|
||||||
prePart = adv.s ++ vp.prePart ;
|
prePart = adv.s ++ vp.prePart ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertTopic : SS -> VP -> VP = \adv,vp -> vp ** {
|
insertTopic : SS -> VP -> VP = \adv,vp -> vp ** {
|
||||||
topic = adv.s ++ vp.topic
|
topic = adv.s ++ vp.topic
|
||||||
} ;
|
} ;
|
||||||
insertAdvPost : SS -> VP -> VP = \adv,vp -> vp ** {
|
insertAdvPost : SS -> VP -> VP = \adv,vp -> vp ** {
|
||||||
prePart = vp.prePart ++ adv.s ;
|
prePart = vp.prePart ++ adv.s ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertPP : SS -> VP -> VP = \pp,vp -> vp ** {
|
insertPP : SS -> VP -> VP = \pp,vp -> vp ** {
|
||||||
prePart = vp.prePart ++ pp.s ;
|
prePart = vp.prePart ++ pp.s ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertExtra : SS -> VP -> VP = \ext,vp ->
|
insertExtra : SS -> VP -> VP = \ext,vp ->
|
||||||
insertObjPost ext vp ;
|
insertObjPost ext vp ;
|
||||||
|
|
||||||
-- clauses: keep np and vp separate to enable insertion of IAdv
|
-- clauses: keep np and vp separate to enable insertion of IAdv
|
||||||
|
|
||||||
Clause : Type = {
|
Clause : Type = {
|
||||||
s : Polarity => Aspect => Str ;
|
s : Polarity => Aspect => Str ;
|
||||||
np : Str;
|
np : Str ;
|
||||||
vp : VP
|
vp : VP ;
|
||||||
} ;
|
postJiu : Polarity => Aspect => Str ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Sentence : Type = {
|
||||||
|
preJiu, -- everything until the subject
|
||||||
|
postJiu -- everything after the subject
|
||||||
|
: Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
linS : Sentence -> Str = \s -> s.preJiu ++ s.postJiu ;
|
||||||
|
simpleS : Str -> Sentence = \s -> {preJiu=s ; postJiu=[]} ;
|
||||||
|
|
||||||
|
|
||||||
mkClause = overload {
|
mkClause = overload {
|
||||||
mkClause : Str -> Verb -> Clause = \np,v ->
|
mkClause : Str -> Verb -> Clause = \np,v ->
|
||||||
mkClauseCompl np (predV v []) [] ;
|
mkClauseCompl np (predV v []) [] ;
|
||||||
mkClause : Str -> Verb -> Str -> Clause = \subj,verb,obj ->
|
mkClause : Str -> Verb -> Str -> Clause = \subj,verb,obj ->
|
||||||
mkClauseCompl subj (predV verb []) obj ;
|
mkClauseCompl subj (predV verb []) obj ;
|
||||||
mkClause : Str -> VP -> Clause = \np,vp ->
|
mkClause : Str -> VP -> Clause = \np,vp ->
|
||||||
mkClauseCompl np vp [] ;
|
mkClauseCompl np vp [] ;
|
||||||
mkClause : Str -> VP -> Str -> Clause =
|
mkClause : Str -> VP -> Str -> Clause =
|
||||||
mkClauseCompl ;
|
mkClauseCompl ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkClauseCompl : Str -> VP -> Str -> Clause = \np,vp,compl -> {
|
mkClauseCompl : Str -> VP -> Str -> Clause = \np,vp,compl -> {
|
||||||
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||||
np = vp.topic ++ np ;
|
np = vp.topic ++ np ;
|
||||||
vp = insertObj (ss compl) vp ;
|
vp = insertObj (ss compl) vp ;
|
||||||
|
postJiu = \\p,a => vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- for structural words
|
-- for structural words
|
||||||
|
|
||||||
param
|
param
|
||||||
DetType = DTFull Number | DTNum | DTPoss ; -- this, these, five, our
|
DetType = DTFull Number | DTNum | DTPoss ; -- this, these, five, our
|
||||||
NumType = NTFull | NTVoid Number ; -- five, sg, pl
|
NumType = NTFull | NTVoid Number ; -- five, sg, pl
|
||||||
|
|
||||||
@@ -250,8 +281,8 @@ oper
|
|||||||
s = word s
|
s = word s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType ; hasDe : Bool} ;
|
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 ;
|
||||||
@@ -262,8 +293,8 @@ oper
|
|||||||
advTypeHasDe : AdvType -> Bool = \at -> case at of {
|
advTypeHasDe : AdvType -> Bool = \at -> case at of {
|
||||||
ATPoss => True ;
|
ATPoss => True ;
|
||||||
_ => False
|
_ => False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
getAdvType : Str -> AdvType = \s -> case s of {
|
getAdvType : Str -> AdvType = \s -> case s of {
|
||||||
"的" => ATPoss ;
|
"的" => ATPoss ;
|
||||||
"在" + _ => ATPlace True ; -- certain that True
|
"在" + _ => ATPlace True ; -- certain that True
|
||||||
@@ -271,7 +302,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
possessiveIf : Bool -> Str = \hasDe -> case hasDe of {
|
possessiveIf : Bool -> Str = \hasDe -> case hasDe of {
|
||||||
True => [] ; --- to avoid double "de"
|
True => [] ; --- to avoid double "de"
|
||||||
_ => possessive_s
|
_ => possessive_s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -285,7 +316,7 @@ oper
|
|||||||
|
|
||||||
mkNP : Str -> NP = ss ; -- not to be used in lexicon building
|
mkNP : Str -> NP = ss ; -- not to be used in lexicon building
|
||||||
|
|
||||||
appPrep : Preposition -> Str -> Str = \prep,s ->
|
appPrep : Preposition -> Str -> Str = \prep,s ->
|
||||||
prep.prepPre ++ s ++ prep.prepPost ;
|
prep.prepPre ++ s ++ prep.prepPost ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete SentenceChi of Sentence = CatChi **
|
concrete SentenceChi of Sentence = CatChi **
|
||||||
open Prelude, ResChi in {
|
open Prelude, ResChi in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
@@ -12,39 +12,55 @@ concrete SentenceChi of Sentence = CatChi **
|
|||||||
ImpVP vp = {
|
ImpVP vp = {
|
||||||
s = table {
|
s = table {
|
||||||
Pos => infVP vp ;
|
Pos => infVP vp ;
|
||||||
Neg => neg_s ++ infVP vp
|
Neg => neg_s ++ infVP vp
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVP np vp =
|
SlashVP np vp =
|
||||||
mkClauseCompl np.s vp []
|
mkClauseCompl np.s vp []
|
||||||
** {c2 = vp.c2} ;
|
** {c2 = vp.c2} ;
|
||||||
|
|
||||||
SlashVS np vs sslash = <mkClause np.s vs sslash.s : Clause> ** {c2 = sslash.c2} ;
|
SlashVS np vs sslash = <mkClause np.s vs sslash.s : Clause> ** {c2 = sslash.c2} ;
|
||||||
|
|
||||||
|
|
||||||
-- yet another reason for discontinuity of clauses
|
-- yet another reason for discontinuity of clauses
|
||||||
AdvSlash slash adv = slash ** {vp = insertAdv adv slash.vp} ;
|
AdvSlash slash adv = slash ** {vp = insertAdv adv slash.vp} ;
|
||||||
---- parser loops with unknown tokens if this version is used AR 20/4/2014
|
---- parser loops with unknown tokens if this version is used AR 20/4/2014
|
||||||
---- mkClauseCompl slash.np <insertAdv adv slash.vp : VP> []
|
---- mkClauseCompl slash.np <insertAdv adv slash.vp : VP> []
|
||||||
---- ** {c2 = slash.c2} ;
|
---- ** {c2 = slash.c2} ;
|
||||||
|
|
||||||
SlashPrep cl prep = cl ** {c2 = prep} ;
|
SlashPrep cl prep = cl ** {c2 = prep} ;
|
||||||
|
|
||||||
EmbedS s = ss (conjThat ++ s.s) ;
|
EmbedS s = ss (conjThat ++ linS s) ;
|
||||||
EmbedQS qs = ss (qs.s ! False) ;
|
EmbedQS qs = ss (qs.s ! False) ;
|
||||||
EmbedVP vp = ss (infVP vp) ;
|
EmbedVP vp = ss (infVP vp) ;
|
||||||
|
|
||||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
UseCl t p cl = {
|
||||||
UseQCl t p cl = {s = \\isDir => t.s ++ p.s ++ cl.s ! isDir ! p.p ! t.t} ;
|
preJiu = cl.np ;
|
||||||
UseRCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
postJiu = t.s ++ p.s ++ cl.postJiu ! p.p ! t.t} ;
|
||||||
|
|
||||||
|
UseQCl t p cl = {s = \\isDir => t.s ++ p.s ++ cl.s ! isDir ! p.p ! t.t} ;
|
||||||
|
UseRCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||||
UseSlash t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t ; c2 = cl.c2} ;
|
UseSlash t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t ; c2 = cl.c2} ;
|
||||||
|
|
||||||
AdvS a s = ss (a.s ++ s.s) ;
|
AdvS a s = s ** {
|
||||||
ExtAdvS a s = ss (a.s ++ chcomma ++ s.s) ;
|
preJiu = a.s ++ s.preJiu -- tomorrow she
|
||||||
|
} ;
|
||||||
|
|
||||||
RelS s r = ss (s.s ++ r.s) ;
|
ExtAdvS a s = s ** {
|
||||||
|
preJiu = a.s ++ chcomma ++ s.preJiu -- tomorrow, she
|
||||||
|
} ;
|
||||||
|
|
||||||
SSubjS a subj b = ss (a.s ++ subj.prePart ++ b.s ++ subj.sufPart) ;
|
RelS s r = s ** {
|
||||||
|
postJiu = s.postJiu ++ r.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- a="she walks", b="I die"
|
||||||
|
-- result: preJiu="if she walks, I", postJiu="die"
|
||||||
|
SSubjS a subj b = {
|
||||||
|
preJiu = linS a ++ subj.prePart -- if she walks,
|
||||||
|
++ b.preJiu ; -- I
|
||||||
|
postJiu = b.postJiu ++ subj.sufPart -- die
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ concrete StructuralChi of Structural = CatChi **
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
every_Det = mkDet "每" Sg ;
|
every_Det = mkDet "每" Sg ;
|
||||||
|
|
||||||
this_Quant = mkQuant "这" ;
|
this_Quant = mkQuant "这" ;
|
||||||
that_Quant = mkQuant "那" ;
|
that_Quant = mkQuant "那" ;
|
||||||
|
|
||||||
@@ -25,18 +25,20 @@ lin
|
|||||||
possess_Prep = mkPrep [] "的" ATPoss ;
|
possess_Prep = mkPrep [] "的" ATPoss ;
|
||||||
with_Prep = mkPrep "和" "一起" (ATPlace True) ; -- "with you"
|
with_Prep = mkPrep "和" "一起" (ATPlace True) ; -- "with you"
|
||||||
---- with_Prep = mkPrep "和" [] ; -- "with bread"
|
---- with_Prep = mkPrep "和" [] ; -- "with bread"
|
||||||
|
|
||||||
and_Conj = {s = table {
|
and_Conj = {s = table {
|
||||||
CPhr CNPhrase => mkConjForm "和" ;
|
CPhr CNPhrase => mkConjForm "和" ;
|
||||||
CPhr CAPhrase => mkConjForm "而" ;
|
CPhr CAPhrase => mkConjForm "而" ;
|
||||||
CPhr CVPhrase => mkConjForm "又" ;
|
CPhr CVPhrase => mkConjForm "又" ;
|
||||||
CSent => mkConjForm "并且" --modified by chenpneg 11.19
|
CSent => mkConjForm "而" --modified by chenpneg 11.19
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
or_Conj = {s = table {
|
or_Conj = {s = table {
|
||||||
CPhr _ => mkConjForm "或" ;
|
CPhr _ => mkConjForm "或" ;
|
||||||
CSent => mkConjForm "还是"
|
CSent => mkConjForm "还是"
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
although_Subj = mkSubj "虽然" "但";
|
although_Subj = mkSubj "虽然" "但";
|
||||||
@@ -52,8 +54,8 @@ when_IAdv = mkIAdvL "什么时候" ;
|
|||||||
how_IAdv = mkIAdvL "如何" ;
|
how_IAdv = mkIAdvL "如何" ;
|
||||||
all_Predet = ssword "所有" ;
|
all_Predet = ssword "所有" ;
|
||||||
many_Det = mkDet (word "很多") DTPoss ;
|
many_Det = mkDet (word "很多") DTPoss ;
|
||||||
someSg_Det = mkDet (word "一些") Sg ;
|
someSg_Det = mkDet (word "一些") DTPoss ;
|
||||||
somePl_Det = mkDet (word "一些") Sg ;
|
somePl_Det = mkDet (word "一些") DTPoss ;
|
||||||
few_Det = mkDet "少" Pl ;
|
few_Det = mkDet "少" Pl ;
|
||||||
other_A = mkA "其他" ;
|
other_A = mkA "其他" ;
|
||||||
|
|
||||||
@@ -116,13 +118,14 @@ as_CAdv = {s = word "和" ; p = word "一样" } ; -- modified by chenpeng 11.24
|
|||||||
at_least_AdN = ssword "最少" ; -- at least five
|
at_least_AdN = ssword "最少" ; -- at least five
|
||||||
at_most_AdN = ssword "最多" ;
|
at_most_AdN = ssword "最多" ;
|
||||||
behind_Prep = mkPrep "在" "后面" ;
|
behind_Prep = mkPrep "在" "后面" ;
|
||||||
|
|
||||||
both7and_DConj = {s = table { -- modified by chenpeng 11.19
|
both7and_DConj = {s = table { -- modified by chenpeng 11.19
|
||||||
CPhr CNPhrase => mkConjForm2 "包括" "和" ;
|
CPhr CNPhrase => mkConjForm2 "包括" "和" ;
|
||||||
CPhr CAPhrase => mkConjForm2 "即" "又" ;
|
CPhr CAPhrase => mkConjForm2 "即" "又" ;
|
||||||
CPhr CVPhrase => mkConjForm2 "不但" "而且" ;
|
CPhr CVPhrase => mkConjForm2 "不但" "而且" ;
|
||||||
CSent => mkConjForm2 "不但" "而且"
|
CSent => mkConjForm2 "不但" "而且"
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
by8agent_Prep = mkPrep "被" [] mannerAdvType; -- by for agent in passive
|
by8agent_Prep = mkPrep "被" [] mannerAdvType; -- by for agent in passive
|
||||||
@@ -135,7 +138,8 @@ either7or_DConj = {s = table { -- modified by chenpeng 11.19
|
|||||||
CPhr CAPhrase => mkConjForm2 "要么" "要么" ;
|
CPhr CAPhrase => mkConjForm2 "要么" "要么" ;
|
||||||
CPhr CVPhrase => mkConjForm2 "要么" "要么" ;
|
CPhr CVPhrase => mkConjForm2 "要么" "要么" ;
|
||||||
CSent => mkConjForm2 "要么" "要么"
|
CSent => mkConjForm2 "要么" "要么"
|
||||||
}
|
} ;
|
||||||
|
conjType = NotJiu ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
|
everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person)
|
||||||
@@ -152,11 +156,10 @@ less_CAdv = {s = than_s ; p = word "没更"} ; -- modified by chenpeng 11.24
|
|||||||
more_CAdv = {s = than_s ; p = word "更"} ; -- modified by chenpeng 11.24
|
more_CAdv = {s = than_s ; p = word "更"} ; -- modified by chenpeng 11.24
|
||||||
most_Predet = ssword "大多数" ;
|
most_Predet = ssword "大多数" ;
|
||||||
if_then_Conj = {s = table { -- added by chenpeng 11.19
|
if_then_Conj = {s = table { -- added by chenpeng 11.19
|
||||||
CPhr CNPhrase => mkConjForm [] ;
|
CSent => mkConjForm2 "如果" "就" ; -- if she walks, I then sleep
|
||||||
CPhr CAPhrase => mkConjForm [] ;
|
CPhr _ => mkConjForm2 "如果" "那么" -- if fish , then rice
|
||||||
CPhr CVPhrase => mkConjForm [] ;
|
} ;
|
||||||
CSent => mkConjForm2 "如果" "那么"
|
conjType = Jiu ;
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
nobody_NP = ssword "没人" ;
|
nobody_NP = ssword "没人" ;
|
||||||
nothing_NP = ssword "没有什么" ;
|
nothing_NP = ssword "没有什么" ;
|
||||||
@@ -171,7 +174,7 @@ there7from_Adv = mkAdv "从那里" ; -- from there
|
|||||||
there7to_Adv = mkAdv "到那里" ;
|
there7to_Adv = mkAdv "到那里" ;
|
||||||
therefore_PConj = ssword "因此" ;
|
therefore_PConj = ssword "因此" ;
|
||||||
through_Prep = mkPrep "通过" ;
|
through_Prep = mkPrep "通过" ;
|
||||||
which_IQuant = mkIQuant "哪" ; --
|
which_IQuant = mkIQuant "哪" ; --
|
||||||
--which_IQuant = ssword [] ; -- [mark] in sent, it depends on the context
|
--which_IQuant = ssword [] ; -- [mark] in sent, it depends on the context
|
||||||
without_Prep = mkPrep "没有" [] mannerAdvType ;
|
without_Prep = mkPrep "没有" [] mannerAdvType ;
|
||||||
youPol_Pron = ssword "您" ; -- polite you
|
youPol_Pron = ssword "您" ; -- polite you
|
||||||
|
|||||||
@@ -13,17 +13,17 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in {
|
|||||||
s = cn.s ++ i.s ;
|
s = cn.s ++ i.s ;
|
||||||
c = cn.c
|
c = cn.c
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = ss (det.s ++ cn.s ++ xs.s) ; ----
|
CNSymbNP det cn xs = ss (det.s ++ cn.s ++ xs.s) ; ----
|
||||||
CNNumNP cn i = {
|
CNNumNP cn i = {
|
||||||
s = cn.s ++ i.s ;
|
s = cn.s ++ i.s ;
|
||||||
c = cn.c
|
c = cn.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SymbS sy = sy ;
|
SymbS sy = simpleS sy.s ;
|
||||||
SymbNum sy = sy ;
|
SymbNum sy = sy ;
|
||||||
SymbOrd sy = sy ;
|
SymbOrd sy = sy ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
|
|
||||||
Symb, [Symb] = SS ;
|
Symb, [Symb] = SS ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete TenseChi of Tense =
|
concrete TenseChi of Tense =
|
||||||
CatChi [Tense,Temp,Ant], TenseX [Pol,PNeg,PPos] ** open ResChi in {
|
CatChi [Tense,Temp,Ant], TenseX [Pol,PNeg,PPos] ** open ResChi in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
@@ -6,11 +6,11 @@ concrete TenseChi of Tense =
|
|||||||
|
|
||||||
---- ??
|
---- ??
|
||||||
TPres = {s = [] ; t = APlain} ;
|
TPres = {s = [] ; t = APlain} ;
|
||||||
TPast = {s = [] ; t = APerf} ;
|
TPast = {s = [] ; t = APerf} ;
|
||||||
TFut = {s = [] ; t = ADurProg} ;
|
TFut = {s = [] ; t = AFut} ;
|
||||||
TCond = {s = [] ; t = ADurStat} ;
|
TCond = {s = [] ; t = ADurStat} ;
|
||||||
|
|
||||||
ASimul = {s = [] ; t = APlain} ;
|
ASimul = {s = [] ; t = APlain} ;
|
||||||
AAnter = {s = [] ; t = APerf} ;
|
AAnter = {s = [] ; t = APerf} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
SlashV2a v = predV v v.part ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2a v = predV v v.part ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
|
|
||||||
Slash2V3 v np = insertAdv (mkNP (ba_s ++ np.s)) (predV v v.part) ** {c2 = v.c3 ; isPre = v.hasPrep} ; -- slot for third argument
|
Slash2V3 v np = insertAdv (mkNP (ba_s ++ np.s)) (predV v v.part) ** {c2 = v.c3 ; isPre = v.hasPrep} ; -- slot for third argument
|
||||||
Slash3V3 v np = insertObj (mkNP (appPrep v.c3 np.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = True} ; -- slot for ba object
|
Slash3V3 v np = insertObj (mkNP (appPrep v.c3 np.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = True} ; -- slot for ba object
|
||||||
|
|
||||||
SlashV2A v ap = insertObj ap (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2A v ap = insertObj {s = ap.s ! Pred} (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
|
|
||||||
SlashV2V v vp = insertObj (mkNP (infVP vp)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2V v vp = insertObj (mkNP (infVP vp)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
SlashV2S v s = insertObj (ss (say_s ++ s.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2S v s = insertObj (ss (say_s ++ linS s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
SlashV2Q v q = insertObj (ss (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
SlashV2Q v q = insertObj (ss (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ;
|
||||||
|
|
||||||
ComplVV v vp = {
|
ComplVV v vp = {
|
||||||
verb = v ;
|
verb = v ;
|
||||||
@@ -23,9 +23,9 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
isAdj = False ;
|
isAdj = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplVS v s = insertObj s (predV v []) ;
|
ComplVS v s = insertObj (ss (linS s)) (predV v []) ;
|
||||||
ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ;
|
ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ;
|
||||||
ComplVA v ap = insertObj ap (predV v []) ;
|
ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ;
|
||||||
|
|
||||||
ComplSlash vp np = case vp.isPre of {
|
ComplSlash vp np = case vp.isPre of {
|
||||||
--- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ?
|
--- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ?
|
||||||
@@ -39,7 +39,7 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
SlashVV v vp = ---- too simple?
|
SlashVV v vp = ---- too simple?
|
||||||
insertObj (mkNP (infVP vp)) (predV v []) ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
insertObj (mkNP (infVP vp)) (predV v []) ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
||||||
|
|
||||||
SlashV2VNP v np vp =
|
SlashV2VNP v np vp =
|
||||||
insertObj np
|
insertObj np
|
||||||
(insertObj (mkNP (infVP vp)) (predV v v.part)) ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
(insertObj (mkNP (infVP vp)) (predV v v.part)) ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
||||||
|
|
||||||
@@ -56,19 +56,19 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps
|
ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdVVP adv vp = insertAdv adv vp ;
|
AdVVP adv vp = insertAdv adv vp ;
|
||||||
|
|
||||||
ReflVP vp = insertObj (mkNP reflPron) vp ;
|
ReflVP vp = insertObj (mkNP reflPron) vp ;
|
||||||
|
|
||||||
PassV2 v = insertAdv (mkNP passive_s) (predV v v.part) ; ----
|
PassV2 v = insertAdv (mkNP passive_s) (predV v v.part) ; ----
|
||||||
|
|
||||||
CompAP ap = insertObj (mkNP (ap.s ++ de_s)) (predV copula []) ** {isAdj = True} ;
|
CompAP ap = insertObj (mkNP (ap.s ! Pred ++ de_s)) (predV copula []) ** {isAdj = True} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
CompAP ap = case ap.hasAdA of {
|
CompAP ap = case ap.hasAdA of {
|
||||||
True => insertObj (mkNP ap.s) (predV nocopula []) ;
|
True => insertObj (mkNP ap.s) (predV nocopula []) ;
|
||||||
False => insertObj (mkNP (ap.s ++ de_s)) (predV copula [])
|
False => insertObj (mkNP (ap.s ++ de_s)) (predV copula [])
|
||||||
} ;
|
} ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
CompNP np = insertObj np (predV copula []) ; ----
|
CompNP np = insertObj np (predV copula []) ; ----
|
||||||
|
|||||||
3
src/chinese/unittest/adjectives.gftest
Normal file
3
src/chinese/unittest/adjectives.gftest
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (AdjCN (PositA green_A) (UseN cat_N))) (UseComp (CompAP (PositA green_A))))
|
||||||
|
LangChi: 那 只 绿 猫 是 绿 色 的
|
||||||
|
LangEng: that green cat is green
|
||||||
12
src/chinese/unittest/adverbial.gftest
Normal file
12
src/chinese/unittest/adverbial.gftest
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
-- These are not ideal output. TODO: Add new constructor for semantic contexts to achieve the correct output for "地" vs "得"
|
||||||
|
|
||||||
|
Lang: PredVP (AdvNP (UsePron it_Pron) (PositAdvAdj beautiful_A)) (UseV walk_V)
|
||||||
|
LangChi: 漂 亮 地 的 它 走
|
||||||
|
LangEng: it beautifully walks
|
||||||
|
-- Correct LangChi: 它 漂 亮 地 走
|
||||||
|
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron it_Pron) (AdvVP (UseV walk_V) (PositAdvAdj beautiful_A))
|
||||||
|
LangChi: 它 走 得 漂 亮 地
|
||||||
|
LangEng: it walks beautifully
|
||||||
|
-- Correct LangChi: 它 走 得 漂 亮
|
||||||
3
src/chinese/unittest/complements.gftest
Normal file
3
src/chinese/unittest/complements.gftest
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
-- One way of saying "he/she gives me a cat"
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (Slash2V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN cat_N))) (UsePron i_Pron)))
|
||||||
|
LangChi: 他 把 猫 给 我
|
||||||
47
src/chinese/unittest/conjunctions.gftest
Normal file
47
src/chinese/unittest/conjunctions.gftest
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
-- Basic conjunctions, no jiu
|
||||||
|
Lang: ConjS and_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V))))
|
||||||
|
LangChi: 我 睡 觉 而 她 走
|
||||||
|
LangEng: I sleep and she walks
|
||||||
|
|
||||||
|
Lang: ConjS or_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV go_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV go_V))))
|
||||||
|
LangChi: 我 去 还 是 她 去
|
||||||
|
LangEng: I go or she goes
|
||||||
|
|
||||||
|
Lang: ConjS either7or_DConj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV go_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV go_V))))
|
||||||
|
LangChi: 要 么 我 去 要 么 她 去
|
||||||
|
LangEng: either I go or she goes
|
||||||
|
|
||||||
|
-- If-then in different tenses
|
||||||
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 就 死
|
||||||
|
LangEng: if I sleep then she dies
|
||||||
|
|
||||||
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 就 会 死
|
||||||
|
LangEng: if I sleep then she will die
|
||||||
|
|
||||||
|
-- contrast: if_Subj, not if_then_Conj
|
||||||
|
Lang: ExtAdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV die_V)))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 会 死
|
||||||
|
LangEng: if I sleep , she will die
|
||||||
|
|
||||||
|
-- back to if_then_Conj, now with negations
|
||||||
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 就 不 死
|
||||||
|
LangEng: if I sleep then she doesn't die
|
||||||
|
|
||||||
|
Lang: ConjS if_then_Conj (BaseS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V))) (UseCl (TTAnt TFut ASimul) PNeg (PredVP (UsePron she_Pron) (UseV die_V))))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 就 不 会 死
|
||||||
|
LangEng: if I sleep then she won't die
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- NP conjunctions
|
||||||
|
Lang: ConjNP or_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||||
|
LangChi: 鱼 或 啤 酒
|
||||||
|
LangEng: fish or beer
|
||||||
|
|
||||||
|
--NB: unnatural non-empty strings just for testing purpose
|
||||||
|
Lang: ConjNP if_then_Conj (BaseNP (MassNP (UseN fish_N)) (MassNP (UseN beer_N)))
|
||||||
|
LangChi: 如 果 鱼 那 么 啤 酒
|
||||||
|
LangEng: if fish then beer
|
||||||
32
src/chinese/unittest/future.gftest
Normal file
32
src/chinese/unittest/future.gftest
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Lang: UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron i_Pron) (UseV die_V))
|
||||||
|
LangChi: 我 会 死
|
||||||
|
LangEng: I will die
|
||||||
|
|
||||||
|
Lang: ExtAdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV sleep_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (UsePron she_Pron) (UseV walk_V)))
|
||||||
|
LangChi: 如 果 我 睡 觉 , 她 会 走
|
||||||
|
LangEng: if I sleep , she will walk
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ProgrVP (UseV die_V)))
|
||||||
|
LangChi: 我 在 死
|
||||||
|
LangEng: I am dying
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TFut ASimul) PNeg (PredVP (UsePron i_Pron) (UseV die_V))
|
||||||
|
LangChi: 我 不 会 死
|
||||||
|
LangEng: I won't die
|
||||||
|
|
||||||
|
Lang: UseQCl (TTAnt TFut ASimul) PPos (QuestCl (PredVP (UsePron i_Pron) (UseV die_V)))
|
||||||
|
-- LangChi: 我 会 不 会 死
|
||||||
|
LangChi: 我 会 死 吗
|
||||||
|
LangEng: will I die
|
||||||
|
|
||||||
|
Lang: UseQCl (TTAnt TFut ASimul) PNeg (QuestCl (PredVP (UsePron i_Pron) (UseV die_V)))
|
||||||
|
LangChi: 我 不 会 死 吗
|
||||||
|
LangEng: won't I die
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron i_Pron) (ComplVQ know_VQ (UseQCl (TTAnt TFut ASimul) PPos (QuestCl (PredVP (UsePron i_Pron) (UseV die_V))))))
|
||||||
|
LangChi: 我 不 知 道 我 会 死 吗
|
||||||
|
LangEng: I don't know if I will die
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron i_Pron) (ComplVQ know_VQ (UseQCl (TTAnt TFut ASimul) PNeg (QuestCl (PredVP (UsePron i_Pron) (UseV die_V))))))
|
||||||
|
LangChi: 我 不 知 道 我 不 会 死 吗
|
||||||
|
LangEng: I don't know if I won't die
|
||||||
30
src/chinese/unittest/negation.gftest
Normal file
30
src/chinese/unittest/negation.gftest
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (MassNP (UseN cat_N)) (UseComp (CompCN (UseN dog_N))))
|
||||||
|
LangEng: cat isn't a dog
|
||||||
|
LangChi: 猫 不 是 狗
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (UseComp (CompAP (PositA green_A))))
|
||||||
|
LangEng: these cats aren't green
|
||||||
|
LangChi: 这 些 猫 不 是 绿 色 的
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))
|
||||||
|
LangEng: those cats aren't in the house
|
||||||
|
LangChi: 那 些 猫 不 在 房 子 中
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV can8know_VV (UseV walk_V)))
|
||||||
|
LangChi: 这 些 猫 不 会 走
|
||||||
|
LangEng: these cats can't walk
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV can_VV (UseV walk_V)))
|
||||||
|
LangChi: 这 些 猫 不 能 走
|
||||||
|
LangEng: these cats can't walk
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant this_Quant NumPl) (UseN cat_N)) (ComplVV want_VV (UseV walk_V)))
|
||||||
|
LangChi: 这 些 猫 不 想 走
|
||||||
|
LangEng: these cats don't want to walk
|
||||||
|
|
||||||
|
-- this tree does not make semantic sense in chinese but is compositionally correct due to the direct word for word translation for "must"
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)) (ComplVV must_VV (UseV walk_V)))
|
||||||
|
LangChi: 那 些 猫 不 必 须 走
|
||||||
|
LangEng: those cats mustn't walk
|
||||||
|
|
||||||
|
-- 没有 and must not , bu ke yi
|
||||||
11
src/chinese/unittest/numerals.gftest
Normal file
11
src/chinese/unittest/numerals.gftest
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Lang: DetCN (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01))))))) (UseN cat_N)
|
||||||
|
LangEng: one cat
|
||||||
|
LangChi: 一 只 猫
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5)))))))) (UseN cat_N)
|
||||||
|
LangEng: these five cats
|
||||||
|
LangChi: 这 五 只 猫
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant (PossPron i_Pron) (NumCard (NumNumeral (num (pot2as3 (pot2 (pot0 n7))))))) (UseN cat_N)
|
||||||
|
LangEng: my seven hundred cats
|
||||||
|
LangChi: 我 的 七 百 只 猫
|
||||||
11
src/chinese/unittest/passive.gftest
Normal file
11
src/chinese/unittest/passive.gftest
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Lang: PredVP (DetCN (DetQuant that_Quant NumSg) (UseN boy_N)) (PassV2 kill_V2)
|
||||||
|
LangEng: that boy is killed
|
||||||
|
LangChi: 那 个 男 孩 被 杀
|
||||||
|
|
||||||
|
Lang: PredVP (DetCN (DetQuant DefArt NumSg) (UseN chair_N)) (PassV2 split_V2)
|
||||||
|
LangEng: the chair is split
|
||||||
|
LangChi: 椅 子 被 劈 开
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN boy_N)) (ComplVV want_VV (PassV2 kill_V2)))
|
||||||
|
LangEng: that boy doesn't want to be killed
|
||||||
|
LangChi: 那 个 男 孩 不 想 被 杀
|
||||||
117
src/chinese/unittest/pronouns.gftest
Normal file
117
src/chinese/unittest/pronouns.gftest
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
----------
|
||||||
|
-- Objects
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (UseV go_V) with_Prep) (UsePron i_Pron)) to_Prep) (DetCN (DetQuant DefArt NumSg) (UseN moon_N))))
|
||||||
|
LangEng: the cat goes with me to the moon
|
||||||
|
LangChi: 猫 和 我 一 起 往 月 亮 去
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumPl) (UseN cat_N)) (UseComp (CompAdv (PrepNP with_Prep (DetCN (DetQuant that_Quant NumSg) (UseN person_N))))))
|
||||||
|
LangEng: my cats are with that person
|
||||||
|
LangChi: 我 的 猫 和 那 个 人 一 起
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a hit_V2) (UsePron he_Pron)))
|
||||||
|
LangEng: I hit him
|
||||||
|
LangChi: 我 打 了 他
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a hit_V2) (UsePron he_Pron)))
|
||||||
|
LangEng: I hit him
|
||||||
|
LangChi: 我 打 他
|
||||||
|
|
||||||
|
-------------
|
||||||
|
-- Possession
|
||||||
|
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)
|
||||||
|
LangEng: my cat
|
||||||
|
LangChi: 我 的 猫
|
||||||
|
|
||||||
|
-- that is my cat
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant that_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)))))
|
||||||
|
LangEng: that is my cat
|
||||||
|
LangChi: 那 个 是 我 的 猫
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)) (UseComp (CompNP (DetNP (DetQuant (PossPron i_Pron) NumSg)))))
|
||||||
|
LangEng: that cat is mine
|
||||||
|
LangChi: 那 只 猫 是 我 的
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron she_Pron) NumSg) (UseN cat_N)) (UseComp (CompAP (PositA green_A))))
|
||||||
|
LangEng: her cat is green
|
||||||
|
LangChi: 她 的 猫 是 绿 色 的
|
||||||
|
|
||||||
|
-- two variants, different trees
|
||||||
|
-- read a book
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant IndefArt NumSg) (PossNP (UseN book_N) (UsePron she_Pron)))))
|
||||||
|
LangEng: he reads a book of hers
|
||||||
|
LangChi: 他 读 一 本 她 的 书
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant (PossPron she_Pron) NumSg) (UseN book_N))))
|
||||||
|
LangEng: he reads her book
|
||||||
|
LangChi: 他 读 她 的 书
|
||||||
|
|
||||||
|
-- I read his/her father's book
|
||||||
|
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (PossNP (UseN2 father_N2) (UsePron she_Pron)))))))
|
||||||
|
LangEng: I read the book of the father of hers
|
||||||
|
LangChi: 我 读 了 她 的 父 亲 的 书
|
||||||
|
|
||||||
|
-- Only the noun phrase
|
||||||
|
Lang: MassNP (PossNP (UseN book_N) (UsePron he_Pron))
|
||||||
|
LangEng: book of his
|
||||||
|
LangChi: 他 的 书
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant (PossPron he_Pron) NumSg) (UseN book_N)
|
||||||
|
LangEng: his book
|
||||||
|
LangChi: 他 的 书
|
||||||
|
|
||||||
|
-- For non-pronoun NPs, multiple trees
|
||||||
|
Lang: AdvNP (MassNP (UseN book_N)) (PrepNP part_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: AdvNP (MassNP (UseN book_N)) (PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (AdvCN (UseN book_N) (PrepNP part_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (AdvCN (UseN book_N) (PrepNP possess_Prep (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (ApposCN (AdvCN (UseN book_N) (PrepNP part_Prep (DetNP (DetQuant DefArt NumPl)))) (MassNP (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (ApposCN (AdvCN (UseN book_N) (PrepNP possess_Prep (DetNP (DetQuant DefArt NumPl)))) (MassNP (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (ApposCN (PartNP (UseN book_N) (DetNP (DetQuant DefArt NumPl))) (MassNP (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (ApposCN (PossNP (UseN book_N) (DetNP (DetQuant DefArt NumPl))) (MassNP (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (PartNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
Lang: MassNP (PossNP (UseN book_N) (DetCN (DetQuant DefArt NumSg) (UseN cat_N)))
|
||||||
|
LangEng: book of the cat
|
||||||
|
LangChi: 猫 的 书
|
||||||
|
|
||||||
|
-- You can also produce nonsensical variants, in all languages.
|
||||||
|
-- The point of RGL is to be a collection of syntactic structures,
|
||||||
|
-- and application grammarians can choose to use them in any combinations.
|
||||||
|
-- So the following English linearizations aren't *wrong*, they just don't make sense.
|
||||||
|
|
||||||
|
-- If theese Chinese linearizations are merely weird, like the English ones, then they are correct.
|
||||||
|
-- If they feel wrong in the same way as "his cat of my" would in English, then they are wrong.
|
||||||
|
Lang: DetCN (DetQuant (PossPron he_Pron) NumSg) (PossNP (UseN cat_N) (UsePron i_Pron))
|
||||||
|
LangEng: his cat of mine
|
||||||
|
LangChi: 他 的 我 的 猫
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (PossNP (UseN cat_N) (UsePron she_Pron))
|
||||||
|
LangEng: my cat of hers
|
||||||
|
LangChi: 我 的 她 的 猫
|
||||||
63
src/chinese/unittest/quantifier.gftest
Normal file
63
src/chinese/unittest/quantifier.gftest
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN somePl_Det (UseN cat_N))))
|
||||||
|
--LangChi: 我 有 一 些 只 猫
|
||||||
|
LangChi: 我 有 一 些 猫
|
||||||
|
LangEng: I have some cats
|
||||||
|
|
||||||
|
Lang: DetCN someSg_Det (UseN water_N)
|
||||||
|
--LangChi: 一 些 滴 水
|
||||||
|
LangChi: 一 些 水
|
||||||
|
LangEng: some water
|
||||||
|
|
||||||
|
Lang: DetCN someSg_Det (UseN beer_N)
|
||||||
|
--LangChi: 一 些 杯 啤 酒
|
||||||
|
LangChi: 一 些 啤 酒
|
||||||
|
LangEng: some beer
|
||||||
|
|
||||||
|
--LangChi: 我 有 几 只 猫
|
||||||
|
--LangEng: I have a few cats
|
||||||
|
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant IndefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 pot111)))))) (UseN cat_N)
|
||||||
|
LangChi: 十 一 只 猫
|
||||||
|
LangEng: eleven cats
|
||||||
|
|
||||||
|
Lang: DetCN many_Det (UseN cat_N)
|
||||||
|
LangChi: 很 多 猫
|
||||||
|
LangEng: many cats
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a have_V2) (DetCN many_Det (UseN child_N))))
|
||||||
|
LangChi: 我 想 有 很 多 孩 子
|
||||||
|
LangEng: I want to have many children
|
||||||
|
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant this_Quant NumPl) (UseN cat_N)
|
||||||
|
LangChi: 这 些 猫
|
||||||
|
LangEng: these cats
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant this_Quant NumSg) (UseN cat_N)
|
||||||
|
LangChi: 这 只 猫
|
||||||
|
LangEng: this cat
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant that_Quant NumPl) (UseN cat_N)))
|
||||||
|
LangChi: 我 喜 欢 那 些 猫
|
||||||
|
LangEng: I like those cats
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant that_Quant NumSg) (UseN cat_N)))
|
||||||
|
LangChi: 我 喜 欢 那 只 猫
|
||||||
|
LangEng: I like that cat
|
||||||
|
|
||||||
|
Lang: DetCN every_Det (UseN rule_N)
|
||||||
|
LangChi: 每 项 规 则
|
||||||
|
LangEng: every rule
|
||||||
|
|
||||||
|
Lang: DetCN few_Det (UseN child_N)
|
||||||
|
LangChi: 少 些 孩 子
|
||||||
|
LangEng: few children
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a have_V2) (DetCN few_Det (UseN child_N))))
|
||||||
|
LangChi: 我 想 有 少 些 孩 子
|
||||||
|
LangEng: I want to have few children
|
||||||
|
|
||||||
|
Lang: DetCN much_Det (UseN beer_N)
|
||||||
|
LangChi: 多 杯 啤 酒
|
||||||
|
LangEng: much beer
|
||||||
57
src/chinese/unittest/relative.gftest
Normal file
57
src/chinese/unittest/relative.gftest
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
--------------------------------------------------------------
|
||||||
|
-- Basics
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||||
|
LangEng: a cat that walks
|
||||||
|
LangChi: 一 只 走 的 猫
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||||
|
LangEng: a cat that drinks milk
|
||||||
|
LangChi: 一 只 喝 牛 奶 的 猫
|
||||||
|
|
||||||
|
Lang: MassNP (RelCN (UseN milk_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (SlashV2a drink_V2)))))
|
||||||
|
LangEng: milk that the cat drinks
|
||||||
|
LangChi: 猫 喝 的 牛 奶
|
||||||
|
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (VPSlashPrep (UseV walk_V) with_Prep) (DetCN (DetQuant DefArt NumSg) (UseN dog_N))))))
|
||||||
|
LangChi: 和 狗 一 起 走 的 猫
|
||||||
|
LangEng: the cat that walks with the dog
|
||||||
|
|
||||||
|
--------------------------------------------------------------
|
||||||
|
-- Determiner placement
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant this_Quant NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||||
|
LangEng: this cat that walks
|
||||||
|
LangChi: 这 只 走 的 猫
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||||
|
LangEng: my cat that drinks milk
|
||||||
|
LangChi: 我 的 喝 牛 奶 的 猫
|
||||||
|
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetNP (DetQuant this_Quant NumSg)) (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))))))
|
||||||
|
LangEng: this is the cat that walks
|
||||||
|
LangChi: 这 个 是 走 的 猫
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------
|
||||||
|
-- Complex example: "the book that his/her father gave him/her"
|
||||||
|
|
||||||
|
-- 1. His father gave him a book
|
||||||
|
Lang: UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (ComplN2 father_N2 (UsePron he_Pron))) (ComplSlash (Slash2V3 give_V3 (MassNP (UseN book_N))) (UsePron he_Pron)))
|
||||||
|
LangChi: 他 父 亲 把 书 给 了 他
|
||||||
|
|
||||||
|
-- 2. the book that the father of her gave her
|
||||||
|
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash3V3 give_V3 (UsePron she_Pron))))))
|
||||||
|
LangChi: 她 父 亲 给 了 她 的 书
|
||||||
|
LangEng: the book that the father of her gave her
|
||||||
|
|
||||||
|
-- I want to read the book that my father gave me
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (Slash3V3 give_V3 (UsePron i_Pron))))))))))
|
||||||
|
LangChi: 我 想 读 我 的 父 亲 给 了 我 的 书
|
||||||
|
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (SlashV2a read_V2)))))))))
|
||||||
|
LangChi: 我 想 读 我 的 父 亲 读 了 的 书
|
||||||
|
LangEng: I want to read the book that my father read
|
||||||
44
src/chinese/unittest/tenses.gftest
Normal file
44
src/chinese/unittest/tenses.gftest
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
-------------
|
||||||
|
-- Basics
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres AAnter) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V))
|
||||||
|
LangEng: the cat has walked
|
||||||
|
LangChi: 猫 走 了
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (UseV walk_V))
|
||||||
|
LangEng: this cat walks
|
||||||
|
LangChi: 这 只 猫 走
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (UseV walk_V))
|
||||||
|
LangEng: this cat will walk
|
||||||
|
LangChi: 这 只 猫 会 走
|
||||||
|
|
||||||
|
Lang: PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (ComplVV can8know_VV (UseV walk_V))
|
||||||
|
LangChi: 这 只 猫 会 走
|
||||||
|
LangEng: this cat can walk
|
||||||
|
|
||||||
|
Lang: PredVP (DetCN (DetQuant this_Quant NumSg) (UseN cat_N)) (ComplVV can_VV (UseV walk_V))
|
||||||
|
LangChi: 这 只 猫 能 走
|
||||||
|
LangEng: this cat can walk
|
||||||
|
|
||||||
|
-- As a verbal complement
|
||||||
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)) (ComplVV want_VV (UseV walk_V)))
|
||||||
|
LangChi: 我 的 猫 想 走
|
||||||
|
LangEng: my cat wants to walk
|
||||||
|
|
||||||
|
-- Transitive verbs
|
||||||
|
|
||||||
|
Lang: UseCl (TTAnt TPres AAnter) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a eat_V2) (DetCN (DetQuant IndefArt NumSg) (UseN fish_N))))
|
||||||
|
LangChi: 我 吃 了 一 条 鱼
|
||||||
|
LangEng: I have eaten a fish
|
||||||
|
|
||||||
|
-------------
|
||||||
|
-- Conditions
|
||||||
|
|
||||||
|
Lang: AdvS (SubjS if_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V)))
|
||||||
|
LangEng: if I walk the cat will walk
|
||||||
|
LangChi: 如 果 我 走 猫 会 走
|
||||||
|
|
||||||
|
Lang: ExtAdvS (SubjS when_Subj (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))) (UseCl (TTAnt TFut ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseV walk_V)))
|
||||||
|
LangEng: when I walk , the cat will walk
|
||||||
|
LangChi: 我 走 的 时 候 , 猫 会 走
|
||||||
@@ -89,8 +89,6 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
|
|||||||
Prep = {
|
Prep = {
|
||||||
s : Str ; -- "with", "ago"
|
s : Str ; -- "with", "ago"
|
||||||
isPre : Bool ; -- whether it's pre- or postposition: "with"=True, "ago"=False
|
isPre : Bool ; -- whether it's pre- or postposition: "with"=True, "ago"=False
|
||||||
isPoss : Bool ; -- whether it becomes "whose" in FunRP: "John, whose mother is wise"
|
|
||||||
empty : Str ; -- dummy empty string to avoid issues with parsing, if s field is replaced by "whose" in FunRP
|
|
||||||
} ;
|
} ;
|
||||||
CAdv = {s : Polarity => Str; p : Str} ;
|
CAdv = {s : Polarity => Str; p : Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ concrete ExtendEng of Extend =
|
|||||||
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {
|
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {
|
||||||
s = \\o,a =>
|
s = \\o,a =>
|
||||||
let
|
let
|
||||||
verb = vp.s ! t.t ! t.a ! p.p ! o ! a ; -- choice of Order determines aux or not
|
verb = mkVerbForms a vp ! t.t ! t.a ! p.p ! o ! a ; -- choice of Order determines aux or not
|
||||||
compl = vp.s2 ! a ++ vp.ext
|
compl = vp.s2 ! a ++ vp.ext
|
||||||
in {fin = verb.aux ++ t.s ++ p.s ;
|
in {fin = verb.aux ++ t.s ++ p.s ;
|
||||||
inf = verb.adv ++ vp.ad ! a ++ verb.fin ++ verb.inf ++ vp.p ++ compl} ;
|
inf = verb.adv ++ vp.ad ! a ++ verb.fin ++ verb.inf ++ vp.p ++ compl} ;
|
||||||
@@ -288,16 +288,12 @@ lin BaseImp = twoTable2 CPolarity ImpForm ;
|
|||||||
let
|
let
|
||||||
be = predAux auxBe ;
|
be = predAux auxBe ;
|
||||||
ppt = vps.ptp
|
ppt = vps.ptp
|
||||||
in {
|
in be ** {
|
||||||
s = be.s ;
|
p = [] ;
|
||||||
p = [] ;
|
ad = \\_ => [] ;
|
||||||
prp = be.prp ;
|
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
|
||||||
ptp = be.ptp ;
|
isSimple = False ;
|
||||||
inf = be.inf ;
|
ext = vps.ext
|
||||||
ad = \\_ => [] ;
|
|
||||||
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
|
|
||||||
isSimple = False ;
|
|
||||||
ext = vps.ext
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
MkVPS t p vp = {
|
MkVPS t p vp = {
|
||||||
s = \\a =>
|
s = \\a =>
|
||||||
let
|
let
|
||||||
verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ;
|
verb = mkVerbForms a vp ! t.t ! t.a ! p.p ! oDir ! a ;
|
||||||
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
||||||
in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
|
in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
|
||||||
} ;
|
} ;
|
||||||
@@ -180,17 +180,13 @@ lin
|
|||||||
let
|
let
|
||||||
be = predAux auxBe ;
|
be = predAux auxBe ;
|
||||||
ppt = vps.ptp
|
ppt = vps.ptp
|
||||||
in {
|
in be ** {
|
||||||
s = be.s ;
|
p = [] ;
|
||||||
p = [] ;
|
ad = \\_ => [] ;
|
||||||
prp = be.prp ;
|
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
|
||||||
ptp = be.ptp ;
|
isSimple = False ;
|
||||||
inf = be.inf ;
|
ext = vps.ext
|
||||||
ad = \\_ => [] ;
|
} ;
|
||||||
s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
|
|
||||||
isSimple = False ;
|
|
||||||
ext = vps.ext
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
PassVPSlash vps = passVPSlash vps [] ;
|
PassVPSlash vps = passVPSlash vps [] ;
|
||||||
@@ -242,7 +238,7 @@ lin
|
|||||||
let
|
let
|
||||||
subj = np.s ! npNom ;
|
subj = np.s ! npNom ;
|
||||||
agr = np.a ;
|
agr = np.a ;
|
||||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
verb = mkVerbForms agr vp ! t ! a ! b ! o ! agr ;
|
||||||
compl = vp.s2 ! agr
|
compl = vp.s2 ! agr
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
@@ -256,7 +252,7 @@ lin
|
|||||||
let
|
let
|
||||||
subj = np.s ! npNom ;
|
subj = np.s ! npNom ;
|
||||||
agr = np.a ;
|
agr = np.a ;
|
||||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
verb = mkVerbForms agr vp ! t ! a ! b ! o ! agr ;
|
||||||
compl = vp.s2 ! agr
|
compl = vp.s2 ! agr
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
|
|||||||
@@ -44,4 +44,3 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ UseV,ComplVV,ComplVS,ComplVQ,ComplVA,SlashV2a,SlashV2V,SlashV2A,SlashV2S,Slash2V
|
|||||||
UseV,UseComp {"to"} PART mark head
|
UseV,UseComp {"to"} PART mark head
|
||||||
UseComp,CompAdv,CompAP,CompNP,CompCN,ProgrVP,QuestIComp {"is","are","am","was","were","been","be"} VERB cop head
|
UseComp,CompAdv,CompAP,CompNP,CompCN,ProgrVP,QuestIComp {"is","are","am","was","were","been","be"} VERB cop head
|
||||||
CompCN {"a","an"} DET det head
|
CompCN {"a","an"} DET det head
|
||||||
PassV2 {"is","are","am","was","were""been","be"} VERB auxpass head
|
PassV2 {"is","are","am","was","were""been","be"} VERB aux:pass head
|
||||||
ComplVV {"to"} PART mark xcomp
|
ComplVV {"to"} PART mark xcomp
|
||||||
ComplVS {"that"} PART mark ccomp
|
ComplVS {"that"} PART mark ccomp
|
||||||
EmbedVP {"to"} PART mark head
|
EmbedVP {"to"} PART mark head
|
||||||
EmbedS {"that"} PART mark head
|
EmbedS {"that"} PART mark head
|
||||||
SentCN {"that","to"} PART mark acl
|
SentCN {"that","to"} PART mark acl
|
||||||
ExtAdvS,SubjS {","} PUNCT punct head
|
ConsNP,ExtAdvS,SSubjS,VocNP {","} PUNCT punct head
|
||||||
ExistNPAdv,ExistNP {"not","don't","doesn't","didn't","haven't","hasn't","hadn't","wouldn't","won't","isn't","aren't","wasn't","weren't"} PART neg head
|
ExistNPAdv,ExistNP {"not","don't","doesn't","didn't","haven't","hasn't","hadn't","wouldn't","won't","isn't","aren't","wasn't","weren't"} PART neg head
|
||||||
ExistNPAdv,ExistNP {"has","had","have","will","would","do","does","did"} AUX aux head
|
ExistNPAdv,ExistNP {"has","had","have","will","would","do","does","did"} AUX aux head
|
||||||
ExistNPAdv,ExistNP {"is","are","am","was","were""been","be"} VERB cop head
|
ExistNPAdv,ExistNP {"is","are","am","was","were""been","be"} VERB cop head
|
||||||
@@ -34,9 +34,3 @@ PossNP,PartNP {"of"} ADP case nmod
|
|||||||
@"am" PresSg1
|
@"am" PresSg1
|
||||||
@"is" PresSg3
|
@"is" PresSg3
|
||||||
@"are" PresPl
|
@"are" PresPl
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
|||||||
|
|
||||||
DetNP det = {
|
DetNP det = {
|
||||||
-- s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ;
|
-- s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ;
|
||||||
s = det.sp ! Neutr ! False ;
|
s = \\c => det.sp ! Neutr ! False ! c ;
|
||||||
a = agrP3 det.n
|
a = agrP3 det.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -539,18 +539,12 @@ mkVoc s = lin Voc (ss s) ;
|
|||||||
mkPrep p = lin Prep {
|
mkPrep p = lin Prep {
|
||||||
s = p ; -- the string: "with", "in front of"
|
s = p ; -- the string: "with", "in front of"
|
||||||
isPre = True ; -- default case: it is a preposition, not postposition
|
isPre = True ; -- default case: it is a preposition, not postposition
|
||||||
isPoss = False ; -- default case: not possessive (i.e. no change in FunRP)
|
|
||||||
empty = [] -- dummy field to prevent an issue with parsing. only relevant when isPoss=True, and FunRP overrides the s field with "whose". for explanation of the issue, see https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#metavariables-or-those-question-marks-that-appear-when-parsing
|
|
||||||
} ;
|
} ;
|
||||||
mkPost p = mkPrep p ** {
|
mkPost p = mkPrep p ** {
|
||||||
isPre = False -- postposition: e.g. "ago"
|
isPre = False -- postposition: e.g. "ago"
|
||||||
} ;
|
} ;
|
||||||
noPrep = mkPrep [] ;
|
noPrep = mkPrep [] ;
|
||||||
|
|
||||||
possPrep : Str -> Prep = \p -> mkPrep p ** {
|
|
||||||
isPoss = True -- for possessive, FunRP overrides the Prep's string with "whose":
|
|
||||||
} ; -- e.g. "whose mother" instead of "mother of which"
|
|
||||||
|
|
||||||
mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ;
|
mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ;
|
||||||
|
|
||||||
regV cry =
|
regV cry =
|
||||||
@@ -624,7 +618,7 @@ mkVoc s = lin Voc (ss s) ;
|
|||||||
auxVV, infVV = \v -> lin VV {
|
auxVV, infVV = \v -> lin VV {
|
||||||
s = table {
|
s = table {
|
||||||
VVF vf => v.s ! vf ;
|
VVF vf => v.s ! vf ;
|
||||||
VVPresNeg => v.s ! VPres ++ "not"
|
VVPresNeg => v.s ! VPres ++ "not"
|
||||||
; VVPastNeg => v.s ! VPast ++ "not" --# notpresent
|
; VVPastNeg => v.s ! VPast ++ "not" --# notpresent
|
||||||
} ;
|
} ;
|
||||||
p = v.p ;
|
p = v.p ;
|
||||||
@@ -703,7 +697,7 @@ mkVoc s = lin Voc (ss s) ;
|
|||||||
mkA : (fat,fatter : Str) -> A = \fat,fatter ->
|
mkA : (fat,fatter : Str) -> A = \fat,fatter ->
|
||||||
lin A (mkAdjective fat fatter (init fatter + "st") (adj2adv fat)) ;
|
lin A (mkAdjective fat fatter (init fatter + "st") (adj2adv fat)) ;
|
||||||
mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
|
mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
|
||||||
lin A (mkAdjective a b c d)
|
lin A (mkAdjective a b c d)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
invarA s = lin A {
|
invarA s = lin A {
|
||||||
|
|||||||
@@ -32,16 +32,10 @@ concrete RelativeEng of Relative = CatEng ** open ResEng, Prelude in {
|
|||||||
c = NPAcc
|
c = NPAcc
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- John , whose every friend is right
|
-- a number, [the square of which] is 4
|
||||||
|
-- For a construction like "John , [whose every friend] is right", use Extend.GenRP
|
||||||
FunRP p np rp = {
|
FunRP p np rp = {
|
||||||
s = \\c =>
|
s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
|
||||||
let npGender : Gender = (fromAgr np.a).g in
|
|
||||||
case p.isPoss of {
|
|
||||||
True => rp.s ! RC npGender NPNomPoss ++ -- whose
|
|
||||||
p.empty ++ -- empty string to avoid metavariables
|
|
||||||
np.s ! NCase Nom ; -- NP in nom: "whose every friend"
|
|
||||||
False => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep npGender
|
|
||||||
} ;
|
|
||||||
a = RAg np.a
|
a = RAg np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -159,12 +159,12 @@ param
|
|||||||
s = table {
|
s = table {
|
||||||
AAdj Posit c => adjCompar.s ! AAdj Posit c ;
|
AAdj Posit c => adjCompar.s ! AAdj Posit c ;
|
||||||
AAdv => adjCompar.s ! AAdv ;
|
AAdv => adjCompar.s ! AAdv ;
|
||||||
_ => nonExist } ; -- IL 06/2021. Replace with an actual string, if this causes problems.
|
_ => nonExist } ; -- IL 2021-06. Replace with an actual string, if this causes problems.
|
||||||
isMost = True } ;
|
isMost = True } ;
|
||||||
_ => adjCompar
|
_ => adjCompar
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- IL 06/2021: remove "more" and "most" from A & A2's inflection table
|
-- IL 2021-06: remove "more" and "most" from A & A2's inflection table
|
||||||
getCompar : Case -> Adjective -> Str = \c,a -> case a.isMost of {
|
getCompar : Case -> Adjective -> Str = \c,a -> case a.isMost of {
|
||||||
True => "more" ++ a.s ! AAdj Posit c ;
|
True => "more" ++ a.s ! AAdj Posit c ;
|
||||||
False => a.s ! AAdj Compar c
|
False => a.s ! AAdj Compar c
|
||||||
@@ -252,18 +252,59 @@ param
|
|||||||
Tense => Anteriority => CPolarity => Order => Agr =>
|
Tense => Anteriority => CPolarity => Order => Agr =>
|
||||||
{aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept
|
{aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept
|
||||||
|
|
||||||
VP : Type = {
|
{- IL 2022-04: reduce the fields in VP and make the grammar better suited for morphological analysis
|
||||||
s : VerbForms ;
|
All verbs except auxiliaries only need 6 forms inside VP, and other forms can be built in PredVP.
|
||||||
p : Str ; -- verb particle
|
Auxiliaries need more forms. So we make VP an extension of Aux, and add a parameter that tells
|
||||||
prp : Str ; -- present participle
|
which strategy to use when building a Cl: use the 4 forms, or use the fields in Aux.
|
||||||
ptp : Str ; -- past participle
|
(If we treat auxiliaries as normal verbs, we get "you don't be __" for "you aren't __".)
|
||||||
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
|
||||||
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
|
|
||||||
s2 : Agr => Str ; -- complement
|
|
||||||
ext : Str ; -- extreposed field such as S, QS, VP
|
|
||||||
isSimple : Bool -- regulates the place of participle used as adjective
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
If we didn't care about morphological lexicon, we could just fill the Aux fields for all verbs:
|
||||||
|
morphologically distinct forms like "can't" for auxiliaries, and periphrastic constructions
|
||||||
|
like "doesn't sing/eat/play" for other verbs. However, then morphologically analysing the word
|
||||||
|
"doesn't" returns every single function that constructs a VP, which clutters morpho analysis.
|
||||||
|
|
||||||
|
So we use two sets of fields and a parameter for which strategy to choose in PredVP. This results
|
||||||
|
in significantly fewer fields than previously, and is better for morphological analysis.
|
||||||
|
-}
|
||||||
|
VP : Type = {
|
||||||
|
-- The common parts
|
||||||
|
p : Str ; -- verb particle
|
||||||
|
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
|
||||||
|
s2 : Agr => Str ; -- complement
|
||||||
|
ext : Str ; -- extreposed field such as S, QS, VP
|
||||||
|
prp : Str ; -- present participle
|
||||||
|
ptp : Str ; -- past participle
|
||||||
|
inf : Str ; -- the infinitive form
|
||||||
|
isSimple : Bool ; -- regulates the place of participle used as adjective
|
||||||
|
|
||||||
|
-- The variable parts, depending on whether the main verb of the VP is auxiliary or not
|
||||||
|
isAux : Bool ;
|
||||||
|
auxForms : { -- nonExist when isAux=False
|
||||||
|
past, --# notpresent
|
||||||
|
contr,
|
||||||
|
pres : Polarity => Agr => Str ;
|
||||||
|
} ;
|
||||||
|
nonAuxForms : { -- nonExist when isAux=True
|
||||||
|
pres : Agr => Str ; -- sing/sings ; can be streamlined into two forms if needed
|
||||||
|
past : Str ; --# notpresent
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- called from mkClause, when we finally put together all forms for a Cl
|
||||||
|
mkVerbForms : Agr -> VP -> VerbForms = \agr,vp -> case vp.isAux of {
|
||||||
|
True =>
|
||||||
|
let aux : Aux = vp.auxForms ** {
|
||||||
|
inf = vp.inf ;
|
||||||
|
ppart = vp.ptp ;
|
||||||
|
prpart = vp.prp } ;
|
||||||
|
in auxVerbForms aux ;
|
||||||
|
False =>
|
||||||
|
let fin : Str = vp.nonAuxForms.pres ! agr ;
|
||||||
|
inf : Str = vp.inf ;
|
||||||
|
part : Str = vp.ptp ;
|
||||||
|
in nonAuxVerbForms fin inf part
|
||||||
|
vp.nonAuxForms.past --# notpresent
|
||||||
|
} ;
|
||||||
|
|
||||||
SlashVP = VP ** {c2 : Str ;
|
SlashVP = VP ** {c2 : Str ;
|
||||||
gapInMiddle : Bool;
|
gapInMiddle : Bool;
|
||||||
@@ -276,20 +317,57 @@ param
|
|||||||
cBind : Str -> Str = \s -> Predef.BIND ++ ("'" + s) ;
|
cBind : Str -> Str = \s -> Predef.BIND ++ ("'" + s) ;
|
||||||
|
|
||||||
predV : Verb -> VP = \verb -> {
|
predV : Verb -> VP = \verb -> {
|
||||||
s = \\t,ant,b,ord,agr =>
|
p = verb.p ; -- Common to all verbs
|
||||||
let
|
prp = verb.s ! VPresPart ;
|
||||||
inf = verb.s ! VInf ;
|
ptp = verb.s ! VPPart ;
|
||||||
fin = presVerb verb agr ;
|
inf = verb.s ! VInf ;
|
||||||
part = verb.s ! VPPart ;
|
ad = \\_ => [] ;
|
||||||
in
|
ext = [] ;
|
||||||
case <t,ant,b,ord> of {
|
isSimple = True ; ---- but really depends on whether p == []
|
||||||
|
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) [] ;
|
||||||
|
|
||||||
|
isAux = False ; -- Specific to non-Aux verbs
|
||||||
|
auxForms = {
|
||||||
|
contr,
|
||||||
|
past, --# notpresent
|
||||||
|
pres = \\_,_ => nonExist} ;
|
||||||
|
nonAuxForms = {
|
||||||
|
pres = \\agr => presVerb verb agr ;
|
||||||
|
past = verb.s ! VPast ; --# notpresent
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
predAux : Aux -> VP = \aux -> {
|
||||||
|
p = [] ; -- Common to all verbs
|
||||||
|
prp = aux.prpart ;
|
||||||
|
ptp = aux.ppart ;
|
||||||
|
inf = aux.inf ;
|
||||||
|
ad = \\_ => [] ;
|
||||||
|
ext = [] ;
|
||||||
|
isSimple = True ;
|
||||||
|
s2 = \\_ => [] ;
|
||||||
|
|
||||||
|
isAux = True ; -- Specific to Aux verbs
|
||||||
|
auxForms = aux ;
|
||||||
|
nonAuxForms = {
|
||||||
|
past = nonExist ; --# notpresent
|
||||||
|
pres = \\_ => nonExist}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
nonAuxVerbForms : (fin,inf,part : Str) ->
|
||||||
|
(past : Str) -> --# notpresent
|
||||||
|
VerbForms = \fin,inf,part
|
||||||
|
,past --# notpresent
|
||||||
|
->
|
||||||
|
\\tns,ant,pol,ord,agr =>
|
||||||
|
case <tns,ant,pol,ord> of {
|
||||||
<Pres,Simul,CPos,ODir _> => vff fin [] ;
|
<Pres,Simul,CPos,ODir _> => vff fin [] ;
|
||||||
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
|
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
|
||||||
<Pres,Anter,CPos,ODir True> => vf (haveContr agr) part ; --# notpresent
|
<Pres,Anter,CPos,ODir True> => vf (haveContr agr) part ; --# notpresent
|
||||||
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||||
<Pres,Anter,CNeg c,ODir True> => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent
|
<Pres,Anter,CNeg c,ODir True> => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent
|
||||||
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent 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,ODir _> => vff past [] ; --# notpresent
|
||||||
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
|
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
|
||||||
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
|
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
|
||||||
<Past,Anter,CPos,ODir True> => vf (cBind "d") part ; --# notpresent
|
<Past,Anter,CPos,ODir True> => vf (cBind "d") part ; --# notpresent
|
||||||
@@ -314,18 +392,9 @@ param
|
|||||||
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("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
|
<Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf
|
||||||
} ;
|
} ;
|
||||||
p = verb.p ;
|
|
||||||
prp = verb.s ! VPresPart ;
|
|
||||||
ptp = verb.s ! VPPart ;
|
|
||||||
inf = verb.s ! VInf ;
|
|
||||||
ad = \\_ => [] ;
|
|
||||||
ext = [] ;
|
|
||||||
isSimple = True ; ---- but really depends on whether p == []
|
|
||||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
|
||||||
} ;
|
|
||||||
|
|
||||||
predAux : Aux -> VP = \verb -> {
|
auxVerbForms : Aux -> VerbForms = \verb ->
|
||||||
s = \\t,ant,cb,ord,agr =>
|
\\t,ant,cb,ord,agr =>
|
||||||
let
|
let
|
||||||
b = case cb of {
|
b = case cb of {
|
||||||
CPos => Pos ;
|
CPos => Pos ;
|
||||||
@@ -371,17 +440,7 @@ param
|
|||||||
<Pres,Simul,CPos, _> => vf fin [] ;
|
<Pres,Simul,CPos, _> => vf fin [] ;
|
||||||
<Pres,Simul,CNeg c,ODir True> => vfn c cfinp fin [] ;
|
<Pres,Simul,CNeg c,ODir True> => vfn c cfinp fin [] ;
|
||||||
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
||||||
|
} ;
|
||||||
} ;
|
|
||||||
p = [] ;
|
|
||||||
prp = verb.prpart ;
|
|
||||||
ptp = verb.ppart ;
|
|
||||||
inf = verb.inf ;
|
|
||||||
ad = \\_ => [] ;
|
|
||||||
ext = [] ;
|
|
||||||
isSimple = True ;
|
|
||||||
s2 = \\_ => []
|
|
||||||
} ;
|
|
||||||
|
|
||||||
vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y ->
|
vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y ->
|
||||||
{aux = [] ; adv = [] ; fin = x ; inf = y} ;
|
{aux = [] ; adv = [] ; fin = x ; inf = y} ;
|
||||||
@@ -395,7 +454,7 @@ param
|
|||||||
False => {aux = x ; adv = "not" ; fin = [] ; inf = z}
|
False => {aux = x ; adv = "not" ; fin = [] ; inf = z}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{- IL 24/04/2018 To fix scope of reflexives:
|
{- IL 2018-04 To fix scope of reflexives:
|
||||||
a) ComplSlash ( … ReflVP … ) X: reflexive should agree with X
|
a) ComplSlash ( … ReflVP … ) X: reflexive should agree with X
|
||||||
LangEng> l PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ReflVP (SlashV2a like_V2))) (UsePron he_Pron))
|
LangEng> l PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ReflVP (SlashV2a like_V2))) (UsePron he_Pron))
|
||||||
I beg him to like /himself/
|
I beg him to like /himself/
|
||||||
@@ -421,42 +480,22 @@ param
|
|||||||
insertExtra obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
|
insertExtra obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
|
||||||
|
|
||||||
--- AR 7/3/2013 move the particle after the object
|
--- AR 7/3/2013 move the particle after the object
|
||||||
insertObjPartLast : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
insertObjPartLast : (Agr => Str) -> VP -> VP = \obj,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
p = [] ; -- remove particle from here
|
p = [] ; -- remove particle from here
|
||||||
prp = vp.prp ;
|
|
||||||
ptp = vp.ptp ;
|
|
||||||
inf = vp.inf ;
|
|
||||||
ad = vp.ad ;
|
|
||||||
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre
|
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre
|
||||||
isSimple = False ;
|
isSimple = False ;
|
||||||
ext = vp.ext
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--- The adverb should be before the finite verb.
|
--- The adverb should be before the finite verb.
|
||||||
|
|
||||||
insertAdV : Str -> VP -> VP = \ad -> insertAdVAgr (\\_ => ad) ;
|
insertAdV : Str -> VP -> VP = \ad -> insertAdVAgr (\\_ => ad) ;
|
||||||
|
|
||||||
insertAdVAgr : (Agr => Str) -> VP -> VP = \ad,vp -> {
|
insertAdVAgr : (Agr => Str) -> VP -> VP = \ad,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
p = vp.p ;
|
|
||||||
prp = vp.prp ;
|
|
||||||
ptp = vp.ptp ;
|
|
||||||
inf = vp.inf ;
|
|
||||||
ad = \\a => vp.ad ! a ++ ad ! a ;
|
ad = \\a => vp.ad ! a ++ ad ! a ;
|
||||||
s2 = \\a => vp.s2 ! a ;
|
|
||||||
isSimple = False ;
|
isSimple = False ;
|
||||||
ext = vp.ext
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertExtra : Str -> VP -> VP = \e,vp -> {
|
insertExtra : Str -> VP -> VP = \e,vp -> vp ** {
|
||||||
s = vp.s ;
|
|
||||||
p = vp.p ;
|
|
||||||
prp = vp.prp ;
|
|
||||||
ptp = vp.ptp ;
|
|
||||||
inf = vp.inf ;
|
|
||||||
ad = vp.ad ;
|
|
||||||
s2 = vp.s2 ;
|
|
||||||
isSimple = False ;
|
isSimple = False ;
|
||||||
ext = vp.ext ++ e --- there should be at most one, one might think; but: I would say that it will be raining if I saw clouds
|
ext = vp.ext ++ e --- there should be at most one, one might think; but: I would say that it will be raining if I saw clouds
|
||||||
} ;
|
} ;
|
||||||
@@ -523,7 +562,7 @@ param
|
|||||||
haveContr = agrVerb (cBind "s") (cBind "ve") ;
|
haveContr = agrVerb (cBind "s") (cBind "ve") ;
|
||||||
haventContr = agrVerb (cBind "s not") (cBind "ve not") ;
|
haventContr = agrVerb (cBind "s not") (cBind "ve not") ;
|
||||||
|
|
||||||
Aux = {
|
Aux : Type = {
|
||||||
pres : Polarity => Agr => Str ;
|
pres : Polarity => Agr => Str ;
|
||||||
contr : Polarity => Agr => Str ; -- contracted forms
|
contr : Polarity => Agr => Str ; -- contracted forms
|
||||||
past : Polarity => Agr => Str ; --# notpresent
|
past : Polarity => Agr => Str ; --# notpresent
|
||||||
@@ -589,7 +628,7 @@ param
|
|||||||
\subj,agr,vp -> {
|
\subj,agr,vp -> {
|
||||||
s = \\t,a,b,o =>
|
s = \\t,a,b,o =>
|
||||||
let
|
let
|
||||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
verb = mkVerbForms agr vp ! t ! a ! b ! o ! agr ;
|
||||||
compl = vp.s2 ! agr ++ vp.ext
|
compl = vp.s2 ! agr ++ vp.ext
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ concrete StructuralEng of Structural = CatEng **
|
|||||||
otherwise_PConj = ss "otherwise" ;
|
otherwise_PConj = ss "otherwise" ;
|
||||||
part_Prep = mkPrep "of" ;
|
part_Prep = mkPrep "of" ;
|
||||||
please_Voc = ss "please" ;
|
please_Voc = ss "please" ;
|
||||||
possess_Prep = possPrep "of" ;
|
possess_Prep = mkPrep "of" ;
|
||||||
quite_Adv = mkAdv "quite" ;
|
quite_Adv = mkAdv "quite" ;
|
||||||
she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ;
|
she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ;
|
||||||
so_AdA = mkAdA "so" ;
|
so_AdA = mkAdA "so" ;
|
||||||
@@ -159,4 +159,3 @@ concrete StructuralEng of Structural = CatEng **
|
|||||||
lin language_title_Utt = ss "English" ;
|
lin language_title_Utt = ss "English" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,37 @@
|
|||||||
-- IdRP: no difference between animate/inanimate
|
-- IdRP: no difference between animate/inanimate
|
||||||
Lang: RelCN (UseN friend_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
|
AllEngAbs: RelCN (UseN friend_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
|
||||||
LangEng: friend that everybody loves
|
AllEng: friend that everybody loves
|
||||||
|
|
||||||
Lang: RelCN (UseN computer_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
|
AllEngAbs: RelCN (UseN computer_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP everybody_NP (SlashV2a love_V2))))
|
||||||
LangEng: computer that everybody loves
|
AllEng: computer that everybody loves
|
||||||
|
|
||||||
|
|
||||||
-- IdRP possessive, RelVP
|
-- IdRP + possess_Prep, RelSlash
|
||||||
Lang: RelCN (UseN teacher_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (FunRP possess_Prep (DetCN every_Det (UseN friend_N)) IdRP) (UseV run_V)))
|
AllEngAbs: PredVP (RelNP (DetCN (DetQuant DefArt NumSg) (UseN boss_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP possess_Prep (MassNP (UseN computer_N)) IdRP) (SlashVP everybody_NP (SlashV2a love_V2))))) (UseComp (CompAdv here_Adv))
|
||||||
LangEng: teacher whose every friend runs
|
AllEng: the boss , computer of which everybody loves , is here
|
||||||
|
|
||||||
Lang: RelCN (UseN car_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (FunRP possess_Prep (MassNP (UseN oil_N)) IdRP) (UseV run_V)))
|
-- IdRP + part_Prep, RelSlash
|
||||||
LangEng: car whose oil runs
|
AllEngAbs: RelNP (MassNP (UseN butter_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP part_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stick_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a eat_V2))))
|
||||||
|
AllEng: butter , a stick of which I eat
|
||||||
|
|
||||||
-- IdRP possessive, RelSlash
|
-- GenRP + RelVP
|
||||||
Lang: RelNP (DetCN (DetQuant DefArt NumSg) (UseN boss_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP possess_Prep (MassNP (UseN computer_N)) IdRP) (SlashVP everybody_NP (SlashV2a love_V2))))
|
-- NB. with GenRP, can't parse "teacher whose every friend runs", because GenRP takes only a CN
|
||||||
LangEng: the boss , whose computer everybody loves
|
AllEngAbs: RelCN (UseN teacher_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (GenRP NumSg (UseN friend_N)) (UseV run_V)))
|
||||||
|
AllEng: teacher whose friend runs
|
||||||
|
|
||||||
Lang: RelNP (DetCN (DetQuant DefArt NumSg) (UseN restaurant_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP possess_Prep (MassNP (UseN fruit_N)) IdRP) (SlashVP everybody_NP (SlashV2a love_V2))))
|
AllEngAbs: RelCN (UseN car_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP (GenRP NumSg (UseN oil_N)) (UseV run_V)))
|
||||||
LangEng: the restaurant , whose fruit everybody loves
|
AllEng: car whose oil runs
|
||||||
|
|
||||||
-- Note that every instance of "of" is not possessive—with part_Prep, we get "beer, a glass of which I drink"
|
-- GenRP + RelSlash
|
||||||
-- unfortunately glass_N is not in lexicon, so I substituted words with others
|
AllEngAbs: PredVP (RelNP (DetCN (DetQuant DefArt NumSg) (UseN boss_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (GenRP NumSg (UseN computer_N)) (SlashVP everybody_NP (SlashV2a love_V2))))) (UseComp (CompAdv here_Adv))
|
||||||
Lang: RelNP (MassNP (UseN butter_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (FunRP part_Prep (DetCN (DetQuant IndefArt NumSg) (UseN stick_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a eat_V2))))
|
AllEng: the boss , whose computer everybody loves , is here
|
||||||
LangEng: butter , a stick of which I eat
|
|
||||||
|
AllEngAbs: PredVP (RelNP (DetCN (DetQuant DefArt NumSg) (UseN restaurant_N)) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash (GenRP NumSg (UseN fruit_N)) (SlashVP everybody_NP (SlashV2a love_V2))))) (UseComp (CompAdv here_Adv))
|
||||||
|
AllEng: the restaurant , whose fruit everybody loves , is here
|
||||||
|
|
||||||
-- IdRP other, RelSlash
|
-- IdRP other, RelSlash
|
||||||
-- RelVP really doesn't make sense–the preposition in FunRP looks like an object complement?
|
-- RelVP really doesn't make sense–the preposition in FunRP looks like an object complement?
|
||||||
-- e.g. "Paris , the best city *in* which *I have lived* -- gap: "I have loved *in Paris*
|
-- e.g. "Paris , the best city *in* which *I have lived* -- gap: "I have lived *in Paris*
|
||||||
-- for RelVP, the noun is a subject:
|
-- for RelVP, the noun is a subject:
|
||||||
-- e.g. "Paris , the best city ∅ which sleeps" -- no gap: "Paris sleeps"
|
-- e.g. "Paris , the best city ∅ which sleeps" -- no gap: "Paris sleeps"
|
||||||
|
|
||||||
@@ -38,16 +42,18 @@ LangEng: butter , a stick of which I eat
|
|||||||
|
|
||||||
-- Transitive verb + preposition in RP
|
-- Transitive verb + preposition in RP
|
||||||
-- The RP is the whole [the best city in which]
|
-- The RP is the whole [the best city in which]
|
||||||
Lang: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP in_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (UseN city_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a love_V2))))
|
-- We can't even do "lived in", because because live_V is intransitive and RelSlash requires transitive.
|
||||||
LangEng: Paris , the best city in which I have loved
|
-- So let's switch to love_V2 instead.
|
||||||
|
AllEngAbs: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP in_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (UseN city_N)) IdRP) (SlashVP (UsePron i_Pron) (SlashV2a love_V2))))
|
||||||
|
AllEng: Paris , the best city in which I have loved
|
||||||
|
|
||||||
-- Intransitive verb + preposition in ClSlash
|
-- Intransitive verb + preposition in ClSlash
|
||||||
-- The RP is just [that]
|
-- The RP is just [that]
|
||||||
Lang: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))
|
AllEngAbs: RelNP (UsePN paris_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))
|
||||||
LangEng: Paris , that I have lived in
|
AllEng: Paris , that I have lived in
|
||||||
|
|
||||||
Lang: PredVP (UsePN paris_PN) (UseComp (CompNP (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (RelCN (UseN city_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))))))
|
AllEngAbs: PredVP (UsePN paris_PN) (UseComp (CompNP (DetCN (DetQuantOrd DefArt NumSg (OrdSuperl good_A)) (RelCN (UseN city_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashPrep (PredVP (UsePron i_Pron) (UseV live_V)) in_Prep)))))))
|
||||||
LangEng: Paris is the best city that I have lived in
|
AllEng: Paris is the best city that I have lived in
|
||||||
|
|
||||||
-- to get "… city I have lived in", use Extend.EmptyRelSlash in place of RelSlash
|
-- to get "… city I have lived in", use Extend.EmptyRelSlash in place of RelSlash
|
||||||
|
|
||||||
@@ -55,36 +61,33 @@ LangEng: Paris is the best city that I have lived in
|
|||||||
-- Now let's do complicated structures!
|
-- Now let's do complicated structures!
|
||||||
|
|
||||||
-- FunRP + ditransitive verb. The whole string is the RS, and the substring [the first car to which] is the RP.
|
-- FunRP + ditransitive verb. The whole string is the RS, and the substring [the first car to which] is the RP.
|
||||||
Lang: UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))
|
AllEngAbs: UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))
|
||||||
LangEng: the first car to which I have given oil
|
AllEng: the first car to which I have given oil
|
||||||
|
|
||||||
-- IdRP + ditransitive verb. The whole string is now a NP, and RS is just a small part of it: [[that]:RP I have given oil]:RS
|
-- IdRP + ditransitive verb. The whole string is now a NP, and RS is just a small part of it: [[that]:RP I have given oil]:RS
|
||||||
Lang: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN car_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))))
|
AllEngAbs: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN car_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N)))))))
|
||||||
LangEng: the first car that I have given oil
|
AllEng: the first car that I have given oil
|
||||||
|
|
||||||
-- IdRP + ditransitive verb, but the verb has an inherent preposition
|
-- IdRP + ditransitive verb, but the verb has an inherent preposition
|
||||||
Lang: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN country_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 sell_V3 (MassNP (UseN oil_N)))))))
|
AllEngAbs: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN country_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 sell_V3 (MassNP (UseN oil_N)))))))
|
||||||
LangEng: the first country that I have sold oil to
|
AllEng: the first country that I have sold oil to
|
||||||
|
|
||||||
-- let's test with Slash3V3 for completeness' sake
|
-- let's test with Slash3V3 for completeness' sake
|
||||||
Lang: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN oil_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash3V3 sell_V3 (DetCN (DetQuant IndefArt NumSg) (UseN country_N)))))))
|
AllEngAbs: DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN oil_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash3V3 sell_V3 (DetCN (DetQuant IndefArt NumSg) (UseN country_N)))))))
|
||||||
LangEng: the first oil that I have sold to a country
|
AllEng: the first oil that I have sold to a country
|
||||||
|
|
||||||
|
|
||||||
-- FunRP + ditransitive verb, now in a context
|
-- FunRP + ditransitive verb, now in a context
|
||||||
-- Suppose that I have a car named John. Now the relative pronoun "which" is chosen after the noun "car".
|
-- Suppose that I have a car named John. Now the relative pronoun "which" is chosen after the noun "car".
|
||||||
Lang: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N))))))
|
AllEngAbs: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN car_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN oil_N))))))
|
||||||
LangEng: John , the first car to which I have given oil
|
AllEng: John , the first car to which I have given oil
|
||||||
|
|
||||||
-- Suppose that I have a friend named John. Now the relative pronoun "who" is chosen after the noun "friend".
|
-- Suppose that I have a friend named John. Now the relative pronoun "who" is chosen after the noun "friend".
|
||||||
Lang: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN friend_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))
|
AllEngAbs: RelNP (UsePN john_PN) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash (FunRP to_Prep (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN friend_N)) IdRP) (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))
|
||||||
LangEng: John , my first friend to who I have given beer
|
AllEng: John , my first friend to who I have given beer
|
||||||
|
|
||||||
|
|
||||||
-- If I really wanted to describe "John , my first friend […]", I would prefer using Extend.ApposNP to get a tree that makes more sense
|
-- If I really wanted to describe "John , my first friend […]", I would prefer using Extend.ApposNP to get a tree that makes more sense
|
||||||
-- this doesn't linearise in core RGL, but here's the tree:
|
-- this doesn't linearise in core RGL, but here's the tree:
|
||||||
-- ApposNP (UsePN john_PN) (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN friend_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))))
|
AllEngAbs: ApposNP (UsePN john_PN) (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN friend_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))))
|
||||||
-- approximating with ApposCN (which doesn't add comma):
|
AllEng: John , the first friend that I have given beer
|
||||||
|
|
||||||
Lang: ApposCN (UseN boy_N) (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (RelCN (UseN friend_N) (UseRCl (TTAnt TPres AAnter) PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (Slash2V3 give_V3 (MassNP (UseN beer_N))))))))
|
|
||||||
LangEng: boy the first friend that I have given beer
|
|
||||||
@@ -11,15 +11,15 @@ concrete AdjectiveEst of Adjective = CatEst ** open ResEst, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
ComparA a np = {
|
ComparA a np = {
|
||||||
s = \\isMod,af => case isMod of {
|
s = \\isMod,af => case isMod of {
|
||||||
True => np.s ! NPCase Elat ++ a.s ! Compar ! AN af ; -- minust suurem
|
True => linNP (NPCase Elat) np ++ a.s ! Compar ! AN af ; -- minust suurem
|
||||||
_ => a.s ! Compar ! AN af ++ "kui" ++ np.s ! NPCase Nom -- suurem kui mina
|
_ => a.s ! Compar ! AN af ++ "kui" ++ linNP (NPCase Nom) np -- suurem kui mina
|
||||||
} ;
|
} ;
|
||||||
infl = Regular ; --a.infl
|
infl = Regular ; --a.infl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
CAdvAP ad ap np = {
|
CAdvAP ad ap np = {
|
||||||
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ np.s ! NPCase Nom ;
|
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ linNP (NPCase Nom) np ;
|
||||||
infl = ap.infl
|
infl = ap.infl
|
||||||
} ;
|
} ;
|
||||||
UseComparA a = {
|
UseComparA a = {
|
||||||
s = \\_,nf => a.s ! Compar ! AN nf ;
|
s = \\_,nf => a.s ! Compar ! AN nf ;
|
||||||
@@ -34,14 +34,14 @@ concrete AdjectiveEst of Adjective = CatEst ** open ResEst, Prelude in {
|
|||||||
|
|
||||||
|
|
||||||
ComplA2 adj np = {
|
ComplA2 adj np = {
|
||||||
s = \\isMod,af =>
|
s = \\isMod,af =>
|
||||||
preOrPost isMod (appCompl True Pos adj.c2 np) (adj.s ! Posit ! AN af) ;
|
preOrPost isMod (appCompl True Pos adj.c2 np) (adj.s ! Posit ! AN af) ;
|
||||||
infl = adj.infl
|
infl = adj.infl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ReflA2 adj = {
|
ReflA2 adj = {
|
||||||
s = \\isMod,af =>
|
s = \\isMod,af =>
|
||||||
preOrPost isMod
|
preOrPost isMod
|
||||||
(appCompl True Pos adj.c2 (reflPron (agrP3 Sg))) (adj.s ! Posit ! AN af) ;
|
(appCompl True Pos adj.c2 (reflPron (agrP3 Sg))) (adj.s ! Posit ! AN af) ;
|
||||||
infl = adj.infl
|
infl = adj.infl
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ concrete AdverbEst of Adverb = CatEst ** open ResEst, Prelude in {
|
|||||||
lin
|
lin
|
||||||
PositAdvAdj a = {s = a.s ! Posit ! AAdv} ;
|
PositAdvAdj a = {s = a.s ! Posit ! AAdv} ;
|
||||||
ComparAdvAdj cadv a np = {
|
ComparAdvAdj cadv a np = {
|
||||||
s = cadv.s ++ a.s ! Posit ! AAdv ++ cadv.p ++ np.s ! NPCase Nom
|
s = cadv.s ++ a.s ! Posit ! AAdv ++ cadv.p ++ linNP (NPCase Nom) np
|
||||||
} ;
|
} ;
|
||||||
ComparAdvAdjS cadv a s = {
|
ComparAdvAdjS cadv a s = {
|
||||||
s = cadv.s ++ a.s ! Posit ! AAdv ++ cadv.p ++ s.s
|
s = cadv.s ++ a.s ! Posit ! AAdv ++ cadv.p ++ s.s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepNP prep np = {s = preOrPost prep.isPre prep.s (np.s ! prep.c)} ;
|
PrepNP prep np = {s = appCompl True Pos prep np} ;
|
||||||
|
|
||||||
AdAdv = cc2 ;
|
AdAdv = cc2 ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../abstract:../common:../prelude:../api
|
--# -path=.:../abstract:../common:../prelude:../api
|
||||||
|
|
||||||
concrete AllEst of AllEstAbs =
|
concrete AllEst of AllEstAbs =
|
||||||
LangEst, -- - [SlashV2VNP,SlashVV, TFut], ---- to speed up linking; to remove spurious parses
|
LangEst, -- - [SlashV2VNP,SlashVV, TFut], ---- to speed up linking; to remove spurious parses
|
||||||
ExtendEst -- - [ProDrop, ProDropPoss, S_OSV, S_VSO, S_ASV] -- to exclude spurious parses
|
ExtendEst -- - [ProDrop, ProDropPoss, S_OSV, S_VSO, S_ASV] -- to exclude spurious parses
|
||||||
**
|
**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
abstract AllEstAbs =
|
abstract AllEstAbs =
|
||||||
Lang,
|
Lang,
|
||||||
ExtraEstAbs
|
Extend
|
||||||
** {} ;
|
** {} ;
|
||||||
|
|||||||
@@ -13,50 +13,45 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
|
|||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = {s : ResEst.Tense => Anteriority => Polarity => SType => Str} ;
|
Cl = {s : ResEst.Tense => Anteriority => Polarity => Str} ;
|
||||||
ClSlash = {s : ResEst.Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
|
ClSlash = {s : ResEst.Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
|
||||||
Imp = {s : Polarity => Agr => Str} ;
|
Imp = {s : Polarity => Agr => Str} ;
|
||||||
|
|
||||||
-- Question
|
-- Question
|
||||||
|
|
||||||
QCl = {s : ResEst.Tense => Anteriority => Polarity => Str} ;
|
QCl = {s : ResEst.Tense => Anteriority => Polarity => Str} ;
|
||||||
IP = {s : NPForm => Str ; n : Number} ;
|
IP = ResEst.IPhrase ;
|
||||||
IComp = {s : Agr => Str} ;
|
IComp = {s : Agr => Str} ;
|
||||||
IDet = {s : Case => Str ; n : Number ; isNum : Bool} ;
|
IDet = ResEst.IDeterminer ;
|
||||||
IQuant = {s : Number => Case => Str} ;
|
IQuant = {s : Number => Case => Str} ;
|
||||||
|
|
||||||
-- Relative
|
-- Relative
|
||||||
|
|
||||||
RCl = {s : ResEst.Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ;
|
RCl = {s : ResEst.Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ;
|
||||||
RP = {s : Number => NPForm => Str ; a : RAgr} ;
|
RP = ResEst.RelPron ;
|
||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = ResEst.VP ;
|
VP = ResEst.VP ;
|
||||||
VPSlash = ResEst.VP ** {c2 : Compl} ;
|
VPSlash = ResEst.VP ** {c2 : Compl} ;
|
||||||
Comp = {s : Agr => Str} ;
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
-- Adjective
|
-- Adjective
|
||||||
|
|
||||||
-- The $Bool$ in s tells whether usage is modifying (as opposed to
|
-- The $Bool$ in s tells whether usage is modifying (as opposed to
|
||||||
-- predicative), e.g. "x on suurem kui y" vs. "y:st suurem arv".
|
-- predicative), e.g. "x on suurem kui y" vs. "y:st suurem arv".
|
||||||
-- The $Infl$ in infl tells whether the adjective inflects as a
|
-- The $Infl$ in infl tells whether the adjective inflects as a
|
||||||
-- modifier: e.g. "väsinud mehele" vs. "mees muutus väsinuks".
|
-- modifier: e.g. "väsinud mehele" vs. "mees muutus väsinuks".
|
||||||
|
|
||||||
AP = {s : Bool => NForm => Str ; infl : Infl} ;
|
AP = ResEst.APhrase ;
|
||||||
|
|
||||||
-- Noun
|
-- Noun
|
||||||
|
|
||||||
CN = {s : NForm => Str} ;
|
CN = ResEst.CNoun ;
|
||||||
Pron = {s : NPForm => Str ; a : Agr} ;
|
Pron = {s : NPForm => Str ; a : Agr} ;
|
||||||
NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
|
NP = ResEst.NPhrase ;
|
||||||
Det = {
|
DAP, Det = ResEst.Determiner ;
|
||||||
s : Case => Str ; -- minun kolme
|
|
||||||
sp : Case => Str ; -- se (substantival form)
|
|
||||||
n : Number ; -- Pl (agreement feature for verb)
|
|
||||||
isNum : Bool ; -- True (a numeral is present)
|
|
||||||
isDef : Bool -- True (verb agrees in Pl, Nom is not Part) --I: actually, can we get rid of this?
|
|
||||||
} ;
|
|
||||||
---- QuantSg, QuantPl = {s : Case => Str ; isDef : Bool} ;
|
---- QuantSg, QuantPl = {s : Case => Str ; isDef : Bool} ;
|
||||||
Ord = {s : NForm => Str} ;
|
Ord = {s : NForm => Str} ;
|
||||||
Predet = {s : Number => NPForm => Str} ;
|
Predet = {s : Number => NPForm => Str} ;
|
||||||
@@ -74,26 +69,37 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
|
|||||||
Conj = {s1,s2 : Str ; n : Number} ;
|
Conj = {s1,s2 : Str ; n : Number} ;
|
||||||
----b DConj = {s1,s2 : Str ; n : Number} ;
|
----b DConj = {s1,s2 : Str ; n : Number} ;
|
||||||
Subj = {s : Str} ;
|
Subj = {s : Str} ;
|
||||||
Prep = Compl ;
|
Prep = ResEst.Compl ;
|
||||||
|
|
||||||
-- Open lexical classes, e.g. Lexicon
|
-- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
V, VS, VQ = Verb1 ; -- = {s : VForm => Str ; sc : Case} ;
|
V, VS, VQ = ResEst.Verb1 ; -- = {s : VForm => Str ; sc : Case} ;
|
||||||
V2, VA, V2Q, V2S = Verb1 ** {c2 : Compl} ;
|
V2, VA, V2Q, V2S = ResEst.Verb2 ;
|
||||||
V2A = Verb1 ** {c2, c3 : Compl} ;
|
V2A, V3 = ResEst.Verb3 ;
|
||||||
VV = Verb1 ** {vi : InfForm} ; ---- infinitive form
|
VV = ResEst.Verb1 ** {vi : InfForms} ;
|
||||||
V2V = Verb1 ** {c2 : Compl ; vi : InfForm} ; ---- infinitive form
|
V2V = ResEst.Verb2 ** {vi : InfForms} ;
|
||||||
V3 = Verb1 ** {c2, c3 : Compl} ;
|
|
||||||
|
|
||||||
A = Adjective ** {infl : Infl} ;
|
A = ResEst.Adjective ** {infl : Infl} ;
|
||||||
A2 = A ** {c2 : Compl} ;
|
A2 = ResEst.Adjective ** {infl : Infl ; c2 : Compl} ;
|
||||||
|
|
||||||
N = Noun ;
|
N = ResEst.Noun ;
|
||||||
N2 = Noun ** {c2 : Compl ; isPre : Bool ; lock_N2 : {}} ;
|
N2 = ResEst.Noun ** {
|
||||||
N3 = Noun ** {c2,c3 : Compl ; isPre,isPre2 : Bool ; lock_N3 : {}} ;
|
postmod : Str ; -- postmod, because N2 can come from N3+complement via ComplN3
|
||||||
|
c2 : Compl ;
|
||||||
|
isPre : Bool} ;
|
||||||
|
N3 = ResEst.Noun ** { -- no postmod, because N3 can only come from lexical funs
|
||||||
|
c2,c3 : Compl ;
|
||||||
|
isPre,isPre2 : Bool
|
||||||
|
} ;
|
||||||
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"
|
linref
|
||||||
|
VP = \vp -> linV vp.v ;
|
||||||
|
NP = linNP (NPCase Nom) ;
|
||||||
|
CN = linCN (NCase Sg Nom) ;
|
||||||
|
V,VS,VQ = linV ;
|
||||||
|
V2,VA,V2S,V2Q,V3 = linV2 ;
|
||||||
|
IDet = linIDet ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,16 @@ concrete ConjunctionEst of Conjunction =
|
|||||||
|
|
||||||
ConjS = conjunctDistrSS ;
|
ConjS = conjunctDistrSS ;
|
||||||
|
|
||||||
ConjAdv = conjunctDistrSS ;
|
ConjAdv,
|
||||||
|
ConjAdV,
|
||||||
|
ConjIAdv = conjunctDistrSS ;
|
||||||
|
|
||||||
ConjCN = conjunctDistrTable NForm ;
|
ConjCN conj ss = conjunctDistrTable NForm conj ss ** ss ;
|
||||||
|
|
||||||
ConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
|
ConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
|
||||||
a = conjAgr (Ag conj.n P3) ss.a ; -- P3 is the maximum
|
a = conjAgr (Ag conj.n P3) ss.a ; -- P3 is the maximum
|
||||||
isPron = False
|
isPron = False ;
|
||||||
|
postmod = ss.postmod
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjAP conj ss = conjunctDistrTableAdj conj ss ;
|
ConjAP conj ss = conjunctDistrTableAdj conj ss ;
|
||||||
@@ -26,40 +29,43 @@ concrete ConjunctionEst of Conjunction =
|
|||||||
|
|
||||||
BaseS = twoSS ;
|
BaseS = twoSS ;
|
||||||
ConsS = consrSS comma ;
|
ConsS = consrSS comma ;
|
||||||
BaseAdv = twoSS ;
|
BaseAdv, BaseAdV, BaseIAdv = twoSS ;
|
||||||
ConsAdv = consrSS comma ;
|
ConsAdv, ConsAdV, ConsIAdv = consrSS comma ;
|
||||||
BaseCN = twoTable NForm ;
|
BaseCN x y = twoTable NForm (mergeCN x) y ** {postmod = y.postmod} ;
|
||||||
ConsCN = consrTable NForm comma ;
|
ConsCN x xs = consrTable NForm comma (mergeCN x) xs ** xs ;
|
||||||
BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a} ;
|
BaseNP x y = twoTable NPForm (mergeNP x) y ** {a = conjAgr x.a y.a ; postmod = y.postmod} ;
|
||||||
ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ;
|
ConsNP x xs = consrTable NPForm comma (mergeNP x) xs ** {a = conjAgr xs.a x.a ; postmod = xs.postmod} ;
|
||||||
BaseAP x y = twoTableAdj x y ;
|
BaseAP x y = twoTableAdj x y ;
|
||||||
ConsAP xs x = consrTableAdj comma x xs ;
|
ConsAP x xs = consrTableAdj comma x xs ;
|
||||||
BaseRS x y = twoTable Agr x y ** {c = y.c} ;
|
BaseRS x y = twoTable Agr x y ** {c = y.c} ;
|
||||||
ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ;
|
ConsRS x xs = consrTable Agr comma x xs ** {c = xs.c} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = {s1,s2 : Str} ;
|
[S] = {s1,s2 : Str} ;
|
||||||
[Adv] = {s1,s2 : Str} ;
|
[Adv] = {s1,s2 : Str} ;
|
||||||
[CN] = {s1,s2 : NForm => Str} ;
|
[AdV] = {s1,s2 : Str} ;
|
||||||
[NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
|
[IAdv] = {s1,s2 : Str} ;
|
||||||
[AP] = {s1,s2 : {s : Bool => NForm => Str ; infl : Infl }} ;
|
[CN] = {s1,s2 : NForm => Str ; postmod : Str} ;
|
||||||
|
[NP] = {s1,s2 : NPForm => Str ; a : Agr ; postmod : Str} ;
|
||||||
|
[AP] = LinListAP ;
|
||||||
[RS] = {s1,s2 : Agr => Str ; c : NPForm} ;
|
[RS] = {s1,s2 : Agr => Str ; c : NPForm} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
|
LinListAP : Type = {s1,s2 : {s : Bool => NForm => Str ; infl : Infl}} ;
|
||||||
|
|
||||||
--Modified from prelude/Coordination.gf generic functions
|
--Modified from prelude/Coordination.gf generic functions
|
||||||
twoTableAdj : (_,_ : AP) -> [AP] = \x,y ->
|
twoTableAdj : (_,_ : ResEst.APhrase) -> LinListAP = \x,y -> {
|
||||||
lin ListAP {
|
|
||||||
s1 = x ;
|
s1 = x ;
|
||||||
s2 = y
|
s2 = y
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
consrTableAdj : Str -> [AP] -> {s : Bool => NForm => Str ; infl : Infl} -> [AP] = \c,xs,x ->
|
consrTableAdj : Str -> ResEst.APhrase -> LinListAP -> LinListAP = \c,x,xs ->
|
||||||
let
|
let
|
||||||
ap1 = xs.s1 ;
|
ap1 = xs.s1 ;
|
||||||
ap2 = xs.s2
|
ap2 = xs.s2
|
||||||
in
|
in {
|
||||||
lin ListAP {s1 =
|
s1 = {s = \\isMod,nf =>
|
||||||
{s = \\isMod,nf =>
|
|
||||||
case isMod of {
|
case isMod of {
|
||||||
True => case <ap1.infl, ap2.infl> of {
|
True => case <ap1.infl, ap2.infl> of {
|
||||||
<(Participle|Invariable),(Participle|Invariable)> =>
|
<(Participle|Invariable),(Participle|Invariable)> =>
|
||||||
@@ -73,17 +79,15 @@ concrete ConjunctionEst of Conjunction =
|
|||||||
False => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --kassid on valmid ja suured
|
False => ap1.s ! isMod ! nf ++ c ++ ap2.s ! isMod ! nf --kassid on valmid ja suured
|
||||||
} ;
|
} ;
|
||||||
infl = Regular } ;
|
infl = Regular } ;
|
||||||
s2 = x ;
|
s2 = x ;
|
||||||
lock_ListAP = <>
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
conjunctDistrTableAdj : ConjunctionDistr -> [AP] -> AP = \or,xs ->
|
conjunctDistrTableAdj : ConjunctionDistr -> LinListAP -> APhrase = \or,xs ->
|
||||||
let
|
let
|
||||||
ap1 = xs.s1 ;
|
ap1 = xs.s1 ;
|
||||||
ap2 = xs.s2 ;
|
ap2 = xs.s2 ;
|
||||||
in
|
in {s = \\isMod,nf =>
|
||||||
lin AP {s = \\isMod,nf =>
|
|
||||||
case isMod of {
|
case isMod of {
|
||||||
True => case <ap1.infl, ap2.infl> of {
|
True => case <ap1.infl, ap2.infl> of {
|
||||||
<(Participle|Invariable),(Participle|Invariable)> =>
|
<(Participle|Invariable),(Participle|Invariable)> =>
|
||||||
@@ -102,4 +106,7 @@ concrete ConjunctionEst of Conjunction =
|
|||||||
infl = Regular
|
infl = Regular
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- for CN and NP with discontinuous fields, put all stuff in s field
|
||||||
|
mergeNP : NPhrase -> NPhrase = \np -> np ** {s = \\c => linNP c np} ;
|
||||||
|
mergeCN : CNoun -> CNoun = \cn -> cn ** {s = \\nf => linCN nf cn} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--# -path=alltenses:.:../abstract:../api:../common
|
--# -path=alltenses:.:../abstract:../api:../common
|
||||||
|
|
||||||
concrete ConstructionEst of Construction = CatEst **
|
concrete ConstructionEst of Construction = CatEst **
|
||||||
open SyntaxEst, SymbolicEst, ParadigmsEst, (L = LexiconEst), (E = ExtraEst), (R = ResEst), Prelude in {
|
open SyntaxEst, SymbolicEst, ParadigmsEst, (L = LexiconEst), (E = ExtraEst), (R = ResEst), Prelude in {
|
||||||
flags coding=utf8 ;
|
flags coding=utf8 ;
|
||||||
|
|
||||||
@@ -12,32 +12,35 @@ lin
|
|||||||
ill_VP = mkVP (mkA "haige") ;
|
ill_VP = mkVP (mkA "haige") ;
|
||||||
ready_VP = mkVP (ParadigmsEst.mkA "valmis") ;
|
ready_VP = mkVP (ParadigmsEst.mkA "valmis") ;
|
||||||
|
|
||||||
has_age_VP card =
|
has_age_VP card =
|
||||||
let n_years_AdA : AdA = lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> L.year_N)))
|
let n_years_AdA : AdA = lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> L.year_N)))
|
||||||
in mkVP (mkAP n_years_AdA L.old_A) ;
|
in mkVP (mkAP n_years_AdA L.old_A) ;
|
||||||
|
|
||||||
have_name_Cl x y = mkCl (mkNP (E.GenNP x) L.name_N) (lin NP y) ;
|
have_name_Cl x y = mkCl (mkNP (E.GenNP x) L.name_N) <lin NP y : NP> ;
|
||||||
married_Cl x y = mkCl (mkNP and_Conj (lin NP x) (lin NP y)) (ParadigmsEst.mkAdv "abielus") ;
|
married_Cl x y = mkCl (mkNP and_Conj <lin NP x : NP> <lin NP y : NP>) (ParadigmsEst.mkAdv "abielus") ;
|
||||||
|
|
||||||
what_name_QCl x = mkQCl (mkIComp whatSg_IP) (mkNP (E.GenNP x) L.name_N) ;
|
what_name_QCl x = mkQCl (mkIComp whatSg_IP) (mkNP (E.GenNP x) L.name_N) ;
|
||||||
how_old_QCl x = mkQCl (E.ICompAP (mkAP L.old_A)) (lin NP x) ;
|
how_old_QCl x = mkQCl (E.ICompAP (mkAP L.old_A)) <lin NP x : NP> ;
|
||||||
how_far_QCl x = mkQCl (E.IAdvAdv L.far_Adv) (lin NP x) ;
|
how_far_QCl x = mkQCl (E.IAdvAdv L.far_Adv) <lin NP x : NP> ;
|
||||||
|
|
||||||
-- some more things
|
-- some more things
|
||||||
weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;
|
weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;
|
||||||
|
|
||||||
is_right_VP = mkVP have_V2 (lin NP (mkNP (ParadigmsEst.mkN "õigus"))) ;
|
is_right_VP = mkVP have_V2 (lin NP (mkNP (ParadigmsEst.mkN "õigus"))) ;
|
||||||
is_wrong_VP = mkVP (ParadigmsEst.mkV "eksima") ;
|
is_wrong_VP = mkVP (ParadigmsEst.mkV "eksima") ;
|
||||||
|
|
||||||
n_units_AP card cn a = mkAP (lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> (lin CN cn))))) (lin A a) ;
|
n_units_AP card cn a =
|
||||||
|
let x_inches_NP : NP = mkNP <lin Card card : Card> <lin CN cn : CN> ;
|
||||||
|
x_inches_AdA : AdA = lin AdA (mkUtt x_inches_NP) ;
|
||||||
|
in mkAP x_inches_AdA <lin A a : A> ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "klaas") (mkPrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "klaasitäis") (mkPrep partitive))) (lin NP np) ;
|
glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "klaas") (casePrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "klaasitäis") (casePrep partitive))) (lin NP np) ;
|
||||||
|
|
||||||
|
|
||||||
where_go_QCl np = mkQCl (lin IAdv (ss "kuhu")) (mkCl np (mkVP L.go_V)) ;
|
where_go_QCl np = mkQCl (lin IAdv (ss "kuhu")) (mkCl np (mkVP L.go_V)) ;
|
||||||
where_come_from_QCl np = mkQCl (lin IAdv (ss "kust")) (mkCl np (mkVP L.come_V)) ;
|
where_come_from_QCl np = mkQCl (lin IAdv (ss "kust")) (mkCl np (mkVP L.come_V)) ;
|
||||||
|
|
||||||
go_here_VP = mkVP (mkVP L.go_V) (mkAdv "siia") ;
|
go_here_VP = mkVP (mkVP L.go_V) (mkAdv "siia") ;
|
||||||
come_here_VP = mkVP (mkVP L.come_V) (mkAdv "siia") ;
|
come_here_VP = mkVP (mkVP L.come_V) (mkAdv "siia") ;
|
||||||
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "sealt") ;
|
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "sealt") ;
|
||||||
@@ -61,16 +64,16 @@ lin
|
|||||||
|
|
||||||
monthAdv m = SyntaxEst.mkAdv in_Prep (mkNP m) ;
|
monthAdv m = SyntaxEst.mkAdv in_Prep (mkNP m) ;
|
||||||
yearAdv y = SyntaxEst.mkAdv (prePrep nominative "aastal") y ;
|
yearAdv y = SyntaxEst.mkAdv (prePrep nominative "aastal") y ;
|
||||||
---- dayMonthAdv d m = ParadigmsEst.mkAdv (d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part) ;
|
---- dayMonthAdv d m = ParadigmsEst.mkAdv (d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part) ;
|
||||||
---- monthYearAdv m y = SyntaxEst.mkAdv in_Prep (mkNP (mkNP m) (SyntaxEst.mkAdv (casePrep nominative) y)) ;
|
---- monthYearAdv m y = SyntaxEst.mkAdv in_Prep (mkNP (mkNP m) (SyntaxEst.mkAdv (casePrep nominative) y)) ;
|
||||||
---- dayMonthYearAdv d m y =
|
---- dayMonthYearAdv d m y =
|
||||||
---- lin Adv {s = d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part ++ y.s ! R.NPCase R.Nom} ;
|
---- lin Adv {s = d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part ++ y.s ! R.NPCase R.Nom} ;
|
||||||
|
|
||||||
intYear = symb ;
|
intYear = symb ;
|
||||||
intMonthday = symb ;
|
intMonthday = symb ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
pointWeekday : Weekday -> Str = \w -> (SyntaxEst.mkAdv (casePrep essive) (mkNP w.noun)).s ;
|
pointWeekday : Weekday -> Str = \w -> (SyntaxEst.mkAdv (casePrep essive) (mkNP w.noun)).s ;
|
||||||
|
|
||||||
lincat Language = N ;
|
lincat Language = N ;
|
||||||
|
|
||||||
@@ -86,11 +89,11 @@ lin
|
|||||||
|
|
||||||
oper mkLanguage : Str -> N = \s -> mkN (s ++ "keel") ;
|
oper mkLanguage : Str -> N = \s -> mkN (s ++ "keel") ;
|
||||||
|
|
||||||
oper mkWeekday : Str -> Weekday = \d ->
|
oper mkWeekday : Str -> Weekday = \d ->
|
||||||
lin Weekday {
|
lin Weekday {
|
||||||
noun = mkN d ;
|
noun = mkN d ;
|
||||||
habitual = ParadigmsEst.mkAdv (d + "iti") ; --kolmapäeviti
|
habitual = ParadigmsEst.mkAdv (d + "iti") ; --kolmapäeviti
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
lin monday_Weekday = mkWeekday "esmaspäev" ;
|
lin monday_Weekday = mkWeekday "esmaspäev" ;
|
||||||
@@ -101,9 +104,9 @@ lin friday_Weekday = mkWeekday "reede" ;
|
|||||||
lin saturday_Weekday = mkWeekday "laupäev" ;
|
lin saturday_Weekday = mkWeekday "laupäev" ;
|
||||||
lin sunday_Weekday = mkWeekday "pühapäev" ;
|
lin sunday_Weekday = mkWeekday "pühapäev" ;
|
||||||
|
|
||||||
lin january_Month = mkN "jaanuar" ;
|
lin january_Month = mkN "jaanuar" ;
|
||||||
lin february_Month = mkN "veebruar" ;
|
lin february_Month = mkN "veebruar" ;
|
||||||
lin march_Month = mkN "märts" ;
|
lin march_Month = mkN "märts" ;
|
||||||
lin april_Month = mkN "aprill" ;
|
lin april_Month = mkN "aprill" ;
|
||||||
lin may_Month = mkN "mai" ;
|
lin may_Month = mkN "mai" ;
|
||||||
lin june_Month = mkN "juuni" ;
|
lin june_Month = mkN "juuni" ;
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
-- documentation of Estonian in Estonian: the default introduced in LangEst
|
-- documentation of Estonian in Estonian: the default introduced in LangEst
|
||||||
|
|
||||||
concrete DocumentationEst of Documentation = CatEst **
|
concrete DocumentationEst of Documentation = CatEst **
|
||||||
DocumentationEstFunctor with (Terminology = TerminologyEst) ;
|
DocumentationEstFunctor with (Terminology = TerminologyEst) ;
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
-- documentation of Estonian in English
|
-- documentation of Estonian in English
|
||||||
|
|
||||||
concrete DocumentationEstEng of Documentation = CatEst **
|
concrete DocumentationEstEng of Documentation = CatEst **
|
||||||
DocumentationEstFunctor with (Terminology = TerminologyEng) ;
|
DocumentationEstFunctor with (Terminology = TerminologyEng) ;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../abstract:../common
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
incomplete concrete DocumentationEstFunctor of Documentation = CatEst ** open
|
incomplete concrete DocumentationEstFunctor of Documentation = CatEst ** open
|
||||||
Terminology, -- the interface
|
Terminology, -- the interface
|
||||||
ResEst,
|
ResEst,
|
||||||
ParadigmsEst,
|
ParadigmsEst,
|
||||||
@@ -23,25 +23,31 @@ lincat
|
|||||||
oper
|
oper
|
||||||
heading : N -> Str = \n -> (nounHeading n).s ;
|
heading : N -> Str = \n -> (nounHeading n).s ;
|
||||||
|
|
||||||
|
caseplus2nf : ResEst.Noun -> ResEst.Number -> CasePlus -> Str = \noun,num,cas ->
|
||||||
|
noun.s ! NCase num cas.c ++ cas.suf ;
|
||||||
|
|
||||||
|
caseplus2af : (AForm => Str) -> ResEst.Number -> CasePlus -> Str = \adj,num,cas ->
|
||||||
|
adj ! AN (NCase num cas.c) ++ cas.suf ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
InflectionN, InflectionN2, InflectionN3 = \noun -> {
|
InflectionN, InflectionN2, InflectionN3 = \noun -> {
|
||||||
t = "s" ;
|
t = "s" ;
|
||||||
s1 = heading1 (heading noun_Category) ;
|
s1 = heading1 (heading noun_Category) ;
|
||||||
s2 = inflNoun (\nf -> noun.s ! nf)
|
s2 = inflNoun (caseplus2nf noun)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionA, InflectionA2 = \adj ->
|
InflectionA, InflectionA2 = \adj ->
|
||||||
let posit : (AForm => Str) = adj.s ! Posit ;
|
let posit : (AForm => Str) = adj.s ! Posit ;
|
||||||
compar : (AForm => Str) = adj.s ! Compar ;
|
compar : (AForm => Str) = adj.s ! Compar ;
|
||||||
superl : (AForm => Str) = adj.s ! Superl ;
|
superl : (AForm => Str) = adj.s ! Superl ;
|
||||||
in
|
in
|
||||||
{ t = "a" ;
|
{ t = "a" ;
|
||||||
s1 = heading1 (heading adjective_Category) ;
|
s1 = heading1 (heading adjective_Category) ;
|
||||||
s2 = inflNoun (\nf -> posit ! AN nf) ++
|
s2 = inflNoun (caseplus2af posit) ++
|
||||||
heading2 (heading comparative_Parameter) ++
|
heading2 (heading comparative_Parameter) ++
|
||||||
inflNoun (\nf -> compar ! AN nf) ++
|
inflNoun (caseplus2af compar) ++
|
||||||
heading2 (heading superlative_Parameter) ++
|
heading2 (heading superlative_Parameter) ++
|
||||||
inflNoun (\nf -> superl ! AN nf)
|
inflNoun (caseplus2af superl)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||||
@@ -58,93 +64,94 @@ lin
|
|||||||
|
|
||||||
InflectionV v = {
|
InflectionV v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v)) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin V v : V>)) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV2 v = {
|
InflectionV2 v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin V2 v : V2> S.something_NP)) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV3 v = {
|
InflectionV3 v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin V3 v : V3> S.something_NP S.something_NP)) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV2V v = {
|
InflectionV2V v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (S.mkVP (L.sleep_V)))) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin V2V v : V2V> S.we_NP (S.mkVP (L.sleep_V)))) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV2S v = {
|
InflectionV2S v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin S (ss "...")))) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin V2S v : V2S> S.we_NP (lin S (ss "...")))) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV2Q v = {
|
InflectionV2Q v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin QS (ss "...")))) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin V2Q v : V2Q> S.we_NP (lin QS (ss "...")))) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV2A v = {
|
InflectionV2A v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP L.beautiful_A)) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin V2A v : V2A> S.we_NP L.beautiful_A)) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionVV v = {
|
InflectionVV v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v (S.mkVP (L.sleep_V)))) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin VV v : VV> (S.mkVP (L.sleep_V)))) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionVS v = {
|
InflectionVS v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v (lin S (ss "...")))) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin VS v : VS> (lin S (ss "...")))) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionVQ v = {
|
InflectionVQ v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v (lin QS (ss "...")))) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin VQ v : VQ> (lin QS (ss "...")))) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionVA v = {
|
InflectionVA v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1 = heading1 (heading verb_Category) ++
|
s1 = heading1 (heading verb_Category) ++
|
||||||
paragraph (verbExample (S.mkCl S.she_NP v L.beautiful_A)) ;
|
paragraph (verbExample (S.mkCl S.she_NP <lin VA v : VA> L.beautiful_A)) ;
|
||||||
s2 = inflVerb v
|
s2 = inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
verbExample : CatEst.Cl -> Str = \cl -> (S.mkUtt cl).s ;
|
verbExample : CatEst.Cl -> Str = \cl -> (S.mkUtt cl).s ;
|
||||||
{-
|
{-
|
||||||
-} --# notpresent
|
-} --# notpresent
|
||||||
inflVerb : CatEst.V -> Str = \verb ->
|
inflVerb : ResEst.Verb -> Str = \verb ->
|
||||||
let
|
let
|
||||||
--verb = sverb2verbSep verb0 ;
|
|
||||||
vfin : ResEst.VForm -> Str = \f ->
|
vfin : ResEst.VForm -> Str = \f ->
|
||||||
verb.s ! f ;
|
verb.s ! f ;
|
||||||
|
vinf : ResEst.InfForms -> Str = \if ->
|
||||||
|
applyInfFormsV if verb.s ;
|
||||||
|
|
||||||
nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 ->
|
nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 ->
|
||||||
(S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP n2))).s ;
|
(S.mkUtt (G.PossNP (S.mkCN <lin N n1 : N>) (S.mkNP <lin N n2 : N>))).s ;
|
||||||
in
|
in
|
||||||
heading3 (nounNounHeading present_Parameter indicative_Parameter) ++
|
heading3 (nounNounHeading present_Parameter indicative_Parameter) ++
|
||||||
frameTable (
|
frameTable (
|
||||||
@@ -152,7 +159,7 @@ oper
|
|||||||
th (heading singular_Parameter) ++
|
th (heading singular_Parameter) ++
|
||||||
th (heading plural_Parameter)
|
th (heading plural_Parameter)
|
||||||
++ th (heading passive_Parameter) --# notpresent
|
++ th (heading passive_Parameter) --# notpresent
|
||||||
) ++
|
) ++
|
||||||
tr (th "1.p" ++ td (vfin (Presn Sg P1)) ++ td (vfin (Presn Pl P1))
|
tr (th "1.p" ++ td (vfin (Presn Sg P1)) ++ td (vfin (Presn Pl P1))
|
||||||
++ intagAttr "td" "rowspan=3" (vfin (PassPresn True)) --# notpresent
|
++ intagAttr "td" "rowspan=3" (vfin (PassPresn True)) --# notpresent
|
||||||
) ++
|
) ++
|
||||||
@@ -167,13 +174,13 @@ oper
|
|||||||
th (heading singular_Parameter) ++
|
th (heading singular_Parameter) ++
|
||||||
th (heading plural_Parameter)
|
th (heading plural_Parameter)
|
||||||
++ th (heading passive_Parameter) --# notpresent
|
++ th (heading passive_Parameter) --# notpresent
|
||||||
) ++
|
) ++
|
||||||
tr (th "1.p" ++ td (vfin (Impf Sg P1)) ++ td (vfin (Impf Pl P1))
|
tr (th "1.p" ++ td (vfin (Impf Sg P1)) ++ td (vfin (Impf Pl P1))
|
||||||
++ intagAttr "td" "rowspan=3" (vfin (PassImpf True))) ++
|
++ intagAttr "td" "rowspan=3" (vfin (PassImpf True))) ++
|
||||||
tr (th "2.p" ++ td (vfin (Impf Sg P2)) ++ td (vfin (Impf Pl P2))) ++
|
tr (th "2.p" ++ td (vfin (Impf Sg P2)) ++ td (vfin (Impf Pl P2))) ++
|
||||||
tr (th "3.p" ++ td (vfin (Impf Sg P3)) ++ td (vfin (Impf Pl P3))) ++
|
tr (th "3.p" ++ td (vfin (Impf Sg P3)) ++ td (vfin (Impf Pl P3))) ++
|
||||||
tr (th (heading negative_Parameter) ++
|
tr (th (heading negative_Parameter) ++
|
||||||
td (vfin (PastPart Act)) ++
|
td (vfin (PastPart Act)) ++
|
||||||
td (vfin (PastPart Pass)) ++
|
td (vfin (PastPart Pass)) ++
|
||||||
td (vfin (PassImpf False)))
|
td (vfin (PassImpf False)))
|
||||||
) ++
|
) ++
|
||||||
@@ -183,12 +190,12 @@ oper
|
|||||||
th (heading singular_Parameter) ++
|
th (heading singular_Parameter) ++
|
||||||
th (heading plural_Parameter)
|
th (heading plural_Parameter)
|
||||||
++ th (heading passive_Parameter) --# notpresent
|
++ th (heading passive_Parameter) --# notpresent
|
||||||
) ++
|
) ++
|
||||||
tr (th "1.p" ++ td (vfin (Condit Sg P1)) ++ td (vfin (Condit Pl P1))
|
tr (th "1.p" ++ td (vfin (Condit Sg P1)) ++ td (vfin (Condit Pl P1))
|
||||||
++ intagAttr "td" "rowspan=3" "TODO pass condit (nt loetaks)" --# notpresent
|
++ intagAttr "td" "rowspan=3" "TODO pass condit (nt loetaks)" --# notpresent
|
||||||
) ++
|
) ++
|
||||||
tr (th "2.p" ++ td (vfin (Condit Sg P2)) ++ td (vfin (Condit Pl P2))) ++
|
tr (th "2.p" ++ td (vfin (Condit Sg P2)) ++ td (vfin (Condit Pl P2))) ++
|
||||||
tr (th "3.p" ++ td (vfin (Condit Sg P3)) ++ td (vfin (Condit Pl P3)))
|
tr (th "3.p" ++ td (vfin (Condit Sg P3)) ++ td (vfin (Condit Pl P3)))
|
||||||
) ++
|
) ++
|
||||||
heading3 (nounNounHeading present_Parameter quotative_Parameter) ++
|
heading3 (nounNounHeading present_Parameter quotative_Parameter) ++
|
||||||
frameTable (
|
frameTable (
|
||||||
@@ -196,8 +203,8 @@ oper
|
|||||||
th (heading singular_Parameter) ++
|
th (heading singular_Parameter) ++
|
||||||
th (heading plural_Parameter)
|
th (heading plural_Parameter)
|
||||||
++ th (heading passive_Parameter) --# notpresent
|
++ th (heading passive_Parameter) --# notpresent
|
||||||
) ++
|
) ++
|
||||||
tr (th "isik." ++ td (vfin (Quotative Act))
|
tr (th "isik." ++ td (vfin (Quotative Act))
|
||||||
++ intagAttr "td" "rowspan=3" (vfin (Quotative Act)) --# notpresent
|
++ intagAttr "td" "rowspan=3" (vfin (Quotative Act)) --# notpresent
|
||||||
) ++
|
) ++
|
||||||
tr (th "umbis." ++ td (vfin (Quotative Pass)) ++ td (vfin (Quotative Pass))
|
tr (th "umbis." ++ td (vfin (Quotative Pass)) ++ td (vfin (Quotative Pass))
|
||||||
@@ -208,61 +215,62 @@ oper
|
|||||||
th (heading singular_Parameter) ++
|
th (heading singular_Parameter) ++
|
||||||
th (heading plural_Parameter)
|
th (heading plural_Parameter)
|
||||||
++ th (heading passive_Parameter) --# notpresent
|
++ th (heading passive_Parameter) --# notpresent
|
||||||
) ++
|
) ++
|
||||||
tr (th "1.p" ++ td "" ++ td (vfin ImperP1Pl) ++
|
tr (th "1.p" ++ td "" ++ td (vfin ImperP1Pl) ++
|
||||||
intagAttr "td" "rowspan=3" (vfin ImperPass)) ++
|
intagAttr "td" "rowspan=3" (vfin ImperPass)) ++
|
||||||
tr (th "2.p" ++ td (vfin (Imper Sg)) ++ td (vfin (Imper Pl))) ++
|
tr (th "2.p" ++ td (vfin (Imper Sg)) ++ td (vfin (Imper Pl))) ++
|
||||||
tr (th "3.p" ++ td (vfin (ImperP3)) ++ td (vfin ImperP3))
|
tr (th "3.p" ++ td (vfin (ImperP3)) ++ td (vfin ImperP3))
|
||||||
) ++
|
) ++
|
||||||
heading2 (nounPluralHeading nominal_form_ParameterType).s ++
|
heading2 (nounPluralHeading nominal_form_ParameterType).s ++
|
||||||
heading3 (heading infinitive_Parameter) ++
|
heading3 (heading infinitive_Parameter) ++
|
||||||
frameTable (
|
frameTable (
|
||||||
tr (intagAttr "th" "rowspan=2" "da" ++
|
tr (intagAttr "th" "rowspan=2" "da" ++
|
||||||
th (heading nominative_Parameter) ++ td (vfin (Inf InfDa))) ++
|
th (heading nominative_Parameter) ++ td (vinf InfDa)) ++
|
||||||
tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfDes))) ++
|
tr (th (heading inessive_Parameter) ++ td (vinf InfDes)) ++
|
||||||
|
|
||||||
tr (intagAttr "th" "rowspan=5" "ma" ++
|
tr (intagAttr "th" "rowspan=6" "ma" ++
|
||||||
th (heading illative_Parameter) ++ td (vfin (Inf InfMa))) ++
|
th (heading illative_Parameter) ++ td (vinf InfMa)) ++
|
||||||
tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfMas))) ++
|
tr (th (heading inessive_Parameter) ++ td (vinf InfMas)) ++
|
||||||
tr (th (heading elative_Parameter) ++ td (vfin (Inf InfMast))) ++
|
tr (th (heading elative_Parameter) ++ td (vinf InfMast)) ++
|
||||||
tr (th (heading abessive_Parameter) ++ td (vfin (Inf InfMata))) ++
|
tr (th (heading abessive_Parameter) ++ td (vinf InfMata)) ++
|
||||||
tr (th (heading translative_Parameter) ++ td (vfin (Inf InfMaks)))
|
tr (th (heading abessive_Parameter) ++ td (vinf InfMaks)) ++
|
||||||
|
tr (th (heading translative_Parameter) ++ td (vinf InfMine))
|
||||||
|
|
||||||
) ++
|
) ++
|
||||||
heading3 (heading participle_Parameter) ++
|
heading3 (heading participle_Parameter) ++
|
||||||
frameTable (
|
frameTable (
|
||||||
tr (intagAttr "th" "rowspan=2" (heading present_Parameter) ++
|
tr (intagAttr "th" "rowspan=2" (heading present_Parameter) ++
|
||||||
th (heading active_Parameter) ++
|
th (heading active_Parameter) ++
|
||||||
td (vfin (PresPart Act))) ++
|
td (vfin (PresPart Act))) ++
|
||||||
tr (th (heading passive_Parameter) ++
|
tr (th (heading passive_Parameter) ++
|
||||||
td (vfin (PresPart Pass))) ++
|
td (vfin (PresPart Pass))) ++
|
||||||
|
|
||||||
tr (intagAttr "th" "rowspan=2" (heading perfect_Parameter) ++
|
tr (intagAttr "th" "rowspan=2" (heading perfect_Parameter) ++
|
||||||
th (heading active_Parameter) ++
|
th (heading active_Parameter) ++
|
||||||
td (vfin (PastPart Act ))) ++
|
td (vfin (PastPart Act ))) ++
|
||||||
|
|
||||||
tr (th (heading passive_Parameter) ++
|
tr (th (heading passive_Parameter) ++
|
||||||
td (vfin (PastPart Pass )))
|
td (vfin (PastPart Pass )))
|
||||||
) ; --}
|
) ; --}
|
||||||
|
|
||||||
inflNoun : (NForm -> Str) -> Str = \nouns ->
|
inflNoun : (ResEst.Number -> CasePlus -> Str) -> Str = \nouns ->
|
||||||
frameTable (
|
frameTable (
|
||||||
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
|
||||||
tr (th (heading nominative_Parameter) ++ td (nouns (NCase Sg Nom)) ++ td (nouns (NCase Pl Nom))) ++
|
tr (th (heading nominative_Parameter) ++ td (nouns Sg Nominative) ++ td (nouns Pl Nominative)) ++
|
||||||
tr (th (heading genitive_Parameter) ++ td (nouns (NCase Sg Gen)) ++ td (nouns (NCase Pl Gen))) ++
|
tr (th (heading genitive_Parameter) ++ td (nouns Sg Genitive) ++ td (nouns Pl Genitive)) ++
|
||||||
tr (th (heading partitive_Parameter) ++ td (nouns (NCase Sg Part)) ++ td (nouns (NCase Pl Part))) ++
|
tr (th (heading partitive_Parameter) ++ td (nouns Sg Partitive) ++ td (nouns Pl Partitive)) ++
|
||||||
tr (th (heading translative_Parameter) ++ td (nouns (NCase Sg Transl)) ++ td (nouns (NCase Pl Transl))) ++
|
tr (th (heading translative_Parameter) ++ td (nouns Sg Translative) ++ td (nouns Pl Translative)) ++
|
||||||
tr (th (heading essive_Parameter) ++ td (nouns (NCase Sg Ess)) ++ td (nouns (NCase Pl Ess))) ++
|
tr (th (heading essive_Parameter) ++ td (nouns Sg Essive) ++ td (nouns Pl Essive)) ++
|
||||||
tr (th (heading inessive_Parameter) ++ td (nouns (NCase Sg Iness)) ++ td (nouns (NCase Pl Iness))) ++
|
tr (th (heading inessive_Parameter) ++ td (nouns Sg Inessive) ++ td (nouns Pl Inessive)) ++
|
||||||
tr (th (heading elative_Parameter) ++ td (nouns (NCase Sg Elat)) ++ td (nouns (NCase Pl Elat))) ++
|
tr (th (heading elative_Parameter) ++ td (nouns Sg Elative) ++ td (nouns Pl Elative)) ++
|
||||||
tr (th (heading illative_Parameter) ++ td (nouns (NCase Sg Illat)) ++ td (nouns (NCase Pl Illat))) ++
|
tr (th (heading illative_Parameter) ++ td (nouns Sg Illative) ++ td (nouns Pl Illative)) ++
|
||||||
tr (th (heading adessive_Parameter) ++ td (nouns (NCase Sg Adess)) ++ td (nouns (NCase Pl Adess))) ++
|
tr (th (heading adessive_Parameter) ++ td (nouns Sg Adessive) ++ td (nouns Pl Adessive)) ++
|
||||||
tr (th (heading ablative_Parameter) ++ td (nouns (NCase Sg Ablat)) ++ td (nouns (NCase Pl Ablat))) ++
|
tr (th (heading ablative_Parameter) ++ td (nouns Sg Ablative) ++ td (nouns Pl Ablative)) ++
|
||||||
tr (th (heading allative_Parameter) ++ td (nouns (NCase Sg Allat)) ++ td (nouns (NCase Pl Allat))) ++
|
tr (th (heading allative_Parameter) ++ td (nouns Sg Allative) ++ td (nouns Pl Allative)) ++
|
||||||
tr (th (heading abessive_Parameter) ++ td (nouns (NCase Sg Abess)) ++ td (nouns (NCase Pl Abess))) ++
|
tr (th (heading abessive_Parameter) ++ td (nouns Sg Abessive) ++ td (nouns Pl Abessive)) ++
|
||||||
tr (th (heading comitative_Parameter) ++ td (nouns (NCase Sg Comit)) ++ td (nouns (NCase Pl Comit))) ++
|
tr (th (heading comitative_Parameter) ++ td (nouns Sg Comitative) ++ td (nouns Pl Comitative)) ++
|
||||||
tr (th (heading instructive_Parameter) ++ td (nouns (NCase Sg Termin)) ++ td (nouns (NCase Pl Termin))
|
tr (th (heading instructive_Parameter) ++ td (nouns Sg Terminative) ++ td (nouns Pl Terminative))
|
||||||
)) ;
|
) ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
NoDefinition t = {s=t.s};
|
NoDefinition t = {s=t.s};
|
||||||
@@ -274,6 +282,6 @@ lin
|
|||||||
MkTag i = ss (i.t) ;
|
MkTag i = ss (i.t) ;
|
||||||
|
|
||||||
{- --# notpresent
|
{- --# notpresent
|
||||||
-}
|
-}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,19 +3,29 @@
|
|||||||
concrete ExtendEst of Extend =
|
concrete ExtendEst of Extend =
|
||||||
CatEst ** ExtendFunctor -
|
CatEst ** ExtendFunctor -
|
||||||
[
|
[
|
||||||
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
|
-- Extensions of VP
|
||||||
AdAdV, AdjAsCN, AdjAsNP, ApposNP,
|
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2,
|
||||||
BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2,
|
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, QuestVPS, SQuestVPS, RelVPS,
|
||||||
MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV,
|
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||||
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
|
MkVPS2, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, ReflVPS2,
|
||||||
Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN,
|
MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2,
|
||||||
CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP,
|
|
||||||
CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPFem, EmbedPresPart,
|
-- Reflexives
|
||||||
ExistsNP, FocusAP, FocusAdV, FocusAdv, FocusObj, FrontExtPredVP, GenIP, GenModIP, GenModNP, GenNP, GenRP,
|
RNP, RNPList, Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ConjRNP, Cons_nr_RNP, Cons_rr_RNP, PredetRNP, ReflRNP, ReflPoss, ReflPron,
|
||||||
GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, InvFrontExtPredVP, MkVPS, NominalizeVPSlashNP,
|
|
||||||
PassAgentVPSlash, PassVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN,
|
-- Rest in alphabetical order
|
||||||
PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V,
|
AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP, A2VPSlash, ByVP,
|
||||||
UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2
|
CardCNCard, CompBareCN, CompIQuant, CompQS, CompS, CompVP,
|
||||||
|
ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP, CompoundN,
|
||||||
|
EmbedPresPart, EmbedSSlash, EmptyRelSlash, ExistsNP, ExistCN, ExistMassCN, ExistPluralCN,
|
||||||
|
FocusAP, FocusAdV, FocusAdv, FocusObj, FrontComplDirectVQ, FrontComplDirectVS,
|
||||||
|
GenIP, GenModIP, GenModNP, GenNP, GenRP, GerundAdv, GerundCN, GerundNP,
|
||||||
|
IAdvAdv, ICompAP, InOrderToVP, N2VPSlash, NominalizeVPSlashNP,
|
||||||
|
PassAgentVPSlash, PassVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj,
|
||||||
|
PredAPVP, PredIAdvVP, PredVPSVV, PresPartAP, PrepCN, ProDrop, ProgrVPSlash, PurposeVP,
|
||||||
|
SlashBareV2S, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
with
|
with
|
||||||
(Grammar = GrammarEst) **
|
(Grammar = GrammarEst) **
|
||||||
@@ -24,6 +34,7 @@ concrete ExtendEst of Extend =
|
|||||||
GrammarEst,
|
GrammarEst,
|
||||||
ResEst,
|
ResEst,
|
||||||
(R=ResEst),
|
(R=ResEst),
|
||||||
|
(X=ExtraEst),
|
||||||
IdiomEst,
|
IdiomEst,
|
||||||
Coordination,
|
Coordination,
|
||||||
Prelude,
|
Prelude,
|
||||||
@@ -31,257 +42,399 @@ concrete ExtendEst of Extend =
|
|||||||
LexiconEst,
|
LexiconEst,
|
||||||
ParadigmsEst in {
|
ParadigmsEst in {
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
-- VPS, VPI, VPS2 + list versions
|
||||||
|
lincat
|
||||||
|
VPS = X.VPS ;
|
||||||
|
[VPS] = X.ListVPS ;
|
||||||
|
VPI = X.VPI ;
|
||||||
|
[VPI] = X.ListVPI ;
|
||||||
|
VPS2 = X.VPS ** {c2 : Compl} ;
|
||||||
|
[VPS2] = X.ListVPS ** {c2 : Compl} ;
|
||||||
|
VPI2 = X.VPI ** {c2 : Compl} ;
|
||||||
|
[VPI2] = X.ListVPI ** {c2 : Compl} ;
|
||||||
|
|
||||||
|
linref
|
||||||
|
VPS = X.linVPS (agrP3 Sg) ;
|
||||||
|
VPI = X.linVPI InfMa ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
-- : NP -> Quant ; -- this man's
|
MkVPS = X.MkVPS ;
|
||||||
GenNP np = {
|
BaseVPS = X.BaseVPS ;
|
||||||
s,sp = \\_,_ => np.s ! NPCase Gen ;
|
ConsVPS = X.ConsVPS ;
|
||||||
|
ConjVPS = X.ConjVPS ;
|
||||||
|
|
||||||
|
PredVPS = X.PredVPS ;
|
||||||
|
-- QuestVPS
|
||||||
|
-- SQuestVPS
|
||||||
|
-- RelVPS
|
||||||
|
|
||||||
|
MkVPI = X.MkVPI ;
|
||||||
|
BaseVPI = X.BaseVPI ;
|
||||||
|
ConsVPI = X.ConsVPI ;
|
||||||
|
ConjVPI = X.ConjVPI ;
|
||||||
|
ComplVPIVV = X.ComplVPIVV ;
|
||||||
|
|
||||||
|
MkVPS2 t p vps = MkVPS t p vps ** {c2 = vps.c2} ;
|
||||||
|
-- BaseVPS2, ConsVPS2, ConjVPS2,
|
||||||
|
|
||||||
|
ComplVPS2 v np = lin VPS (v ** {
|
||||||
|
-- TODO: param to record whether it's pos or neg, so we get right form of np
|
||||||
|
s = \\agr => v.s ! agr ++ appCompl True Pos v.c2 np ;
|
||||||
|
}) ;
|
||||||
|
|
||||||
|
-- ReflVPS2 v rnp =
|
||||||
|
-- MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2,
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
-- RNP + all related funs
|
||||||
|
|
||||||
|
lincat
|
||||||
|
RNP = {s : Agr => NPForm => Str} ;
|
||||||
|
RNPList = {s1,s2 : Agr => NPForm => Str} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
rnp2np : Agr -> RNP -> NPhrase = \agr,rnp -> emptyNP ** {
|
||||||
|
a = agr ;
|
||||||
|
s = rnp.s ! agr ;
|
||||||
|
isPron = False ; -- ??
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
-- : VPSlash -> RNP -> VP ; -- support my family and myself
|
||||||
|
ReflRNP vps rnp = insertObj (\\b,p,a => appCompl True Pos vps.c2 (rnp2np a rnp)) vps ;
|
||||||
|
|
||||||
|
-- : RNP
|
||||||
|
ReflPron = {s = \\agr,npf => (reflPron agr).s ! npf} ;
|
||||||
|
|
||||||
|
-- : Num -> CN -> RNP ; -- my car(s)
|
||||||
|
ReflPoss num cn = {
|
||||||
|
s = \\a,npf => possPron ! a ++ num.s ! Sg ! Nom ++
|
||||||
|
case npf of {
|
||||||
|
NPCase c => cn.s ! NCase num.n c ;
|
||||||
|
NPAcc => cn.s ! NCase num.n Gen } ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PredetRNP predet rnp = {
|
||||||
|
s = \\a,c => case a of {
|
||||||
|
Ag n p => predet.s ! n ! c ++ rnp.s ! a ! c ;
|
||||||
|
AgPol => predet.s ! Pl ! c ++ rnp.s ! a ! c }
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjRNP conj rpns = conjunctDistrTable2 Agr NPForm conj rpns ;
|
||||||
|
|
||||||
|
Base_rr_RNP x y = twoTable2 Agr NPForm x y ;
|
||||||
|
Base_nr_RNP x y = twoTable2 Agr NPForm {s = \\a => x.s} y ;
|
||||||
|
Base_rn_RNP x y = twoTable2 Agr NPForm x {s = \\a => y.s} ;
|
||||||
|
Cons_rr_RNP x xs = consrTable2 Agr NPForm comma x xs ;
|
||||||
|
Cons_nr_RNP x xs = consrTable2 Agr NPForm comma {s = \\a => x.s} xs ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
-- : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children
|
||||||
|
PossPronRNP pron num cn rnp =
|
||||||
|
|
||||||
|
-- : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife
|
||||||
|
AdvRAP adv rp =
|
||||||
|
|
||||||
|
-- : VP -> Prep -> RNP -> VP ; -- lectured about her travels
|
||||||
|
AdvRNP adv rp =
|
||||||
|
|
||||||
|
-- : AP -> Prep -> RNP -> AP ; -- adamant in his refusal
|
||||||
|
AdvRVP adv rp =
|
||||||
|
-}
|
||||||
|
|
||||||
|
oper
|
||||||
|
possPron : Agr => Str = table {
|
||||||
|
Ag Sg P1 => "minu" ;
|
||||||
|
Ag Sg P2 => "sinu" ;
|
||||||
|
Ag Sg P3 => "tema" ;
|
||||||
|
Ag Pl P1 => "meie" ;
|
||||||
|
Ag Pl P2 => "teie" ;
|
||||||
|
Ag Pl P3 => "nende" ;
|
||||||
|
AgPol => "teie"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
-- A - B
|
||||||
|
lin
|
||||||
|
|
||||||
|
|
||||||
|
AdAdV ad adv = AdAdv ad adv ;
|
||||||
|
|
||||||
|
-- : AP -> CN ; -- a green one ; en grön (Swe)
|
||||||
|
AdjAsCN ap = emptyCN ** {s = ap.s ! True} ; -- True = attributive ; False = predicative
|
||||||
|
|
||||||
|
-- : AP -> NP
|
||||||
|
AdjAsNP ap = MassNP (AdjAsCN ap) ;
|
||||||
|
|
||||||
|
-- : NP -> NP -> NP
|
||||||
|
ApposNP np1 np2 = np2 ** {
|
||||||
|
s = \\nf => np1.s ! nf ++ np2.s ! nf ; -- comma or not?
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : Adv -> NP -> Cl ; -- here is the tree / here are the trees
|
||||||
|
AdvIsNP adv np = mkClause (\_ -> adv.s) (agrP3 Sg) (UseComp (CompNP np)) ;
|
||||||
|
|
||||||
|
-- : A2 -> VPSlash
|
||||||
|
A2VPSlash a2 = UseComp (CompAP (UseA2 a2)) ** {c2 = a2.c2} ;
|
||||||
|
|
||||||
|
-- : VP -> Adv ;
|
||||||
|
ByVP = GerundAdv ;
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
-- C
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
-- : VS -> S -> VP ;
|
||||||
|
ComplBareVS v s = insertExtrapos s.s (predV v) ;
|
||||||
|
|
||||||
|
-- : N -> N -> N ; -- control system / controls system / control-system
|
||||||
|
CompoundN noun cn = cn ** {
|
||||||
|
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : N -> A -> AP ; -- language independent / language-independent
|
||||||
|
CompoundAP n a = PositA (a ** {s = \\d,af => n.s ! NCase Sg Nom ++ BIND ++ a.s ! d ! af}) ;
|
||||||
|
|
||||||
|
-- : VS -> Utt -> VP ; -- say: "today"
|
||||||
|
ComplDirectVS vs utt = insertExtrapos (BIND ++ ":" ++ utt.s) (predV vs) ;
|
||||||
|
|
||||||
|
-- : VQ -> Utt -> VP ; -- ask: "when"
|
||||||
|
ComplDirectVQ vq utt = insertExtrapos (BIND ++ ":" ++ utt.s) (predV vq) ;
|
||||||
|
|
||||||
|
-- : S -> Comp ; -- (the fact is) that she sleeps
|
||||||
|
CompS s = {s = \\_ => "et" ++ s.s} ;
|
||||||
|
|
||||||
|
-- : QS -> Comp ; -- (the question is) who sleeps
|
||||||
|
CompQS qs = {s = \\_ => qs.s } ;
|
||||||
|
|
||||||
|
-- : Ant -> Pol -> VP -> Comp ; -- (she is) to go
|
||||||
|
CompVP ant pol vp = {s = \\a => infVPAnt ant.a (NPCase Nom) pol.p a vp InfDa } ;
|
||||||
|
|
||||||
|
|
||||||
|
-- ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++ infVP v.typ vp a.a p.p agr)
|
||||||
|
-- (predVV v) ;
|
||||||
|
|
||||||
|
-- ComplSlashPartLast vps np = {} ; --- AR 7/3/2013
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
-- E - F
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
-- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore) / ___ga abielus olemine,
|
||||||
|
EmbedPresPart vp = {s = infVP (NPCase Gen) Pos (agrP3 Sg) vp InfMine } ;
|
||||||
|
|
||||||
|
EmbedSSlash s = {s = s.s ++ s.c2.s} ;
|
||||||
|
|
||||||
|
-- : ClSlash -> RCl ; -- he lives in
|
||||||
|
EmptyRelSlash cls = {
|
||||||
|
s = \\t,a,p,_ => cls.s ! t ! a ! p ++ cls.c2.s ;
|
||||||
|
c = NPCase Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : CN -> Cl ; -- there is a car / there is no car ; there is beer / there is no beer ; there are
|
||||||
|
-- TODO: these all use the literal "exist" verb. Does Estonian have a construction for "there is"?
|
||||||
|
ExistCN, ExistMassCN = \cn -> ExistsNP (MassNP cn) ;
|
||||||
|
ExistPluralCN cn = ExistsNP (DetCN (DetQuant IndefArt NumPl) cn) ;
|
||||||
|
|
||||||
|
-- : NP -> Cl ; -- there exists a number / there exist numbers
|
||||||
|
ExistsNP = IdiomEst.ExistNP ;
|
||||||
|
|
||||||
|
-- : AP -> NP -> Utt ; -- green was the tree
|
||||||
|
FocusAP ap np =
|
||||||
|
let pred : VP = UseComp (CompNP np) ;
|
||||||
|
subj : NP = AdjAsNP ap ;
|
||||||
|
cl : Cl = PredVP subj pred ;
|
||||||
|
in UttS (UseCl (TTAnt TPres ASimul) PPos cl) ; -- use AdvIsNP for similar construction but that returns a Cl instead
|
||||||
|
|
||||||
|
-- : Ad[vV] -> S -> Utt -- today I will sleep
|
||||||
|
FocusAdV, FocusAdv = \adv,s -> cc2 adv s ;
|
||||||
|
|
||||||
|
-- : NP -> SSlash -> Utt ; -- her I love
|
||||||
|
FocusObj np sslash = {s = appCompl True Pos sslash.c2 np ++ sslash.s} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- : NP -> VS -> Utt -> Cl ; -- "I am here", she said
|
||||||
|
FrontComplDirectVS np vs utt =
|
||||||
|
let cl : Cl = PredVP np (UseV vs) ;
|
||||||
|
in cl ** {s = \\t,a,p => utt.s ++ bindComma ++ cl.s ! t ! a ! p} ;
|
||||||
|
|
||||||
|
-- : NP -> VQ -> Utt -> Cl ; -- "where", she asked
|
||||||
|
FrontComplDirectVQ np vq utt =
|
||||||
|
let cl : Cl = PredVP np (UseV vq) ;
|
||||||
|
in cl ** {s = \\t,a,p => utt.s ++ bindComma ++ cl.s ! t ! a ! p} ;
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
-- G
|
||||||
|
|
||||||
|
lin
|
||||||
|
-- : NP -> Quant ; -- this man's
|
||||||
|
GenNP np = {
|
||||||
|
s,sp = \\_,_ => linNP (NPCase Gen) np ;
|
||||||
isNum = False ;
|
isNum = False ;
|
||||||
isDef = True ;
|
isDef = True ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : IP -> IQuant ; -- whose
|
-- : IP -> IQuant ; -- whose
|
||||||
GenIP ip = { s = \\_,_ => ip.s ! NPCase Gen } ;
|
GenIP ip = {s = \\_,_ => linIP (NPCase Gen) ip} ;
|
||||||
|
|
||||||
-- : 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 ! NCase n Gen ++ cn.s ! NCase num.n k ;
|
s = \\n,c => let k = npform2case num.n c
|
||||||
a = RNoAg
|
in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ;
|
||||||
} ;
|
a = RNoAg
|
||||||
|
} ;
|
||||||
|
|
||||||
-- In case the first two are not available, the following applications should in any case be.
|
-- In case the first two are not available, the following applications should in any case be.
|
||||||
|
|
||||||
-- : Num -> NP -> CN -> NP ; -- this man's car(s)
|
-- : Num -> NP -> CN -> NP ; -- this man's car(s)
|
||||||
GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
|
GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
|
||||||
|
|
||||||
-- : Num -> IP -> CN -> IP ; -- whose car(s)
|
-- : Num -> IP -> CN -> IP ; -- whose car(s)
|
||||||
GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
|
GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
|
||||||
|
|
||||||
{-
|
-- : VP -> Adv
|
||||||
|
GerundAdv vp = {s = infVPdefault vp InfDes} ;
|
||||||
|
|
||||||
|
-- : VP -> CN -- publishing of the document (can get a determiner)
|
||||||
|
GerundCN vp = emptyCN ** {
|
||||||
|
s = \\nf => infVPdefault vp {stem = InfM ; suf = []}
|
||||||
|
++ ine.s ! nf ;
|
||||||
|
} where {
|
||||||
|
ine : N = mkN "ine" "ise" "ist" "isesse" "iste" "isi"
|
||||||
|
} ;
|
||||||
|
-- : VP -> NP -- publishing the document (by nature definite)
|
||||||
|
GerundNP vp = MassNP (GerundCN vp) ;
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
lincat
|
-- I - N
|
||||||
VPS = {s : Agr => Str} ;
|
|
||||||
[VPS] = {s1,s2 : Agr => Str} ;
|
|
||||||
VPI = {s : VVType => Agr => Str} ;
|
|
||||||
[VPI] = {s1,s2 : VVType => Agr => Str} ;
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseVPS = twoTable Agr ;
|
|
||||||
ConsVPS = consrTable Agr comma ;
|
|
||||||
|
|
||||||
BaseVPI = twoTable2 VVType Agr ;
|
|
||||||
ConsVPI = consrTable2 VVType Agr comma ;
|
|
||||||
|
|
||||||
MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ;
|
-- : AP -> IComp ; -- "how old"
|
||||||
ConjVPS c xs = conjunctDistrTable Agr c xs ;
|
ICompAP ap = icompAP "kui" ap ;
|
||||||
PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ;
|
|
||||||
|
|
||||||
|
-- : Adv -> IAdv ; -- "how often"
|
||||||
MkVPI vp = mkVPI (lin VP vp) ;
|
IAdvAdv adv = { s = "kui" ++ adv.s } ;
|
||||||
ConjVPI c xs = conjunctDistrTable2 VVType Agr c xs ;
|
|
||||||
ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ;
|
-- : VP -> Adv -- et raamatut paremini näha
|
||||||
|
InOrderToVP vp = {s = "et" ++ infVPdefault vp InfDa} ;
|
||||||
|
|
||||||
|
-- : N2 -> VPSlash
|
||||||
|
N2VPSlash n2 = UseComp (CompCN (UseN2 n2)) ** {c2 = n2.c2} ;
|
||||||
|
|
||||||
|
-- : VPSlash -> NP -> NP ; publishing of the document
|
||||||
|
-- NominalizeVPSlashNP vpslash np = {} ;
|
||||||
|
|
||||||
|
|
||||||
-------- two-place verb conjunction
|
---------------------------------
|
||||||
|
-- P
|
||||||
lincat
|
|
||||||
VPS2 = {s : Agr => Str ; c2 : Str} ;
|
|
||||||
[VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ;
|
|
||||||
VPI2 = {s : VVType => Agr => Str ; c2 : Str} ;
|
|
||||||
[VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ;
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
MkVPS2 t p vpsl = mkVPS (lin Temp t) (lin Pol p) (lin VP vpsl) ** {c2 = vpsl.c2} ;
|
|
||||||
MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ;
|
|
||||||
|
|
||||||
BaseVPS2 x y = twoTable Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
|
-- : VPSlash -> NP -> VP ; -- be begged by her to go
|
||||||
ConsVPS2 x xs = consrTable Agr comma x xs ** {c2 = xs.c2} ;
|
PassAgentVPSlash vps np = let vp : VP = PassVPSlash vps in vp ** {
|
||||||
|
adv = vp.adv ++ appCompl True Pos by8agent_Prep np ;
|
||||||
BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
|
} ;
|
||||||
ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ;
|
|
||||||
|
|
||||||
|
|
||||||
ConjVPS2 c xs = conjunctDistrTable Agr c xs ** {c2 = xs.c2} ;
|
-- : VPSlash -> VP ; -- be forced to sleep
|
||||||
ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2} ;
|
PassVPSlash vps = vps ** {
|
||||||
|
s = \\vf => case vf of {
|
||||||
|
VIFin t => vps.s ! VIPass t ;
|
||||||
|
x => vps.s ! x } ;
|
||||||
|
sc = compl2subjcase vps.c2
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- : VPSlash -> AP ; -- täna leitud
|
||||||
|
PastPartAP vp = {
|
||||||
|
s = \\_,_ => vp2adv <vp : VP> <True : Bool> <PastPart Pass : VForm> ;
|
||||||
|
infl = Invariable
|
||||||
|
} ;
|
||||||
|
|
||||||
ComplVPS2 vps2 np = {} ;
|
-- : VP -> AP ; -- (the man) looking at Mary / filme vaatav (mees)
|
||||||
ComplVPI2 vpi2 np = {} ;
|
PresPartAP vp = {
|
||||||
|
s = \\_,_ => vp2adv vp True VIPresPart ;
|
||||||
|
infl = Invariable
|
||||||
|
} ;
|
||||||
|
|
||||||
oper
|
-- : VPSlash -> NP -> AP -- hobisukeldujate poolt leitud (süvaveepomm)
|
||||||
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {} ;
|
PastPartAgentAP vp np = {
|
||||||
|
s = \\_,_ => appCompl True Pos by8agent_Prep np
|
||||||
mkVPI : VP -> VPI = \vp -> lin VPI {} ;
|
++ vp2adv <vp : VP> <True : Bool> <PastPart Pass : VForm> ;
|
||||||
|
infl = Invariable
|
||||||
|
} ;
|
||||||
|
|
||||||
-----
|
PositAdVAdj = PositAdvAdj ;
|
||||||
-}
|
|
||||||
|
|
||||||
lin
|
-- : AP -> VP -> Cl ; -- it is good to walk / on hea kõndida
|
||||||
-- : AP -> IComp ; -- "how old"
|
PredAPVP ap vp =
|
||||||
ICompAP ap = icompAP "kui" ap ;
|
let heaOllaVP : VP = insertObj (\\_,_,_ => ap.s ! True ! NCase Sg Nom) vp ; -- puts AP into the s2 field
|
||||||
|
heaOllaComp : Comp = CompVP ASimul PPos heaOllaVP ; -- 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 ;
|
||||||
|
|
||||||
-- : Adv -> IAdv ; -- "how often"
|
-- : IAdv -> VP -> QCl ; -- how to walk?
|
||||||
IAdvAdv adv = { s = "kui" ++ adv.s } ;
|
PredIAdvVP iadv vp = {s = \\t,a,p => iadv.s ++ infVPdefault vp InfMa} ;
|
||||||
|
|
||||||
-- : VP -> AP ; -- (the man) looking at Mary / filme vaatav (mees)
|
PrepCN prep cn = PrepNP prep (MassNP cn) ;
|
||||||
PresPartAP vp = {
|
|
||||||
s = \\_,_ => vp2adv vp True VIPresPart ;
|
|
||||||
infl = Invariable
|
|
||||||
} ;
|
|
||||||
|
|
||||||
{- TODO: need to change VP to get the following 3 functions to work properly:
|
ProDrop pron = pron ** {s = \\_ => []} ;
|
||||||
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!
|
|
||||||
-- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore)
|
|
||||||
EmbedPresPart vp =
|
|
||||||
let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! }
|
|
||||||
{s = vp2adv vp True VI } ;
|
|
||||||
|
|
||||||
-- : VP -> CN -- publishing of the document (can get a determiner)
|
ProgrVPSlash vps = ProgrVP vps ** vps ;
|
||||||
GerundCN vp = {} ;
|
|
||||||
|
|
||||||
-- : VP -> NP -- publishing the document (by nature definite)
|
PurposeVP = InOrderToVP ; --- is there a difference?
|
||||||
GerundNP vp = {} ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
-- : VPSlash -> AP ; -- täna leitud
|
oper
|
||||||
PastPartAP vp = {
|
-- calling infVP with the "default arguments": NPCase Nom, Pos, agrP3 Sg
|
||||||
s = \\_,_ => vp2adv vp True (VIPass Past) ;
|
infVPdefault : VP -> InfForms -> Str = infVP (NPCase Nom) Pos (agrP3 Sg) ;
|
||||||
infl = Invariable } ;
|
|
||||||
|
|
||||||
-- : VPSlash -> NP -> AP -- hobisukeldujate poolt leitud (süvaveepomm)
|
vp2adv = overload {
|
||||||
PastPartAgentAP vp np = {
|
|
||||||
s = \\_,_ => np.s ! NPCase Gen ++ "poolt"
|
|
||||||
++ vp2adv vp True (VIPass Past) ;
|
|
||||||
infl = Invariable } ;
|
|
||||||
|
|
||||||
-- : VP -> Adv
|
vp2adv : R.VP -> Bool -> VIForm -> Str = \vp,sentIsPos,vif ->
|
||||||
GerundAdv vp =
|
let vpforms : {fin,inf : Str} = case vif of {
|
||||||
{ s = vp2adv vp True (VIInf InfDes) } ;
|
VIInf if => applyInfFormsVP {stem=if ; suf="a"} vp ; --- this oper shouldn't be used if you want to use an InfForm but just trying to be robust here
|
||||||
|
_ => mkVPForms vp.v ! vif ! Simul ! Pos ! agrP3 Sg} ;
|
||||||
WithoutVP vp = -- ilma raamatut nägemata
|
in vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut
|
||||||
{ s = "ilma" ++ vp2adv vp False (VIInf InfMata) } ;
|
++ vp.adv -- paremini
|
||||||
|
++ vp.p -- ära
|
||||||
InOrderToVP vp = -- et raamatut paremini näha
|
++ vpforms.fin -- tunda/tundes/tundmata/...
|
||||||
{ s = "et" ++ vp2adv vp True (VIInf InfDa) } ;
|
++ vpforms.inf -- TODO is this necessary???
|
||||||
|
++ vp.ext ;
|
||||||
ByVP vp =
|
vp2adv : R.VP -> Bool -> VForm -> Str = \vp,sentIsPos,vf ->
|
||||||
{ s = vp2adv vp True (VIInf InfDes) } ;
|
vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut
|
||||||
|
++ vp.adv -- paremini
|
||||||
oper
|
++ vp.p -- ära
|
||||||
vp2adv : R.VP -> Bool -> VIForm -> Str = \vp,sentIsPos,vif ->
|
++ vp.v.s ! vf -- tuntud
|
||||||
vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut
|
++ vp.ext
|
||||||
++ vp.adv -- paremini
|
|
||||||
++ vp.p -- ära
|
|
||||||
++ (vp.s ! vif ! Simul ! Pos ! agrP3 Sg).fin -- tunda/tundes/tundmata/...
|
|
||||||
++ vp.ext ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
{-
|
|
||||||
|
|
||||||
NominalizeVPSlashNP vpslash np = {} ;
|
|
||||||
PassVPSlash vps = passVPSlash (lin VPS vps) [] ;
|
|
||||||
PassAgentVPSlash vps np = passVPSlash (lin VPS vps) ("by" ++ np.s ! NPAcc) ;
|
|
||||||
|
|
||||||
--- AR 7/3/2013
|
|
||||||
ComplSlashPartLast vps np = {} ;
|
|
||||||
-}
|
|
||||||
-- : NP -> Cl ; -- there exists a number / there exist numbers
|
|
||||||
ExistsNP = IdiomEst.ExistNP ;
|
|
||||||
|
|
||||||
{-
|
|
||||||
ComplBareVS v s = insertExtra s.s (predV v) ;
|
|
||||||
SlashBareV2S v s = insertExtrac s.s (predVc v) ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
-- : N -> N -> N ; -- control system / controls system / control-system
|
|
||||||
CompoundN noun cn = lin N {
|
|
||||||
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf
|
|
||||||
} ;
|
} ;
|
||||||
{-
|
---------------------------------
|
||||||
-- : N -> A -> AP ; -- language independent / language-independent
|
-- S - W
|
||||||
CompoundAP noun adj = {} ;
|
|
||||||
|
|
||||||
-- : VS -> Utt -> VP ; -- say: "today"
|
|
||||||
ComplDirectVS vs utt = {} ;
|
|
||||||
-- : 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)
|
-- SlashBareV2S v s = insertExtrapos s.s (predV v) ** v ;
|
||||||
AdjAsCN ap = { s = ap.s ! True } ; -- True = it's a modifier, not a predicate
|
|
||||||
|
|
||||||
AdjAsNP ap = {
|
UseDAP,
|
||||||
s = table { NPCase c => ap.s ! True ! NCase Sg c ;
|
UseDAPFem,
|
||||||
NPAcc => ap.s ! True ! NCase Sg Gen } ;
|
UseDAPMasc = DetNP ;
|
||||||
a = agrP3 Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
{-
|
|
||||||
lincat
|
|
||||||
RNP = {s : Agr => Str} ;
|
|
||||||
RNPList = {s1,s2 : Agr => Str} ;
|
|
||||||
|
|
||||||
lin
|
UttAccIP ip = {s = linIP NPAcc ip} ;
|
||||||
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
UttAccNP np = {s = linNP NPAcc np} ;
|
||||||
|
UttAdV adv = adv ;
|
||||||
|
UttDatIP ip = {s = linIP (NPCase Part) ip} ; -- is partitive a reasonable translation?
|
||||||
|
UttDatNP np = {s = linNP (NPCase Part) np} ;
|
||||||
|
|
||||||
-- : RNP
|
-- : VP -> Utt ; -- There's no "short form", so just using InfDa instead of InfMa
|
||||||
ReflPron = {s = reflPron} ;
|
UttVPShort vp = {s = infVPdefault vp InfDa} ;
|
||||||
|
|
||||||
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! Nom ++ cn.s ! num.n ! Nom} ;
|
-- : VP -> Adv ; -- ilma raamatut nägemata
|
||||||
PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;
|
WithoutVP vp = {s = "ilma" ++ infVPdefault vp InfMata} ;
|
||||||
|
|
||||||
ConjRNP conj rpns = conjunctDistrTable Agr conj rpns ;
|
|
||||||
|
|
||||||
Base_rr_RNP x y = twoTable Agr x y ;
|
|
||||||
Base_nr_RNP x y = twoTable Agr {s = \\a => x.s ! NPAcc} y ;
|
|
||||||
Base_rn_RNP x y = twoTable Agr x {s = \\a => y.s ! NPAcc} ;
|
|
||||||
Cons_rr_RNP x xs = consrTable Agr comma x xs ;
|
|
||||||
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
|
|
||||||
|
|
||||||
|
|
||||||
---- TODO: RNPList construction
|
|
||||||
|
|
||||||
ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
|
|
||||||
infVP v.typ vp a.a p.p agr)
|
|
||||||
(predVV v) ;
|
|
||||||
-}
|
|
||||||
-- : S -> Comp ; -- (the fact is) that she sleeps
|
|
||||||
CompS s = {s = \\_ => "et" ++ s.s} ;
|
|
||||||
|
|
||||||
-- : QS -> Comp ; -- (the question is) who sleeps
|
|
||||||
CompQS qs = {s = \\_ => qs.s } ;
|
|
||||||
|
|
||||||
-- : Ant -> Pol -> VP -> Comp ; -- (she is) to go
|
|
||||||
CompVP ant pol vp = {s = \\a => infVPAnt ant.a (NPCase Nom) pol.p a vp InfDa } ;
|
|
||||||
|
|
||||||
-- English-specific
|
|
||||||
-- : Pol
|
|
||||||
UncontractedNeg = { s = [] ; p = Neg } ;
|
|
||||||
|
|
||||||
-- : VP -> Utt ; -- There's no "short form", so just using InfMa instead of InfDa
|
|
||||||
UttVPShort vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ;
|
|
||||||
--TODO: maybe InfMa should be default in PhraseEst and InfDa here?
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,56 +1,90 @@
|
|||||||
concrete ExtraEst of ExtraEstAbs = CatEst **
|
concrete ExtraEst of ExtraEstAbs = CatEst **
|
||||||
open ResEst, MorphoEst, Coordination, Prelude, NounEst, StructuralEst, (R = ParamX) in {
|
open ResEst, MorphoEst, Coordination, Prelude, NounEst, StructuralEst, (R = ParamX), (P = ParadigmsEst) in {
|
||||||
flags coding=utf8;
|
flags coding=utf8;
|
||||||
lin
|
lin
|
||||||
GenNP np = {
|
GenNP np = {
|
||||||
s,sp = \\_,_ => np.s ! NPCase Gen ;
|
s,sp = \\_,_ => linNP (NPCase Gen) np ;
|
||||||
isNum = False ;
|
isNum = False ;
|
||||||
isDef = True ; --- "Jussin kolme autoa ovat" ; thus "...on" is missing
|
isDef = True ; --- "Jussin kolme autoa ovat" ; thus "...on" is missing
|
||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
GenCN = caseCN Gen ; -- soome mees
|
GenCN = caseCN Genitive ; -- soome mees
|
||||||
ComitCN = caseCN Comit ; -- puudega mets
|
ComitCN = caseCN Comitative ; -- puudega mets
|
||||||
ElatCN = caseCN Elat ; -- puust laud
|
ElatCN = caseCN Elative ; -- puust laud
|
||||||
AbessCN = caseCN Abess ; -- autota pere
|
AbessCN = caseCN Abessive ; -- autota pere
|
||||||
TerminCN = caseCN Termin ; -- maani kleit
|
TerminCN = caseCN Terminative ; -- maani kleit
|
||||||
|
|
||||||
GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
|
GenIP ip = {s = \\_,_ => linIP (NPCase Gen) ip} ;
|
||||||
|
|
||||||
GenRP num cn = {
|
GenRP num cn = {
|
||||||
s = \\n,c => let k = npform2case num.n c in relPron ! NCase 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)
|
||||||
} ;
|
} ;
|
||||||
oper
|
oper
|
||||||
caseCN : Case -> NP -> CN -> CN = \c,np,cn ->
|
caseCN : CasePlus -> NPhrase -> CNoun -> CNoun = \c,np,cn -> cn ** {
|
||||||
lin CN { s = \\nf => np.s ! NPCase c ++ cn.s ! nf } ;
|
s = \\nf => appCompl True Pos (P.casePrep c) np ++ cn.s ! nf
|
||||||
|
} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
VPI = {s : InfForm => Str} ;
|
VPI = LinVPI ;
|
||||||
[VPI] = {s1,s2 : InfForm => Str} ;
|
[VPI] = LinListVPI ;
|
||||||
-- VPI = {s : Str} ;
|
|
||||||
-- [VPI] = {s1,s2 : Str} ;
|
oper
|
||||||
|
LinVPI : Type = {s : InfStem => Str} ;
|
||||||
|
LinListVPI : Type = {s1,s2 : InfStem => Str} ;
|
||||||
|
|
||||||
|
linVPI : InfForms -> LinVPI -> Str = \inf,vpi -> vpi.s ! inf.stem ;
|
||||||
|
|
||||||
|
-- Version that uses InfStem
|
||||||
|
infVPIF : NPForm -> Polarity -> Agr -> ResEst.VP -> InfStem -> Str = \sc,pol,agr,vp,if ->
|
||||||
|
infVPAnt Simul sc pol agr vp {stem=if ; suf="a"} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseVPI = twoTable InfForm ;
|
BaseVPI = twoTable InfStem ;
|
||||||
ConsVPI = consrTable InfForm comma ;
|
ConsVPI = consrTable InfStem comma ;
|
||||||
|
|
||||||
MkVPI vp = {s = \\i => infVP (NPCase Nom) Pos (agrP3 Sg) vp i} ;
|
MkVPI vp = {s = \\i => infVPIF (NPCase Nom) Pos (agrP3 Sg) vp i} ;
|
||||||
ConjVPI = conjunctDistrTable InfForm ;
|
ConjVPI = conjunctDistrTable InfStem ;
|
||||||
ComplVPIVV vv vpi =
|
ComplVPIVV vv vpi =
|
||||||
insertObj (\\_,_,_ => vpi.s ! vv.vi) (predV vv) ;
|
insertObj (\\_,_,_ => vpi.s ! vv.vi.stem) (predV vv) ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
VPS = {
|
VPS = LinVPS ;
|
||||||
s : Agr => Str ;
|
[VPS] = LinListVPS ;
|
||||||
|
oper
|
||||||
|
LinVPS : Type = {
|
||||||
|
s : Agr => Str ;
|
||||||
sc : NPForm ; --- can be different for diff parts
|
sc : NPForm ; --- can be different for diff parts
|
||||||
} ;
|
} ;
|
||||||
|
LinListVPS : Type = {
|
||||||
[VPS] = {
|
s1,s2 : Agr => Str ;
|
||||||
s1,s2 : Agr => Str ;
|
|
||||||
sc : NPForm ; --- take the first: minä osaan kutoa ja täytyy virkata
|
sc : NPForm ; --- take the first: minä osaan kutoa ja täytyy virkata
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
linVPS : Agr -> {s : Agr => Str} -> Str = \agr,vps -> vps.s ! agr ;
|
||||||
|
|
||||||
|
-- This internal oper isn't used in any of the RGL linearisations, but can be useful for application grammars
|
||||||
|
-- It produces a telegraphic style in past participle, 'võetud …' instead of 'on/oli võetud …'.
|
||||||
|
-- It differs from PastPartAP in word order, and it also takes polarity.
|
||||||
|
TelegraphicPastPartPassVPS : Pol -> ResEst.VP -> VPS = \p,vp ->
|
||||||
|
let sentIsPos : Bool = case p.p of {
|
||||||
|
Neg => False ;
|
||||||
|
Pos => True } ;
|
||||||
|
neg : Str = case p.p of {
|
||||||
|
Neg => "ei" ;
|
||||||
|
Pos => [] } ;
|
||||||
|
in lin VPS {
|
||||||
|
s = \\a => neg -- ei
|
||||||
|
++ vp.v.s ! (PastPart Pass) -- võetud
|
||||||
|
++ vp.s2 ! sentIsPos ! p.p ! a -- vereanalüüs
|
||||||
|
++ vp.adv -- eile
|
||||||
|
++ vp.p
|
||||||
|
++ vp.ext ;
|
||||||
|
sc = vp.sc
|
||||||
|
};
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseVPS x y = twoTable Agr x y ** {sc = x.sc} ;
|
BaseVPS x y = twoTable Agr x y ** {sc = x.sc} ;
|
||||||
ConsVPS x y = consrTable Agr comma x y ** {sc = x.sc} ;
|
ConsVPS x y = consrTable Agr comma x y ** {sc = x.sc} ;
|
||||||
@@ -60,7 +94,7 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
MkVPS t p vp = { -- Temp -> Pol -> VP -> VPS ;
|
MkVPS t p vp = { -- Temp -> Pol -> VP -> VPS ;
|
||||||
s = \\a => let vps = vp.s ! VIFin t.t ! t.a ! p.p ! a
|
s = \\a => let vps = mkVPForms vp.v ! VIFin t.t ! t.a ! p.p ! a
|
||||||
in
|
in
|
||||||
t.s ++ p.s ++
|
t.s ++ p.s ++
|
||||||
vps.fin ++ vps.inf ++
|
vps.fin ++ vps.inf ++
|
||||||
@@ -79,102 +113,103 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
|
|
||||||
PassAgentVPSlash vp np = vp ;
|
PassAgentVPSlash vp np = vp ;
|
||||||
{-
|
{-
|
||||||
s = {s = vp.s.s ; h = vp.s.h ; p = vp.s.p ; sc = npform2subjcase vp.c2.c} ;
|
s = {s = vp.s.s ; h = vp.s.h ; p = vp.s.p ; sc = npform2subjcase vp.c2.c} ;
|
||||||
s2 = \\b,p,a => np.s ! NPCase Nom ++ vp.s2 ! b ! p ! a ;
|
s2 = \\b,p,a => linNP (NPCase Nom) np ++ vp.s2 ! b ! p ! a ;
|
||||||
adv = vp.adv ;
|
adv = vp.adv ;
|
||||||
ext = vp.ext ;
|
ext = vp.ext ;
|
||||||
vptyp = vp.vptyp ;
|
vptyp = vp.vptyp ;
|
||||||
} ; -}
|
} ; -}
|
||||||
|
|
||||||
AdvExistNP adv np =
|
AdvExistNP adv np =
|
||||||
mkClause (\_ -> adv.s) np.a (insertObj
|
mkClause (\_ -> adv.s) np.a (insertObj
|
||||||
(\\_,b,_ => np.s ! NPCase Nom) (predV (verbOlema ** {sc = NPCase Nom}))) ;
|
(\\_,b,_ => linNP (NPCase Nom) np) (predV (verbOlema ** {sc = NPCase Nom}))) ;
|
||||||
|
|
||||||
RelExistNP prep rp np = {
|
RelExistNP prep rp np = {
|
||||||
s = \\t,ant,bo,ag =>
|
s = \\t,ant,bo,ag =>
|
||||||
let
|
let
|
||||||
n = complNumAgr ag ;
|
n = complNumAgr ag ;
|
||||||
cl = mkClause
|
cl = mkClause
|
||||||
(\_ -> appCompl True Pos prep (rp2np n rp))
|
(\_ -> appCompl True Pos prep (rp2np n rp))
|
||||||
np.a
|
np.a
|
||||||
(insertObj
|
(insertObj
|
||||||
(\\_,b,_ => np.s ! NPCase Nom)
|
(\\_,b,_ => linNP (NPCase Nom) np)
|
||||||
(predV (verbOlema ** {sc = NPCase Nom}))) ;
|
(predV (verbOlema ** {sc = NPCase Nom}))) ;
|
||||||
in
|
in
|
||||||
cl.s ! t ! ant ! bo ! SDecl ;
|
cl.s ! t ! ant ! bo ;
|
||||||
c = NPCase Nom
|
c = NPCase Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvPredNP adv v np =
|
AdvPredNP adv v np =
|
||||||
mkClause (\_ -> adv.s) np.a (insertObj
|
mkClause (\_ -> adv.s) np.a (insertObj
|
||||||
(\\_,b,_ => np.s ! NPCase Nom) (predV v)) ;
|
(\\_,b,_ => linNP (NPCase Nom) np) (predV v)) ;
|
||||||
|
|
||||||
|
ICompExistNP adv np =
|
||||||
|
let subj : Polarity -> Str = \_ -> adv.s ! np.a ;
|
||||||
|
pred : ResEst.VP = insertObj
|
||||||
|
(\\_,b,_ => linNP (NPCase Nom) np)
|
||||||
|
(predV (verbOlema ** {sc = NPCase Nom})) ;
|
||||||
|
in mkClause subj np.a pred ;
|
||||||
|
|
||||||
ICompExistNP adv np =
|
|
||||||
let cl = mkClause (\_ -> adv.s ! np.a) np.a (insertObj
|
|
||||||
(\\_,b,_ => np.s ! NPCase Nom) (predV (verbOlema ** {sc = NPCase Nom}))) ;
|
|
||||||
in {
|
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
|
||||||
} ;
|
|
||||||
|
|
||||||
IAdvPredNP iadv v np =
|
IAdvPredNP iadv v np =
|
||||||
let cl = mkClause (\_ -> iadv.s) np.a (insertObj
|
let subj : Polarity -> Str = \_ -> iadv.s ;
|
||||||
(\\_,b,_ => np.s ! v.sc) (predV v)) ;
|
pred : ResEst.VP = insertObj
|
||||||
in {
|
(\\_,b,_ => linNP v.sc np)
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
(predV v) ;
|
||||||
} ;
|
in mkClause subj np.a pred ;
|
||||||
|
|
||||||
|
|
||||||
-- i_implicPron = mkPronoun [] "minun" "minua" "minuna" "minuun" Sg P1 ;
|
-- i_implicPron = mkPronoun [] "minun" "minua" "minuna" "minuun" Sg P1 ;
|
||||||
whatPart_IP = {
|
whatPart_IP = emptyIP ** {
|
||||||
s = table {
|
s = table {
|
||||||
NPCase Nom | NPAcc => "mitä" ;
|
NPCase Nom | NPAcc => "mida" ;
|
||||||
c => whatSg_IP.s ! c
|
c => whatSg_IP.s ! c
|
||||||
} ;
|
} ;
|
||||||
n = Sg
|
n = Sg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PartCN cn =
|
PartCN cn =
|
||||||
let
|
let
|
||||||
acn = DetCN (DetQuant IndefArt NumSg) cn
|
acn = DetCN (DetQuant IndefArt NumSg) cn
|
||||||
in {
|
in acn ** {
|
||||||
s = table {
|
s = table {
|
||||||
NPCase Nom | NPAcc => acn.s ! NPCase ResEst.Part ;
|
NPCase Nom | NPAcc => acn.s ! NPCase ResEst.Part ;
|
||||||
c => acn.s ! c
|
c => acn.s ! c
|
||||||
} ;
|
} ;
|
||||||
a = acn.a ;
|
|
||||||
isPron = False ; isNeg = False
|
isPron = False ; isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--The reflexive possessive "oma"
|
--The reflexive possessive "oma"
|
||||||
--for "ta näeb oma koera" instead of *"tema koera"
|
--for "ta näeb oma koera" instead of *"tema koera"
|
||||||
OmaPoss = {s,sp = \\_,_ => "oma" ; isDef,isNeg,isNum = False} ;
|
OmaPoss = {s,sp = \\_,_ => "oma" ; isDef,isNeg,isNum = False} ;
|
||||||
|
|
||||||
ma_Pron = shortPronoun "ma" "mu" "mind" "minu" Sg P1 ;
|
ma_Pron = shortPronoun "ma" "mu" "mind" "minu" Sg P1 ;
|
||||||
sa_Pron = shortPronoun "sa" "su" "sind" "sinu" Sg P2;
|
sa_Pron = shortPronoun "sa" "su" "sind" "sinu" Sg P2;
|
||||||
ta_Pron = shortPronoun "ta" "ta" "teda" "tema" Sg P3 ;
|
ta_Pron = shortPronoun "ta" "ta" "teda" "tema" Sg P3 ;
|
||||||
me_Pron =
|
me_Pron =
|
||||||
{s = table {
|
{s = table {
|
||||||
NPCase Nom => "me" ;
|
NPCase Nom => "me" ;
|
||||||
n => (we_Pron.s) ! n
|
n => (we_Pron.s) ! n
|
||||||
} ;
|
} ;
|
||||||
a = Ag Pl P1 } ;
|
a = Ag Pl P1 } ;
|
||||||
|
|
||||||
te_Pron =
|
te_Pron =
|
||||||
{s = table {
|
{s = table {
|
||||||
NPCase Nom => "te" ;
|
NPCase Nom => "te" ;
|
||||||
n => (youPl_Pron.s) ! n
|
n => (youPl_Pron.s) ! n
|
||||||
} ;
|
} ;
|
||||||
a = Ag Pl P2 } ;
|
a = Ag Pl P2 } ;
|
||||||
|
|
||||||
nad_Pron =
|
nad_Pron =
|
||||||
{s = table {
|
{s = table {
|
||||||
NPCase Nom => "nad" ;
|
NPCase Nom => "nad" ;
|
||||||
n => (they_Pron.s) ! n
|
n => (they_Pron.s) ! n
|
||||||
} ;
|
} ;
|
||||||
a = Ag Pl P3 } ;
|
a = Ag Pl P3 } ;
|
||||||
|
|
||||||
---- copied from VerbEst.CompAP, should be shared
|
---- copied from VerbEst.CompAP, should be shared
|
||||||
ICompAP ap = {
|
ICompAP ap = {
|
||||||
s = \\agr =>
|
s = \\agr =>
|
||||||
let
|
let
|
||||||
n = complNumAgr agr ;
|
n = complNumAgr agr ;
|
||||||
c = case n of {
|
c = case n of {
|
||||||
@@ -187,68 +222,68 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
IAdvAdv adv = {s = "kui" ++ adv.s} ;
|
IAdvAdv adv = {s = "kui" ++ adv.s} ;
|
||||||
|
|
||||||
ProDrop p = {
|
ProDrop p = {
|
||||||
s = table {NPCase (Nom | Gen) => [] ; c => p.s ! c} ;
|
s = table {NPCase (Nom | Gen) => [] ; c => p.s ! c} ;
|
||||||
---- drop Gen only works in adjectival position
|
---- drop Gen only works in adjectival position
|
||||||
a = p.a
|
a = p.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : Pron -> Quant ;
|
-- : 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 ;
|
||||||
isNeg = False
|
isNeg = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
ClPlus, ClPlusObj, ClPlusAdv = ClausePlus ;
|
ClPlus, ClPlusObj, ClPlusAdv = ClausePlus ;
|
||||||
Part = {s : Str} ;
|
Part = {s : Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
S_SVO part t p clp =
|
S_SVO part t p clp =
|
||||||
let
|
let
|
||||||
cl = clp.s ! t.t ! t.a ! p.p ;
|
cl = clp.s ! t.t ! t.a ! p.p ;
|
||||||
pa = part.s ----
|
pa = part.s ----
|
||||||
in
|
in
|
||||||
{s = t.s ++ p.s ++ cl.subj ++ pa ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
|
{s = t.s ++ p.s ++ cl.subj ++ pa ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
|
||||||
|
|
||||||
S_OSV part t p clp =
|
S_OSV part t p clp =
|
||||||
let
|
let
|
||||||
cl = clp.s ! t.t ! t.a ! p.p ;
|
cl = clp.s ! t.t ! t.a ! p.p ;
|
||||||
pa = part.s ----
|
pa = part.s ----
|
||||||
in
|
in
|
||||||
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.adv ++ cl.ext} ;
|
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.adv ++ cl.ext} ;
|
||||||
S_VSO part t p clp =
|
S_VSO part t p clp =
|
||||||
let
|
let
|
||||||
cl = clp.s ! t.t ! t.a ! p.p ;
|
cl = clp.s ! t.t ! t.a ! p.p ;
|
||||||
pa = part.s
|
pa = part.s
|
||||||
in
|
in
|
||||||
{s = t.s ++ p.s ++ cl.fin ++ pa ++ cl.subj ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
|
{s = t.s ++ p.s ++ cl.fin ++ pa ++ cl.subj ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
|
||||||
S_ASV part t p clp =
|
S_ASV part t p clp =
|
||||||
let
|
let
|
||||||
cl = clp.s ! t.t ! t.a ! p.p ;
|
cl = clp.s ! t.t ! t.a ! p.p ;
|
||||||
pa = part.s
|
pa = part.s
|
||||||
in
|
in
|
||||||
{s = t.s ++ p.s ++ cl.adv ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.ext} ;
|
{s = t.s ++ p.s ++ cl.adv ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.ext} ;
|
||||||
|
|
||||||
S_OVS part t p clp =
|
S_OVS part t p clp =
|
||||||
let
|
let
|
||||||
cl = clp.s ! t.t ! t.a ! p.p ;
|
cl = clp.s ! t.t ! t.a ! p.p ;
|
||||||
pa = part.s ----
|
pa = part.s ----
|
||||||
in
|
in
|
||||||
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.fin ++ cl.inf ++ cl.subj ++ cl.adv ++ cl.ext} ;
|
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.fin ++ cl.inf ++ cl.subj ++ cl.adv ++ cl.ext} ;
|
||||||
|
|
||||||
PredClPlus np vp = mkClausePlus (subjForm np vp.sc) np.a vp ;
|
PredClPlus np vp = mkClausePlus (subjForm np vp.sc) np.a vp ;
|
||||||
PredClPlusFocSubj np vp = insertKinClausePlus 0 (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
PredClPlusFocSubj np vp = insertKinClausePlus 0 (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
||||||
PredClPlusFocVerb np vp = insertKinClausePlus 1 (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
PredClPlusFocVerb np vp = insertKinClausePlus 1 (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
||||||
PredClPlusObj np vps obj =
|
PredClPlusObj np vps obj =
|
||||||
insertObjClausePlus 0 False (\\b => appCompl True b vps.c2 obj) (mkClausePlus (subjForm np vps.sc) np.a vps) ;
|
insertObjClausePlus 0 False (\\b => appCompl True b vps.c2 obj) (mkClausePlus (subjForm np vps.sc) np.a vps) ;
|
||||||
PredClPlusFocObj np vps obj =
|
PredClPlusFocObj np vps obj =
|
||||||
insertObjClausePlus 0 True (\\b => appCompl True b vps.c2 obj) (mkClausePlus (subjForm np vps.sc) np.a vps) ;
|
insertObjClausePlus 0 True (\\b => appCompl True b vps.c2 obj) (mkClausePlus (subjForm np vps.sc) np.a vps) ;
|
||||||
PredClPlusAdv np vp adv =
|
PredClPlusAdv np vp adv =
|
||||||
insertObjClausePlus 1 False (\\_ => adv.s) (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
insertObjClausePlus 1 False (\\_ => adv.s) (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
||||||
PredClPlusFocAdv np vp adv =
|
PredClPlusFocAdv np vp adv =
|
||||||
insertObjClausePlus 1 True (\\_ => adv.s) (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
insertObjClausePlus 1 True (\\_ => adv.s) (mkClausePlus (subjForm np vp.sc) np.a vp) ;
|
||||||
|
|
||||||
ClPlusWithObj c = c ;
|
ClPlusWithObj c = c ;
|
||||||
@@ -256,4 +291,4 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
|
|||||||
|
|
||||||
gi_Part = ss "gi" | ss "ki" ;
|
gi_Part = ss "gi" | ss "ki" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
abstract ExtraEstAbs = Extra [
|
abstract ExtraEstAbs = Extra [
|
||||||
GenNP,GenIP,GenRP,
|
GenNP,GenIP,GenRP,IP,IQuant,Num,CN,RP,
|
||||||
PassVPSlash, PassAgentVPSlash,
|
PassVPSlash, PassAgentVPSlash, VPSlash,
|
||||||
VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI,
|
VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI,
|
||||||
VPS,ListVPS,BaseVPS,ConsVPS,ConjVPS,MkVPS,PredVPS,ConjVPS,Tense,Temp,Pol,S,
|
VPS,ListVPS,BaseVPS,ConsVPS,ConjVPS,MkVPS,PredVPS,ConjVPS,Tense,Temp,Pol,S,
|
||||||
VV,VP,Conj,NP,Quant,IAdv,IComp,ICompAP,IAdvAdv,Adv,AP, Pron, ProDrop] ** {
|
VV,VP,Conj,NP,Quant,IAdv,IComp,ICompAP,IAdvAdv,Adv,AP, Pron, ProDrop] ** {
|
||||||
@@ -33,7 +33,7 @@ abstract ExtraEstAbs = Extra [
|
|||||||
me_Pron : Pron ;
|
me_Pron : Pron ;
|
||||||
te_Pron : Pron ;
|
te_Pron : Pron ;
|
||||||
nad_Pron : Pron ;
|
nad_Pron : Pron ;
|
||||||
|
|
||||||
OmaPoss : Quant ; -- Reflexive possessive "oma"
|
OmaPoss : Quant ; -- Reflexive possessive "oma"
|
||||||
ProDropPoss : Pron -> Quant ; -- vaimoni --TODO Is this relevant in Estonian? Is the agreement of pronoun ever needed, or is it the same as oma?
|
ProDropPoss : Pron -> Quant ; -- vaimoni --TODO Is this relevant in Estonian? Is the agreement of pronoun ever needed, or is it the same as oma?
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
concrete GrammarEst of Grammar =
|
concrete GrammarEst of Grammar =
|
||||||
NounEst,
|
NounEst,
|
||||||
VerbEst,
|
VerbEst,
|
||||||
AdjectiveEst,
|
AdjectiveEst,
|
||||||
AdverbEst,
|
AdverbEst,
|
||||||
NumeralEst,
|
NumeralEst,
|
||||||
|
|||||||
@@ -1,34 +1,28 @@
|
|||||||
concrete IdiomEst of Idiom = CatEst **
|
concrete IdiomEst of Idiom = CatEst **
|
||||||
open MorphoEst, ParadigmsEst, Prelude in {
|
open MorphoEst, ParadigmsEst, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ; coding=utf8;
|
flags optimize=all_subs ; coding=utf8;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
let
|
let cas : Polarity -> NPForm = \p -> case p of {
|
||||||
cas : Polarity -> NPForm = \p -> case p of {
|
Pos => NPCase Nom ; -- on olemas lammas
|
||||||
Pos => NPCase Nom ; -- on olemas lammas
|
Neg => NPCase Part } ; -- ei ole olemas lammast
|
||||||
Neg => NPCase Part -- ei ole olemas lammast
|
vp = insertObj (\\_,b,_ => "olemas" ++ linNP (cas b) np) (predV olla)
|
||||||
} ;
|
in existClause noSubj (agrP3 Sg) vp ;
|
||||||
vp = insertObj (\\_,b,_ => "olemas" ++ np.s ! cas b) (predV olla)
|
|
||||||
in
|
|
||||||
existClause noSubj (agrP3 Sg) vp ;
|
|
||||||
|
|
||||||
ExistIP ip =
|
ExistIP ip =
|
||||||
let
|
let cas : NPForm = NPCase Nom ; ---- also partitive in Extra
|
||||||
cas : NPForm = NPCase Nom ; ---- also partitive in Extra
|
vp : MorphoEst.VP = insertObj (\\_,b,_ => "olemas") (predV olla) ;
|
||||||
vp = insertObj (\\_,b,_ => "olemas") (predV olla) ;
|
subj : MorphoEst.NPhrase = ip ** {isPron = False ; a = agrP3 ip.n} ;
|
||||||
cl = existClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) cas) (agrP3 Sg) vp
|
in existClause (subjForm subj cas) (agrP3 Sg) vp ;
|
||||||
in {
|
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- Notice the nominative in the cleft $NP$: "se on Matti josta Liisa pitää"
|
-- Notice the nominative in the cleft $NP$: "se on Matti josta Liisa pitää"
|
||||||
-- Est: "see on Mati, kellest Liis lugu peab"
|
-- Est: "see on Mati, kellest Liis lugu peab"
|
||||||
|
|
||||||
CleftNP np rs = mkClause (\_ -> "see") (agrP3 Sg)
|
CleftNP np rs = mkClause (\_ -> "see") (agrP3 Sg)
|
||||||
(insertExtrapos (rs.s ! np.a)
|
(insertExtrapos (rs.s ! np.a)
|
||||||
(insertObj (\\_,_,_ => np.s ! NPCase Nom) (predV olla))) ;
|
(insertObj (\\_,_,_ => linNP (NPCase Nom) np) (predV olla))) ;
|
||||||
|
|
||||||
-- This gives the almost forbidden "se on Porissa kun Matti asuu".
|
-- This gives the almost forbidden "se on Porissa kun Matti asuu".
|
||||||
-- Est: "see on Toris, kus Mati elab" (?)
|
-- Est: "see on Toris, kus Mati elab" (?)
|
||||||
@@ -39,35 +33,20 @@ concrete IdiomEst of Idiom = CatEst **
|
|||||||
|
|
||||||
ImpersCl vp = mkClause noSubj (agrP3 Sg) vp ;
|
ImpersCl vp = mkClause noSubj (agrP3 Sg) vp ;
|
||||||
|
|
||||||
GenericCl vp = mkClause noSubj (agrP3 Sg) {
|
GenericCl vp = mkClause noSubj (agrP3 Sg) (passiveVP vp) ;
|
||||||
s = \\_ => vp.s ! VIPass Pres ;
|
|
||||||
s2 = vp.s2 ;
|
|
||||||
adv = vp.adv ;
|
|
||||||
p = vp.p ;
|
|
||||||
ext = vp.ext ;
|
|
||||||
sc = vp.sc ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ProgrVP vp =
|
ProgrVP vp = vp ** {
|
||||||
let
|
v = verbOlema ;
|
||||||
inf = (vp.s ! VIInf InfMas ! Simul ! Pos ! agrP3 Sg).fin ;
|
s2 = \\b,p,a => vp.s2 ! b ! p ! a ++ (applyInfFormsVP InfMas vp).fin ;
|
||||||
on = predV olla
|
} ;
|
||||||
in {
|
|
||||||
s = on.s ;
|
|
||||||
s2 = \\b,p,a => vp.s2 ! b ! p ! a ++ inf ;
|
|
||||||
adv = vp.adv ;
|
|
||||||
p = vp.p ;
|
|
||||||
ext = vp.ext ;
|
|
||||||
sc = vp.sc ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- This gives "otetaan oluet" instead of "ottakaamme oluet".
|
-- This gives "otetaan oluet" instead of "ottakaamme oluet".
|
||||||
-- The imperative is not available in a $VP$.
|
-- The imperative is not available in a $VP$.
|
||||||
|
|
||||||
ImpPl1 vp =
|
ImpPl1 vp =
|
||||||
let vps = vp.s ! VIPass Pres ! Simul ! Pos ! Ag Pl P1
|
let vps = mkVPForms vp.v ! VIPass Pres ! Simul ! Pos ! Ag Pl P1
|
||||||
in
|
in
|
||||||
{s = vps.fin ++ vps.inf ++
|
{s = vps.fin ++ vps.inf ++
|
||||||
vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.p ++ vp.ext
|
vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.p ++ vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
concrete LexiconEst of Lexicon = CatEst ** open MorphoEst, ParadigmsEst, Prelude in {
|
concrete LexiconEst of Lexicon = CatEst ** open MorphoEst, ParadigmsEst, Prelude in {
|
||||||
|
|
||||||
flags
|
flags
|
||||||
optimize=values ; coding=utf8;
|
optimize=values ; coding=utf8;
|
||||||
|
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ lin
|
|||||||
-- Unfortunately, we cannot use a similar trick for the source (*Põltsamaast vs Põltsamaalt).
|
-- Unfortunately, we cannot use a similar trick for the source (*Põltsamaast vs Põltsamaalt).
|
||||||
distance_N3 = mkN3 (mkN "kaugus") celative (casePrep terminative) ;
|
distance_N3 = mkN3 (mkN "kaugus") celative (casePrep terminative) ;
|
||||||
doctor_N = mkN "arst" ;
|
doctor_N = mkN "arst" ;
|
||||||
dog_N = mkN "koer" "koera" "koera" ;
|
dog_N = mkN "koer" "koera" "koera" "koerasse" "koerte" "koeri" ;
|
||||||
door_N = mkN "uks" "ukse" "ust" "uksesse" "uste" "uksi" ;
|
door_N = mkN "uks" "ukse" "ust" "uksesse" "uste" "uksi" ;
|
||||||
drink_V2 = mkV2 (mkV "jooma") cpartitive ;
|
drink_V2 = mkV2 (mkV "jooma") cpartitive ;
|
||||||
easy_A2V = mkA2 (mkA (mkN "lihtne" "lihtsa" "lihtsat" "lihtsasse" "lihtsate" "lihtsaid")) callative ;
|
easy_A2V = mkA2 (mkA (mkN "lihtne" "lihtsa" "lihtsat" "lihtsasse" "lihtsate" "lihtsaid")) callative ;
|
||||||
@@ -160,7 +160,7 @@ lin
|
|||||||
science_N = mkN "teadus" ;
|
science_N = mkN "teadus" ;
|
||||||
sea_N = mkN "meri" "mere" "merd" "merre" "merede" "meresid" ;
|
sea_N = mkN "meri" "mere" "merd" "merre" "merede" "meresid" ;
|
||||||
seek_V2 = mkV2 (mkV "otsima") cpartitive ;
|
seek_V2 = mkV2 (mkV "otsima") cpartitive ;
|
||||||
see_V2 = mkV2 (mkV "nägema" "näha") ;
|
see_V2 = mkV2 (mkV "nägema" "näha") cpartitive ;
|
||||||
sell_V3 = mkV3 (mkV "müüma" "müüa" "müüb" "müüakse" "müüge" "müüs" "müünud" "müüdud") accPrep callative ;
|
sell_V3 = mkV3 (mkV "müüma" "müüa" "müüb" "müüakse" "müüge" "müüs" "müünud" "müüdud") accPrep callative ;
|
||||||
send_V3 = mkV3 (mkV "saatma") accPrep callative ;
|
send_V3 = mkV3 (mkV "saatma") accPrep callative ;
|
||||||
sheep_N = mkN "lammas" "lamba" "lammast" ;
|
sheep_N = mkN "lammas" "lamba" "lammast" ;
|
||||||
@@ -216,7 +216,7 @@ lin
|
|||||||
yellow_A = mkA (mkN "kollane" "kollase" "kollast" "kollasesse" "kollaste" "kollaseid") ;
|
yellow_A = mkA (mkN "kollane" "kollase" "kollast" "kollasesse" "kollaste" "kollaseid") ;
|
||||||
young_A = mkA (mkN "noor" "noore" "noort") ;
|
young_A = mkA (mkN "noor" "noore" "noort") ;
|
||||||
|
|
||||||
do_V2 = mkV2 (mkV "tegema" "teha") ;
|
do_V2 = mkV2 (mkV "tegema" "teha") ;
|
||||||
|
|
||||||
now_Adv = mkAdv "nüüd" ;
|
now_Adv = mkAdv "nüüd" ;
|
||||||
already_Adv = mkAdv "juba" ;
|
already_Adv = mkAdv "juba" ;
|
||||||
@@ -232,7 +232,7 @@ lin
|
|||||||
correct_A = mkA (mkN "õige" "õige" "õiget" "õigesse" "õigete" "õigeid") ;
|
correct_A = mkA (mkN "õige" "õige" "õiget" "õigesse" "õigete" "õigeid") ;
|
||||||
dry_A = mkA (mkN "kuiv" "kuiva" "kuiva") "kuivem" "kuiveim" ;
|
dry_A = mkA (mkN "kuiv" "kuiva" "kuiva") "kuivem" "kuiveim" ;
|
||||||
dull_A = mkA "igav" ;
|
dull_A = mkA "igav" ;
|
||||||
full_A = mkA (mkN "täis" "täie" "täit" "täide" "täied" "täite") "täiem" "täiim" Invariable ; -- 'täis' is one of the non-inflecting adjectives
|
full_A = mkA (mkN "täis" "täie" "täit" "täide" "täite" "täisi") "täiem" "täiim" Invariable ; -- 'täis' is one of the non-inflecting adjectives
|
||||||
heavy_A = mkA "raske" ;
|
heavy_A = mkA "raske" ;
|
||||||
near_A = mkA "lähedane" ;
|
near_A = mkA "lähedane" ;
|
||||||
rotten_A = mkA "mäda" ;
|
rotten_A = mkA "mäda" ;
|
||||||
@@ -366,7 +366,7 @@ lin
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
mkOrd1 : N -> Ord ;
|
mkOrd1 : N -> Ord ;
|
||||||
mkOrd1 x = {s = x.s ; lock_Ord = <> } ;
|
mkOrd1 x = lin Ord x ;
|
||||||
cpartitive = casePrep partitive ;
|
cpartitive = casePrep partitive ;
|
||||||
ctranslative = casePrep translative ;
|
ctranslative = casePrep translative ;
|
||||||
celative = casePrep elative ;
|
celative = casePrep elative ;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
resource MakeStructuralEst = open CatEst, ParadigmsEst, MorphoEst, Prelude in {
|
resource MakeStructuralEst = open CatEst, ParadigmsEst, MorphoEst, Prelude in {
|
||||||
|
|
||||||
oper
|
oper
|
||||||
mkConj : Str -> Str -> ParadigmsEst.Number -> Conj = \x,y,n ->
|
mkConj : Str -> Str -> ParadigmsEst.Number -> Conj = \x,y,n -> lin Conj {
|
||||||
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
|
s1 = x ;
|
||||||
mkSubj : Str -> Subj = \x ->
|
s2 = y ;
|
||||||
{s = x ; lock_Subj = <>} ;
|
n = n
|
||||||
mkIQuant : Str -> IQuant = \s ->
|
} ;
|
||||||
{s = \\n,c => s ; lock_IQuant = <>} ; ----
|
mkSubj : Str -> Subj = \x -> lin Subj {s = x} ;
|
||||||
|
mkIQuant : Str -> IQuant = \s -> lin IQuant {s = \\n,c => s} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
flags optimize=all ; coding=utf8;
|
flags optimize=all ; coding=utf8;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
----------------------
|
----------------------
|
||||||
-- morph. paradigms --
|
-- morph. paradigms --
|
||||||
----------------------
|
----------------------
|
||||||
@@ -19,7 +19,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
--Noun paradigms in HjkEst
|
--Noun paradigms in HjkEst
|
||||||
|
|
||||||
--Comparative adjectives
|
--Comparative adjectives
|
||||||
--(could just use hjk_type_IVb_audit "suurem" "a")
|
--(could just use hjk_type_IVb_audit "suurem" "a")
|
||||||
-- Comparative adjectives inflect in the same way
|
-- Comparative adjectives inflect in the same way
|
||||||
-- TODO: confirm this
|
-- TODO: confirm this
|
||||||
dSuurempi : Str -> NForms = \suurem ->
|
dSuurempi : Str -> NForms = \suurem ->
|
||||||
@@ -47,17 +47,17 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
saama
|
saama
|
||||||
(saa + "da")
|
(saa + "da")
|
||||||
(saa + "b")
|
(saa + "b")
|
||||||
(saa + "dakse")
|
(saa + "dakse")
|
||||||
(saa + "ge") -- Imper Pl
|
(saa + "ge") -- Imper Pl
|
||||||
sai
|
sai
|
||||||
(saa + "nud")
|
(saa + "nud")
|
||||||
(saa + "dud") ;
|
(saa + "dud") ;
|
||||||
|
|
||||||
-- TS 49
|
-- TS 49
|
||||||
-- no d/t in da, takse ; imperfect 3sg ends in s
|
-- no d/t in da, takse ; imperfect 3sg ends in s
|
||||||
cKaima : (_ : Str) -> VForms = \kaima ->
|
cKaima : (_ : Str) -> VForms = \kaima ->
|
||||||
let
|
let
|
||||||
kai = Predef.tk 2 kaima ;
|
kai = Predef.tk 2 kaima ;
|
||||||
in vForms8
|
in vForms8
|
||||||
kaima
|
kaima
|
||||||
(kai + "a")
|
(kai + "a")
|
||||||
@@ -65,10 +65,10 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(kai + "akse")
|
(kai + "akse")
|
||||||
(kai + "ge")
|
(kai + "ge")
|
||||||
(kai + "s")
|
(kai + "s")
|
||||||
(kai + "nud")
|
(kai + "nud")
|
||||||
(kai + "dud") ;
|
(kai + "dud") ;
|
||||||
|
|
||||||
-- TS 49
|
-- TS 49
|
||||||
-- vowel changes in da, takse, no d/t ; imperfect 3sg ends in i
|
-- vowel changes in da, takse, no d/t ; imperfect 3sg ends in i
|
||||||
cJooma : (_ : Str) -> VForms = \jooma ->
|
cJooma : (_ : Str) -> VForms = \jooma ->
|
||||||
let
|
let
|
||||||
@@ -78,7 +78,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
u = case o of {
|
u = case o of {
|
||||||
"o" => "u" ;
|
"o" => "u" ;
|
||||||
"ö" => "ü" ;
|
"ö" => "ü" ;
|
||||||
_ => o
|
_ => o
|
||||||
} ;
|
} ;
|
||||||
q = case o of {
|
q = case o of {
|
||||||
("o"|"ö") => "õ" ;
|
("o"|"ö") => "õ" ;
|
||||||
@@ -91,9 +91,9 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
juua
|
juua
|
||||||
(joo + "b")
|
(joo + "b")
|
||||||
(juua + "kse")
|
(juua + "kse")
|
||||||
(joo + "ge")
|
(joo + "ge")
|
||||||
j6i
|
j6i
|
||||||
(joo + "nud")
|
(joo + "nud")
|
||||||
(joo + "dud") ;
|
(joo + "dud") ;
|
||||||
|
|
||||||
-- TS 50-52 (elama, muutuma, kirjutama), 53 (tegelema) alt forms
|
-- TS 50-52 (elama, muutuma, kirjutama), 53 (tegelema) alt forms
|
||||||
@@ -105,10 +105,10 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
elama
|
elama
|
||||||
(ela + "da")
|
(ela + "da")
|
||||||
(ela + "b")
|
(ela + "b")
|
||||||
(ela + "takse")
|
(ela + "takse")
|
||||||
(ela + "ge") -- Imperative P1 Pl
|
(ela + "ge") -- Imperative P1 Pl
|
||||||
(ela + "s") -- Imperfect P3 Sg
|
(ela + "s") -- Imperfect P3 Sg
|
||||||
(ela + "nud")
|
(ela + "nud")
|
||||||
(ela + "tud") ;
|
(ela + "tud") ;
|
||||||
|
|
||||||
-- TS 53 (tegelema)
|
-- TS 53 (tegelema)
|
||||||
@@ -121,12 +121,12 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
tegelema
|
tegelema
|
||||||
(tegel + "da")
|
(tegel + "da")
|
||||||
(tegele + "b")
|
(tegele + "b")
|
||||||
(tegel + "dakse")
|
(tegel + "dakse")
|
||||||
(tegel + "ge") -- Imperative P1 Pl
|
(tegel + "ge") -- Imperative P1 Pl
|
||||||
(tegele + "s") -- Imperfect P3 Sg
|
(tegele + "s") -- Imperfect P3 Sg
|
||||||
(tegel + "nud")
|
(tegel + "nud")
|
||||||
(tegel + "dud") ;
|
(tegel + "dud") ;
|
||||||
|
|
||||||
-- TS 54 (tulema)
|
-- TS 54 (tulema)
|
||||||
-- consonant assimilation (l,r,n) in da, takse
|
-- consonant assimilation (l,r,n) in da, takse
|
||||||
-- d in tud, g in ge
|
-- d in tud, g in ge
|
||||||
@@ -146,7 +146,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(tul + "i")
|
(tul + "i")
|
||||||
(tul + "nud")
|
(tul + "nud")
|
||||||
(tul + "dud") ;
|
(tul + "dud") ;
|
||||||
|
|
||||||
-- TS 55-56 (õppima, sündima)
|
-- TS 55-56 (õppima, sündima)
|
||||||
-- t in takse, tud ; consonant gradation on stem
|
-- t in takse, tud ; consonant gradation on stem
|
||||||
cLeppima : (_ : Str) -> VForms = \leppima ->
|
cLeppima : (_ : Str) -> VForms = \leppima ->
|
||||||
@@ -154,7 +154,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
leppi = Predef.tk 2 leppima ;
|
leppi = Predef.tk 2 leppima ;
|
||||||
i = last leppi ;
|
i = last leppi ;
|
||||||
lepp = init leppi ;
|
lepp = init leppi ;
|
||||||
lepi = (weaker lepp) + i
|
lepi = (weaker lepp) + i
|
||||||
in vForms8
|
in vForms8
|
||||||
leppima
|
leppima
|
||||||
(leppi + "da")
|
(leppi + "da")
|
||||||
@@ -164,7 +164,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(leppi + "s") -- Imperfect P3 Sg
|
(leppi + "s") -- Imperfect P3 Sg
|
||||||
(leppi + "nud")
|
(leppi + "nud")
|
||||||
(lepi + "tud") ;
|
(lepi + "tud") ;
|
||||||
|
|
||||||
-- TS 57 (lugema)
|
-- TS 57 (lugema)
|
||||||
-- Like 55-56 but irregular gradation patterns, that shouldn't be in HjkEst.weaker
|
-- Like 55-56 but irregular gradation patterns, that shouldn't be in HjkEst.weaker
|
||||||
--including also marssima,valssima
|
--including also marssima,valssima
|
||||||
@@ -184,7 +184,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
_ + ("uge"|"ude") => l + "oe" ;
|
_ + ("uge"|"ude") => l + "oe" ;
|
||||||
|
|
||||||
_ + #c + "ssi" => (init lug) + e;
|
_ + #c + "ssi" => (init lug) + e;
|
||||||
_ => (weaker lug) + e
|
_ => (weaker lug) + e
|
||||||
} ;
|
} ;
|
||||||
in vForms8
|
in vForms8
|
||||||
lugema
|
lugema
|
||||||
@@ -195,8 +195,8 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(luge + "s") -- Imperfect P3 Sg
|
(luge + "s") -- Imperfect P3 Sg
|
||||||
(luge + "nud")
|
(luge + "nud")
|
||||||
(loe + "tud") ;
|
(loe + "tud") ;
|
||||||
|
|
||||||
|
|
||||||
-- TS 58 muutma, saatma,
|
-- TS 58 muutma, saatma,
|
||||||
-- like laskma (TS 62, 64), but no reduplication of stem consonant (muutma~muuta, not *muutta)
|
-- like laskma (TS 62, 64), but no reduplication of stem consonant (muutma~muuta, not *muutta)
|
||||||
-- like andma (TS 63) but different takse (muudetakse vs. antakse)
|
-- like andma (TS 63) but different takse (muudetakse vs. antakse)
|
||||||
@@ -213,8 +213,8 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(muut + "is")
|
(muut + "is")
|
||||||
(muut + "nud")
|
(muut + "nud")
|
||||||
(muud + "etud") ; -- always e?
|
(muud + "etud") ; -- always e?
|
||||||
|
|
||||||
-- TS 59-60 (petma~petetakse, jätma~jäetakse)
|
-- TS 59-60 (petma~petetakse, jätma~jäetakse)
|
||||||
-- takse given as second argument
|
-- takse given as second argument
|
||||||
cPetma : (_,_ : Str) -> VForms = \petma,jaetakse ->
|
cPetma : (_,_ : Str) -> VForms = \petma,jaetakse ->
|
||||||
let
|
let
|
||||||
@@ -251,8 +251,8 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(jatt + "is")
|
(jatt + "is")
|
||||||
(jat + "nud")
|
(jat + "nud")
|
||||||
(ko + "etud") ;
|
(ko + "etud") ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
-- TS 61 (laulma)
|
-- TS 61 (laulma)
|
||||||
--vowel (a/e) given with the second argument
|
--vowel (a/e) given with the second argument
|
||||||
--veenma,naerma
|
--veenma,naerma
|
||||||
@@ -268,7 +268,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(kuul + "is")
|
(kuul + "is")
|
||||||
(kuul + "nud")
|
(kuul + "nud")
|
||||||
(kuul + "dud") ;
|
(kuul + "dud") ;
|
||||||
|
|
||||||
-- TS 62 (tõusma), 64 (mõksma)
|
-- TS 62 (tõusma), 64 (mõksma)
|
||||||
-- vowel (a/e) given with the second argument
|
-- vowel (a/e) given with the second argument
|
||||||
-- doesn't give alt. forms joosta, joostes
|
-- doesn't give alt. forms joosta, joostes
|
||||||
@@ -283,9 +283,9 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(las + "takse")
|
(las + "takse")
|
||||||
(las + "ke")
|
(las + "ke")
|
||||||
(lask + "is")
|
(lask + "is")
|
||||||
(lask + "nud")
|
(lask + "nud")
|
||||||
(las + "tud") ;
|
(las + "tud") ;
|
||||||
|
|
||||||
-- TS 62 alt forms
|
-- TS 62 alt forms
|
||||||
cJooksma : (_ : Str) -> VForms = \jooksma ->
|
cJooksma : (_ : Str) -> VForms = \jooksma ->
|
||||||
let
|
let
|
||||||
@@ -298,10 +298,10 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(joos + "takse")
|
(joos + "takse")
|
||||||
(joos + "ke")
|
(joos + "ke")
|
||||||
(jooks + "is")
|
(jooks + "is")
|
||||||
(jooks + "nud")
|
(jooks + "nud")
|
||||||
(joos + "tud") ;
|
(joos + "tud") ;
|
||||||
|
|
||||||
-- TS 63 (andma, murdma, hoidma)
|
-- TS 63 (andma, murdma, hoidma)
|
||||||
-- vowel given in second arg (andma~annab; tundma~tunneb)
|
-- vowel given in second arg (andma~annab; tundma~tunneb)
|
||||||
cAndma : (_,_ : Str) -> VForms = \andma,annab ->
|
cAndma : (_,_ : Str) -> VForms = \andma,annab ->
|
||||||
let
|
let
|
||||||
@@ -310,18 +310,18 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
ann = weaker and ; --murr, hoi
|
ann = weaker and ; --murr, hoi
|
||||||
te = case (last ann) of { --to prevent teadma~teaab
|
te = case (last ann) of { --to prevent teadma~teaab
|
||||||
"a" => init ann ;
|
"a" => init ann ;
|
||||||
_ => ann
|
_ => ann
|
||||||
} ;
|
} ;
|
||||||
in vForms8
|
in vForms8
|
||||||
andma
|
andma
|
||||||
(and + "a")
|
(and + "a")
|
||||||
annab
|
annab
|
||||||
(an + "takse")
|
(an + "takse")
|
||||||
(and + "ke")
|
(and + "ke")
|
||||||
(and + "is")
|
(and + "is")
|
||||||
(and + "nud")
|
(and + "nud")
|
||||||
(an + "tud") ;
|
(an + "tud") ;
|
||||||
|
|
||||||
-- TS 65 (pesema)
|
-- TS 65 (pesema)
|
||||||
-- a consonant stem verb in disguise
|
-- a consonant stem verb in disguise
|
||||||
cPesema : (_ : Str) -> VForms = \pesema ->
|
cPesema : (_ : Str) -> VForms = \pesema ->
|
||||||
@@ -356,9 +356,9 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(nag + "i")
|
(nag + "i")
|
||||||
(nai + "nud")
|
(nai + "nud")
|
||||||
(nah + "tud") ;
|
(nah + "tud") ;
|
||||||
|
|
||||||
|
|
||||||
-- TS 67-68 (hüppama, tõmbama)
|
-- TS 67-68 (hüppama, tõmbama)
|
||||||
-- strong stem in ma, b, s
|
-- strong stem in ma, b, s
|
||||||
-- weak stem in da, takse, ge, nud, tud
|
-- weak stem in da, takse, ge, nud, tud
|
||||||
-- t in da, takse; k in ge
|
-- t in da, takse; k in ge
|
||||||
@@ -387,7 +387,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
omb = Predef.tk 2 omble ;
|
omb = Predef.tk 2 omble ;
|
||||||
omm = case omb of {
|
omm = case omb of {
|
||||||
"mõt" => "mõe" ; --some "double weak" patterns; however weaker (weaker omb) makes the coverage worse
|
"mõt" => "mõe" ; --some "double weak" patterns; however weaker (weaker omb) makes the coverage worse
|
||||||
_ => weaker omb
|
_ => weaker omb
|
||||||
} ;
|
} ;
|
||||||
ommel = omm + e + l ;
|
ommel = omm + e + l ;
|
||||||
in vForms8
|
in vForms8
|
||||||
@@ -416,23 +416,11 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
|
|||||||
(satu + "tud") ; -- PastPartPass
|
(satu + "tud") ; -- PastPartPass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----------------
|
-----------------
|
||||||
-- auxiliaries --
|
-- auxiliaries --
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
|
||||||
{- Noun internal opers moved to ResEst
|
|
||||||
|
|
||||||
These used to be here:
|
|
||||||
NForms : Type = Predef.Ints 5 => Str ;
|
|
||||||
Noun : Type = {s: NForm => Str } ;
|
|
||||||
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms ;
|
|
||||||
n2nforms : Noun -> NForms ;
|
|
||||||
nForms2N : NForms -> Noun ;
|
|
||||||
|
|
||||||
-}
|
|
||||||
|
|
||||||
-- Adjective forms
|
-- Adjective forms
|
||||||
|
|
||||||
AForms : Type = {
|
AForms : Type = {
|
||||||
@@ -445,22 +433,21 @@ These used to be here:
|
|||||||
aForms2A : AForms -> Adjective = \afs -> {
|
aForms2A : AForms -> Adjective = \afs -> {
|
||||||
s = table {
|
s = table {
|
||||||
Posit => table {
|
Posit => table {
|
||||||
AN n => (nForms2N afs.posit).s ! n ;
|
AN n => (nForms2N afs.posit).s ! n ;
|
||||||
AAdv => afs.adv_posit
|
AAdv => afs.adv_posit
|
||||||
} ;
|
} ;
|
||||||
Compar => table {
|
Compar => table {
|
||||||
AN n => (nForms2N afs.compar).s ! n ;
|
AN n => (nForms2N afs.compar).s ! n ;
|
||||||
AAdv => afs.adv_compar
|
AAdv => afs.adv_compar
|
||||||
} ;
|
} ;
|
||||||
Superl => table {
|
Superl => table {
|
||||||
AN n => (nForms2N afs.superl).s ! n ;
|
AN n => (nForms2N afs.superl).s ! n ;
|
||||||
AAdv => afs.adv_superl
|
AAdv => afs.adv_superl
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
lock_A = <>
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
nforms2aforms : NForms -> AForms = \nforms ->
|
nforms2aforms : NForms -> AForms = \nforms ->
|
||||||
let
|
let
|
||||||
suure = init (nforms ! 1) ;
|
suure = init (nforms ! 1) ;
|
||||||
suur = Predef.tk 4 (nforms ! 8) ;
|
suur = Predef.tk 4 (nforms ! 8) ;
|
||||||
@@ -473,21 +460,12 @@ These used to be here:
|
|||||||
adv_superl = suur + "immin" ;
|
adv_superl = suur + "immin" ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{- Verb internal opers moved to ResEst
|
|
||||||
|
|
||||||
These used to be here:
|
|
||||||
VForms : Type = Predef.Ints 7 => Str ;
|
|
||||||
vForms8 : (x1,_,_,_,_,_,_,x8 : Str) -> VForms ;
|
|
||||||
regVForms : (x1,_,_,x4 : Str) -> VForms ;
|
|
||||||
vforms2V : VForms -> Verb ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
-- for Structural
|
-- for Structural
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
caseTable : Number -> Noun -> 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 -> Noun -> {
|
mkDet : Number -> Noun -> {
|
||||||
@@ -505,35 +483,30 @@ caseTable : Number -> Noun -> Case => Str = \n,cn ->
|
|||||||
-- Here we define personal and relative pronouns.
|
-- Here we define personal and relative pronouns.
|
||||||
|
|
||||||
-- input forms: Nom, Gen, Part
|
-- input forms: Nom, Gen, Part
|
||||||
-- Note that the Fin version required 5 input forms, the
|
-- NPAcc is same as Part for Pron, and same as Gen for other nominals.
|
||||||
-- Est pronouns thus seem to be much simpler.
|
-- ResEst.appCompl returns right case for various types of complements,
|
||||||
-- TODO: remove NPAcc?
|
-- incl. when pronouns get different treatment than nouns (like in PassV2).
|
||||||
-- I: keep NPAcc; see appCompl in ResEst, it takes care of finding a right case for various types of complements; incl. when pronouns get different treatment than nouns (PassVP).
|
|
||||||
mkPronoun : (_,_,_ : Str) -> Number -> Person ->
|
mkPronoun : (_,_,_ : Str) -> Number -> Person ->
|
||||||
{s : NPForm => Str ; a : Agr} =
|
{s : NPForm => Str ; a : Agr} =
|
||||||
\mina, minu, mind, n, p ->
|
\mina, minu, mind, n, p ->
|
||||||
let {
|
let {
|
||||||
minu_short = ie_to_i minu
|
minu_short = ie_to_i minu
|
||||||
} in
|
} in
|
||||||
{s = table {
|
{s = table {
|
||||||
NPCase Nom => mina ;
|
NPCase Nom => mina ;
|
||||||
NPCase Gen => minu ;
|
NPCase Gen => minu ;
|
||||||
NPCase Part => mind ;
|
NPCase Part => mind ;
|
||||||
NPCase Transl => minu + "ks" ;
|
NPCase Transl => minu + "ks" ;
|
||||||
NPCase Ess => minu + "na" ;
|
|
||||||
NPCase Iness => minu_short + "s" ;
|
NPCase Iness => minu_short + "s" ;
|
||||||
NPCase Elat => minu_short + "st" ;
|
NPCase Elat => minu_short + "st" ;
|
||||||
NPCase Illat => minu_short + "sse" ;
|
NPCase Illat => minu_short + "sse" ;
|
||||||
NPCase Adess => minu_short + "l" ;
|
NPCase Adess => minu_short + "l" ;
|
||||||
NPCase Ablat => minu_short + "lt" ;
|
NPCase Ablat => minu_short + "lt" ;
|
||||||
NPCase Allat => minu_short + "le" ;
|
NPCase Allat => minu_short + "le" ;
|
||||||
NPCase Abess => minu + "ta" ;
|
|
||||||
NPCase Comit => minu + "ga" ;
|
|
||||||
NPCase Termin => minu + "ni" ;
|
|
||||||
NPAcc => mind
|
NPAcc => mind
|
||||||
} ;
|
} ;
|
||||||
a = Ag n p
|
a = Ag n p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- meiesse/teiesse -> meisse/teisse
|
-- meiesse/teiesse -> meisse/teisse
|
||||||
ie_to_i : Str -> Str ;
|
ie_to_i : Str -> Str ;
|
||||||
@@ -543,77 +516,67 @@ caseTable : Number -> Noun -> Case => Str = \n,cn ->
|
|||||||
_ => x
|
_ => x
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
shortPronoun : (_,_,_,_ : Str) -> Number -> Person ->
|
-- NB. This doesn't work correctly with stem+suffix based solution:
|
||||||
{s : NPForm => Str ; a : Agr} =
|
-- Ess, Abess, Comit, Termin all use the long Gen stem.
|
||||||
|
-- Alternative 1: let Gen be long form, leaving only Nom and Part actually short
|
||||||
|
-- Alternative 2: leave Gen short, postprocess Ess, Abess, Comit, Termin in application
|
||||||
|
-- Alternative 3: include two Gen stems in NPForm
|
||||||
|
shortPronoun : (_,_,_,_ : Str) -> Number -> Person ->
|
||||||
|
{s : NPForm => Str ; a : Agr} =
|
||||||
\ma, mu, mind, minu, n, p ->
|
\ma, mu, mind, minu, n, p ->
|
||||||
let shortMa = mkPronoun ma mu mind n p ;
|
let shortMa = mkPronoun ma mu mind n p ;
|
||||||
mulle : Str = case mu of {
|
mulle : Str = case mu of {
|
||||||
"mu" => "mulle" ;
|
"mu" => "mulle" ;
|
||||||
"su" => "sulle" ;
|
"su" => "sulle" ;
|
||||||
_ => shortMa.s ! NPCase Allat
|
_ => shortMa.s ! NPCase Allat
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
in shortMa ** { s = table {
|
in shortMa ** { s = table {
|
||||||
|
NPCase Gen => minu ; -- this is Alternative 1, see comment above. Comment out for Alternative 2.
|
||||||
NPCase Allat => mulle ;
|
NPCase Allat => mulle ;
|
||||||
NPCase Transl => minu + "ks" ;
|
NPCase Transl => minu + "ks" ;
|
||||||
NPCase Ess => minu + "na" ;
|
|
||||||
NPCase Abess => minu + "ta" ;
|
|
||||||
NPCase Comit => minu + "ga" ;
|
|
||||||
NPCase Termin => minu + "ni" ;
|
|
||||||
x => shortMa.s ! x } } ;
|
x => shortMa.s ! x } } ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
relPron : NForm => Str =
|
relPron : NForm => Str =
|
||||||
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida")
|
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida")
|
||||||
in fixPlNom "mis" mis.s ;
|
in fixPlNom "mis" mis.s ;
|
||||||
|
|
||||||
kesPron : NForm => Str =
|
kesPron : NForm => Str =
|
||||||
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda")
|
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda")
|
||||||
in fixPlNom "kes" kes.s ;
|
in fixPlNom "kes" kes.s ;
|
||||||
|
|
||||||
ProperName = {s : Case => Str} ;
|
ProperName = {s : Case => Str} ;
|
||||||
|
|
||||||
-- TODO: generate using mkPronoun
|
|
||||||
pronSe : ProperName = {
|
pronSe : ProperName = {
|
||||||
s = table {
|
s = table {
|
||||||
Nom => "see" ;
|
Nom => "see" ;
|
||||||
Gen => "selle" ;
|
Gen => "selle" ;
|
||||||
Part => "seda" ;
|
Part => "seda" ;
|
||||||
Transl => "selleks" ;
|
Transl => "selleks" ;
|
||||||
Ess => "sellena" ;
|
|
||||||
Iness => "selles" ;
|
Iness => "selles" ;
|
||||||
Elat => "sellest" ;
|
Elat => "sellest" ;
|
||||||
Illat => "sellesse" ;
|
Illat => "sellesse" ;
|
||||||
Adess => "sellel" ;
|
Adess => "sellel" ;
|
||||||
Ablat => "sellelt" ;
|
Ablat => "sellelt" ;
|
||||||
Allat => "sellele" ;
|
Allat => "sellele"
|
||||||
Abess => "selleta" ;
|
|
||||||
Comit => "sellega" ;
|
|
||||||
Termin => "selleni"
|
|
||||||
} ;
|
} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- TODO: generate using mkPronoun
|
|
||||||
pronNe : ProperName = {
|
pronNe : ProperName = {
|
||||||
s = table {
|
s = table {
|
||||||
Nom => "need" ;
|
Nom => "need" ;
|
||||||
Gen => "nende" ;
|
Gen => "nende" ;
|
||||||
Part => "neid" ;
|
Part => "neid" ;
|
||||||
Transl => "nendeks" ;
|
Transl => "nendeks" ;
|
||||||
Ess => "nendena" ;
|
|
||||||
Iness => "nendes" ;
|
Iness => "nendes" ;
|
||||||
Elat => "nendest" ;
|
Elat => "nendest" ;
|
||||||
Illat => "nendesse" ;
|
Illat => "nendesse" ;
|
||||||
Adess => "nendel" ;
|
Adess => "nendel" ;
|
||||||
Ablat => "nendelt" ;
|
Ablat => "nendelt" ;
|
||||||
Allat => "nendele" ;
|
Allat => "nendele"
|
||||||
Abess => "nendeta" ;
|
|
||||||
Comit => "nendega" ;
|
|
||||||
Termin => "nendeni"
|
|
||||||
} ;
|
} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -7,30 +7,23 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
|||||||
-- The $Number$ is subtle: "nuo autot", "nuo kolme autoa" are both plural
|
-- The $Number$ is subtle: "nuo autot", "nuo kolme autoa" are both plural
|
||||||
-- for verb agreement, but the noun form is singular in the latter.
|
-- for verb agreement, but the noun form is singular in the latter.
|
||||||
|
|
||||||
DetCN det cn =
|
DetCN det cn =
|
||||||
let
|
let
|
||||||
n : Number = case det.isNum of {
|
n : Number = case det.isNum of {
|
||||||
True => Sg ;
|
True => Sg ;
|
||||||
_ => det.n
|
_ => det.n
|
||||||
} ;
|
} ;
|
||||||
ncase : NPForm -> Case * NForm = \c ->
|
ncase : NPForm -> Case * NForm = \c ->
|
||||||
let k = npform2case n c
|
let k = npform2case n c
|
||||||
in
|
in
|
||||||
case <n, c, det.isNum, det.isDef> of {
|
case <n, c, det.isNum, det.isDef> of {
|
||||||
<_, NPAcc, True,_> => <Nom,NCase Sg Part> ; -- kolm kassi (as object)
|
<_, NPAcc, True,_> => <Nom,NCase Sg Part> ; -- kolm kassi (as object)
|
||||||
<_, NPCase Nom, True,_> => <Nom,NCase Sg Part> ; -- kolm kassi (as subject)
|
<_, NPCase Nom, True,_> => <Nom,NCase Sg Part> ; -- kolm kassi (as subject)
|
||||||
|
|
||||||
--Only the last word gets case ending.
|
|
||||||
<_, NPCase Comit, _, _> => <Gen,NCase n Comit> ; -- kolme kassiga
|
|
||||||
<_, NPCase Abess, _, _> => <Gen,NCase n Abess> ; -- kolme kassita
|
|
||||||
<_, NPCase Ess, _, _> => <Gen,NCase n Ess> ; -- kolme kassina
|
|
||||||
<_, NPCase Termin,_, _> => <Gen,NCase n Termin> ; -- kolme kassini
|
|
||||||
|
|
||||||
<_, _, True,_> => <k, NCase Sg k> ; -- kolmeks kassiks (all other cases)
|
<_, _, True,_> => <k, NCase Sg k> ; -- kolmeks kassiks (all other cases)
|
||||||
_ => <k, NCase n k> -- kass, kassi, ... (det is not a number)
|
_ => <k, NCase n k> -- kass, kassi, ... (det is not a number)
|
||||||
}
|
}
|
||||||
in {
|
in cn ** {
|
||||||
s = \\c => let
|
s = \\c => let
|
||||||
k = ncase c ;
|
k = ncase c ;
|
||||||
in
|
in
|
||||||
det.s ! k.p1 ++ cn.s ! k.p2 ;
|
det.s ! k.p1 ++ cn.s ! k.p2 ;
|
||||||
@@ -42,15 +35,15 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
|||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetNP det =
|
DetNP det =
|
||||||
let
|
let
|
||||||
n : Number = case det.isNum of {
|
n : Number = case det.isNum of {
|
||||||
True => Sg ;
|
True => Sg ;
|
||||||
_ => det.n
|
_ => det.n
|
||||||
} ;
|
} ;
|
||||||
in {
|
in emptyNP ** {
|
||||||
s = \\c => let k = npform2case n c in
|
s = \\c => let k = npform2case n c in
|
||||||
det.sp ! k ;
|
det.sp ! k ;
|
||||||
a = agrP3 (case det.isDef of {
|
a = agrP3 (case det.isDef of {
|
||||||
False => Sg ; -- autoja menee; kolme autoa menee
|
False => Sg ; -- autoja menee; kolme autoa menee
|
||||||
_ => det.n
|
_ => det.n
|
||||||
@@ -58,41 +51,28 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
|||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UsePN pn = {
|
UsePN pn = emptyNP ** {
|
||||||
s = \\c => pn.s ! npform2case Sg c ;
|
s = \\c => pn.s ! npform2case Sg c ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
UsePron p = p ** {isPron = True} ;
|
UsePron p = p ** {isPron = True ; postmod = []} ;
|
||||||
|
|
||||||
PredetNP pred np = {
|
PredetNP pred np = np ** {
|
||||||
s = \\c => pred.s ! complNumAgr np.a ! c ++ np.s ! c ;
|
s = \\c => pred.s ! complNumAgr np.a ! c ++ np.s ! c ;
|
||||||
a = np.a ;
|
|
||||||
isPron = np.isPron -- kaikki minun - ni
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PPartNP np v2 =
|
PPartNP np v2 =
|
||||||
let
|
let
|
||||||
num : Number = complNumAgr np.a ;
|
num : Number = complNumAgr np.a ;
|
||||||
part : Str = v2.s ! (PastPart Pass) ;
|
part : Str = v2.s ! (PastPart Pass) ;
|
||||||
adj : NForms = hjk_type_IVb_maakas part ;
|
in np ** {postmod = np.postmod ++ part} ;
|
||||||
partGen : Str = adj ! 1 ;
|
|
||||||
partEss : Str = partGen + "na"
|
|
||||||
in {
|
|
||||||
s = \\c => np.s ! c ++ part ; --partEss ;
|
|
||||||
a = np.a ;
|
|
||||||
isPron = np.isPron -- minun täällä - ni
|
|
||||||
} ;
|
|
||||||
|
|
||||||
AdvNP np adv = {
|
AdvNP np adv = np ** {postmod = np.postmod ++ adv.s} ;
|
||||||
s = \\c => np.s ! c ++ adv.s ;
|
|
||||||
a = np.a ;
|
|
||||||
isPron = np.isPron -- minun täällä - ni
|
|
||||||
} ;
|
|
||||||
|
|
||||||
DetQuantOrd quant num ord = {
|
DetQuantOrd quant num ord = {
|
||||||
s = \\c => quant.s ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
|
s = \\c => quant.s ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
|
||||||
sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
|
sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
|
||||||
n = num.n ;
|
n = num.n ;
|
||||||
isNum = num.isNum ;
|
isNum = num.isNum ;
|
||||||
isDef = quant.isDef
|
isDef = quant.isDef
|
||||||
@@ -106,13 +86,28 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
|||||||
isDef = quant.isDef
|
isDef = quant.isDef
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
DetDAP det = det ;
|
||||||
|
|
||||||
|
AdjDAP dap ap = dap ** {
|
||||||
|
s = \\c => dap.s ! c ++
|
||||||
|
case ap.infl of {
|
||||||
|
Regular => ap.s ! True ! NCase dap.n c ;
|
||||||
|
_ => ap.s ! True ! NCase dap.n Nom ---- participle
|
||||||
|
} ;
|
||||||
|
sp = \\c => dap.sp ! c ++
|
||||||
|
case ap.infl of {
|
||||||
|
Regular => ap.s ! True ! NCase dap.n c ;
|
||||||
|
_ => ap.s ! True ! NCase dap.n Nom ---- participle
|
||||||
|
} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = {
|
||||||
s,sp = \\_,_ => p.s ! NPCase Gen ;
|
s,sp = \\_,_ => p.s ! NPCase Gen ;
|
||||||
isNum = False ;
|
isNum = False ;
|
||||||
isDef = True --- "minun kolme autoani ovat" ; thus "...on" is missing
|
isDef = True --- "minun kolme autoani ovat" ; thus "...on" is missing
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossNP cn np = {s = \\nf => np.s ! NPCase Gen ++ cn.s ! nf };
|
PossNP cn np = np ** {s = \\nf => linNP (NPCase Gen) np ++ cn.s ! nf} ;
|
||||||
|
|
||||||
NumSg = {s = \\_,_ => [] ; isNum = False ; n = Sg} ;
|
NumSg = {s = \\_,_ => [] ; isNum = False ; n = Sg} ;
|
||||||
NumPl = {s = \\_,_ => [] ; isNum = False ; n = Pl} ;
|
NumPl = {s = \\_,_ => [] ; isNum = False ; n = Pl} ;
|
||||||
@@ -120,19 +115,19 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
|||||||
NumCard n = n ** {isNum = case n.n of {Sg => False ; _ => True}} ; -- üks raamat/kaks raamatut
|
NumCard n = n ** {isNum = case n.n of {Sg => False ; _ => True}} ; -- üks raamat/kaks raamatut
|
||||||
|
|
||||||
NumDigits numeral = {
|
NumDigits numeral = {
|
||||||
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
||||||
n = numeral.n
|
n = numeral.n
|
||||||
} ;
|
} ;
|
||||||
OrdDigits numeral = {s = \\nc => numeral.s ! NOrd nc} ;
|
OrdDigits numeral = {s = \\nc => numeral.s ! NOrd nc} ;
|
||||||
|
|
||||||
NumNumeral numeral = {
|
NumNumeral numeral = {
|
||||||
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
||||||
n = numeral.n
|
n = numeral.n
|
||||||
} ;
|
} ;
|
||||||
OrdNumeral numeral = {s = \\nc => numeral.s ! NOrd nc} ;
|
OrdNumeral numeral = {s = \\nc => numeral.s ! NOrd nc} ;
|
||||||
|
|
||||||
AdNum adn num = {
|
AdNum adn num = {
|
||||||
s = \\n,c => adn.s ++ num.s ! n ! c ;
|
s = \\n,c => adn.s ++ num.s ! n ! c ;
|
||||||
n = num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -141,17 +136,17 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
|||||||
OrdSuperl a = {s = \\nc => "kõige" ++ a.s ! Compar ! AN nc} ;
|
OrdSuperl a = {s = \\nc => "kõige" ++ a.s ! Compar ! AN nc} ;
|
||||||
|
|
||||||
DefArt = {
|
DefArt = {
|
||||||
s = \\_,_ => [] ;
|
s = \\_,_ => [] ;
|
||||||
sp = table {Sg => pronSe.s ; Pl => pronNe.s} ;
|
sp = table {Sg => pronSe.s ; Pl => pronNe.s} ;
|
||||||
isNum = False ;
|
isNum = False ;
|
||||||
isDef = True -- autot ovat
|
isDef = True -- autot ovat
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IndefArt = {
|
IndefArt = {
|
||||||
s = \\_,_ => [] ; --use isDef in DetCN
|
s = \\_,_ => [] ; --use isDef in DetCN
|
||||||
sp = \\n,c =>
|
sp = \\n,c =>
|
||||||
(nForms2N (nForms6 "üks" "ühe" "üht" "ühesse" "ühtede"
|
(nForms2N (nForms6 "üks" "ühe" "üht" "ühesse" "ühtede"
|
||||||
"ühtesid")).s ! NCase n c ;
|
"ühtesid")).s ! NCase n c ;
|
||||||
isNum,isDef = False -- autoja on
|
isNum,isDef = False -- autoja on
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -159,69 +154,69 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
|||||||
let
|
let
|
||||||
n : Number = Sg ;
|
n : Number = Sg ;
|
||||||
ncase : Case -> NForm = \c -> NCase n c ;
|
ncase : Case -> NForm = \c -> NCase n c ;
|
||||||
in {
|
in cn ** {
|
||||||
s = \\c => let k = npform2case n c in
|
s = \\c => let k = npform2case n c in
|
||||||
cn.s ! ncase k ;
|
cn.s ! ncase k ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseN n = n ;
|
UseN n = emptyCN ** {
|
||||||
|
s = n.s
|
||||||
|
} ;
|
||||||
|
|
||||||
UseN2 n = n ;
|
UseN2 n = n ;
|
||||||
|
|
||||||
Use2N3 f = lin N2 {
|
Use2N3 f = f ** {
|
||||||
s = f.s ;
|
postmod = []
|
||||||
c2 = f.c2 ;
|
|
||||||
isPre = f.isPre
|
|
||||||
} ;
|
} ;
|
||||||
Use3N3 f = lin N2 {
|
Use3N3 f = f ** {
|
||||||
s = f.s ;
|
c2 = f.c3 ;
|
||||||
|
isPre = f.isPre2 ;
|
||||||
|
postmod = []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComplN2 f x = let compl : Str = appCompl True Pos f.c2 x in {
|
||||||
|
s = \\nf => case f.isPre of {
|
||||||
|
True => f.s ! nf ; -- N2 is pre, so compl goes into postmod
|
||||||
|
False => compl ++ f.s ! nf -- N2 isn't pre, compl goes in s before the N2
|
||||||
|
} ;
|
||||||
|
postmod = f.postmod ++ if_then_Str f.isPre compl []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- N2 is subtype of CN, so we can reuse result of ComplN2 as a base for our CN.
|
||||||
|
-- The decision of noun-complement order is only done once, in ComplN2.
|
||||||
|
ComplN3 f x = let cn : CN = ComplN2 (Use2N3 f) x in cn ** {
|
||||||
c2 = f.c3 ;
|
c2 = f.c3 ;
|
||||||
isPre = f.isPre2
|
isPre = f.isPre2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN2 f x = {
|
AdjCN ap cn = cn ** {
|
||||||
s = \\nf => preOrPost f.isPre (f.s ! nf) (appCompl True Pos f.c2 x)
|
s = \\nf =>
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
ComplN3 f x = lin N2 {
|
|
||||||
s = \\nf => preOrPost f.isPre (f.s ! nf) (appCompl True Pos f.c2 x) ;
|
|
||||||
c2 = f.c3 ;
|
|
||||||
isPre = f.isPre2
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
AdjCN ap cn = {
|
|
||||||
s = \\nf =>
|
|
||||||
case ap.infl of {
|
case ap.infl of {
|
||||||
(Invariable|Participle) => ap.s ! True ! (NCase Sg Nom) ++ cn.s ! nf ; --valmis kassile; väsinud kassile
|
Invariable|Participle => ap.s ! True ! NCase Sg Nom ++ cn.s ! nf ; --valmis kassile; väsinud kassile
|
||||||
Regular => case nf of {
|
Regular => ap.s ! True ! nf ++ cn.s ! nf -- Ess,Abess,Comit,Termin will only get case ending after the CN, so suure kassiga, not *suurega kassiga
|
||||||
NCase num (Ess|Abess|Comit|Termin) => ap.s ! True ! (NCase num Gen) ++ cn.s ! nf ; --suure kassiga, not *suurega kassiga
|
}
|
||||||
_ => ap.s ! True ! nf ++ cn.s ! nf
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelCN cn rs = {s = \\nf => cn.s ! nf ++ rs.s ! agrP3 (numN nf)} ;
|
RelCN cn rs = cn ** { -- exception to postmod rule, because RS depends on Agr
|
||||||
|
s = \\nf => cn.s ! nf ++ rs.s ! agrP3 (numN nf)
|
||||||
|
} ;
|
||||||
|
|
||||||
RelNP np rs = {
|
RelNP np rs = np ** {
|
||||||
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
|
postmod = np.postmod ++ "," ++ rs.s ! np.a ;
|
||||||
a = np.a ;
|
|
||||||
isPron = np.isPron ---- correct ?
|
isPron = np.isPron ---- correct ?
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvCN cn ad = {s = \\nf => cn.s ! nf ++ ad.s} ;
|
AdvCN cn ad = cn ** {postmod = cn.postmod ++ ad.s} ;
|
||||||
|
|
||||||
SentCN cn sc = {s = \\nf=> cn.s ! nf ++ sc.s} ;
|
SentCN cn sc = cn ** {postmod = cn.postmod ++ sc.s} ;
|
||||||
|
|
||||||
ApposCN cn np = {s = \\nf=> cn.s ! nf ++ np.s ! NPCase Nom} ; --- luvun x
|
ApposCN cn np = cn ** {postmod = cn.postmod ++ linNP (NPCase Nom) np} ; --- luvun x
|
||||||
|
|
||||||
oper
|
oper
|
||||||
numN : NForm -> Number = \nf -> case nf of {
|
numN : NForm -> Number = \nf -> case nf of {
|
||||||
NCase n _ => n ;
|
NCase n _ => n
|
||||||
_ => Sg ---
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
nBIND : Number -> Str = \n -> case n of {Sg => [] ; _ => BIND} ; -- no BIND after silent 1
|
nBIND : MorphoEst.Number -> Str = \n -> case n of {Sg => [] ; _ => BIND} ; -- no BIND after silent 1
|
||||||
|
|
||||||
param
|
param
|
||||||
NumPlace = NumIndep | NumAttr ;
|
NumPlace = NumIndep | NumAttr ;
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
--
|
--
|
||||||
-- Based on the Finnish Lexical Paradigms by Aarne Ranta 2003--2008
|
-- Based on the Finnish Lexical Paradigms by Aarne Ranta 2003--2008
|
||||||
--
|
--
|
||||||
-- This is an API to the user of the resource grammar
|
-- This is an API to the user of the resource grammar
|
||||||
-- for adding lexical items. It gives functions for forming
|
-- for adding lexical items. It gives functions for forming
|
||||||
-- expressions of open categories: nouns, adjectives, verbs.
|
-- expressions of open categories: nouns, adjectives, verbs.
|
||||||
--
|
--
|
||||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||||
-- accessed through the resource syntax API and $Structural.gf$.
|
-- accessed through the resource syntax API and $Structural.gf$.
|
||||||
--
|
--
|
||||||
-- The main difference with $MorphoEst.gf$ is that the types
|
-- The main difference with $MorphoEst.gf$ is that the types
|
||||||
-- referred to are compiled resource grammar types. We have moreover
|
-- referred to are compiled resource grammar types. We have moreover
|
||||||
@@ -23,19 +23,20 @@
|
|||||||
-- @author Kaarel Kaljurand
|
-- @author Kaarel Kaljurand
|
||||||
-- @version 2013-10-21
|
-- @version 2013-10-21
|
||||||
|
|
||||||
resource ParadigmsEst = open
|
resource ParadigmsEst = open
|
||||||
(Predef=Predef),
|
(Predef=Predef),
|
||||||
Prelude,
|
Prelude,
|
||||||
MorphoEst,
|
MorphoEst,
|
||||||
|
(ResEst=ResEst),
|
||||||
HjkEst,
|
HjkEst,
|
||||||
CatEst
|
CatEst
|
||||||
in {
|
in {
|
||||||
|
|
||||||
flags optimize=noexpand ; coding=utf8;
|
flags optimize=noexpand ; coding=utf8;
|
||||||
|
|
||||||
--2 Parameters
|
--2 Parameters
|
||||||
--
|
--
|
||||||
-- To abstract over gender, number, and (some) case names,
|
-- To abstract over gender, number, and (some) case names,
|
||||||
-- we define the following identifiers. The application programmer
|
-- we define the following identifiers. The application programmer
|
||||||
-- should always use these constants instead of the constructors
|
-- should always use these constants instead of the constructors
|
||||||
-- defined in $ResEst$.
|
-- defined in $ResEst$.
|
||||||
@@ -62,6 +63,8 @@ oper
|
|||||||
abessive : Case ; -- e.g. "karbita"
|
abessive : Case ; -- e.g. "karbita"
|
||||||
comitative : Case ; -- e.g. "karbiga"
|
comitative : Case ; -- e.g. "karbiga"
|
||||||
|
|
||||||
|
InfForm : Type ;
|
||||||
|
|
||||||
infDa : InfForm ; -- e.g. "lugeda"
|
infDa : InfForm ; -- e.g. "lugeda"
|
||||||
infDes : InfForm ; -- e.g. "lugedes"
|
infDes : InfForm ; -- e.g. "lugedes"
|
||||||
infMa : InfForm ; -- e.g. "lugema"
|
infMa : InfForm ; -- e.g. "lugema"
|
||||||
@@ -69,6 +72,7 @@ oper
|
|||||||
infMaks : InfForm ; -- e.g. "lugemaks"
|
infMaks : InfForm ; -- e.g. "lugemaks"
|
||||||
infMast : InfForm ; -- e.g. "lugemast"
|
infMast : InfForm ; -- e.g. "lugemast"
|
||||||
infMata : InfForm ; -- e.g. "lugemata"
|
infMata : InfForm ; -- e.g. "lugemata"
|
||||||
|
infMine : InfForm ; -- e.g. "lugemine"
|
||||||
|
|
||||||
-- The following type is used for defining *rection*, i.e. complements
|
-- The following type is used for defining *rection*, i.e. complements
|
||||||
-- of many-place verbs and adjective. A complement can be defined by
|
-- of many-place verbs and adjective. A complement can be defined by
|
||||||
@@ -79,19 +83,25 @@ oper
|
|||||||
postGenPrep : Str -> Prep ; -- genitive postposition, e.g. "taga"
|
postGenPrep : Str -> Prep ; -- genitive postposition, e.g. "taga"
|
||||||
casePrep : Case -> Prep ; -- just case, e.g. adessive
|
casePrep : Case -> Prep ; -- just case, e.g. adessive
|
||||||
|
|
||||||
|
mkPrep : overload {
|
||||||
|
mkPrep : Str -> Prep ; -- API-friendly version of postGenPrep—many applications assume there is a `mkX : Str -> X' available for any X
|
||||||
|
mkPrep : Case -> Prep ; -- API-friendly version of casePrep
|
||||||
|
mkPrep : Case -> Str -> Prep ; -- API-friendly version of postPrep
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Conjunctions, adverbs
|
--2 Conjunctions, adverbs
|
||||||
|
|
||||||
|
|
||||||
mkAdv : Str -> Adv ;
|
mkAdv : Str -> Adv ;
|
||||||
mkAdV : Str -> AdV ;
|
mkAdV : Str -> AdV ;
|
||||||
mkAdN : Str -> AdN ;
|
mkAdN : Str -> AdN ;
|
||||||
mkAdA : Str -> AdA ;
|
mkAdA : Str -> AdA ;
|
||||||
|
|
||||||
mkConj : overload {
|
mkConj : overload {
|
||||||
mkConj : Str -> Conj ; -- just one word, default number Sg: e.g. "ja"
|
mkConj : Str -> Conj ; -- just one word, default number Sg: e.g. "ja"
|
||||||
mkConj : Str -> Number -> Conj ; --just one word + number: e.g. "ja" Pl
|
mkConj : Str -> Number -> Conj ; --just one word + number: e.g. "ja" Pl
|
||||||
mkConj : Str -> Str -> Conj ; --two words, default number: e.g. "nii" "kui"
|
mkConj : Str -> Str -> Conj ; --two words, default number: e.g. "nii" "kui"
|
||||||
mkConj : Str -> Str -> Number -> Conj ; --two words + number: e.g. "nii" "kui" Pl
|
mkConj : Str -> Str -> Number -> Conj ; --two words + number: e.g. "nii" "kui" Pl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -139,7 +149,7 @@ oper
|
|||||||
|
|
||||||
-- Non-comparison one-place adjectives are just like nouns.
|
-- Non-comparison one-place adjectives are just like nouns.
|
||||||
-- The regular adjectives are based on $regN$ in the positive.
|
-- The regular adjectives are based on $regN$ in the positive.
|
||||||
-- Comparison adjectives have three forms.
|
-- Comparison adjectives have three forms.
|
||||||
-- The comparative and the superlative
|
-- The comparative and the superlative
|
||||||
-- are always inflected in the same way, so the nominative of them is actually
|
-- are always inflected in the same way, so the nominative of them is actually
|
||||||
-- enough (TODO: confirm).
|
-- enough (TODO: confirm).
|
||||||
@@ -154,9 +164,9 @@ oper
|
|||||||
-- Two-place adjectives need a case for the second argument.
|
-- Two-place adjectives need a case for the second argument.
|
||||||
|
|
||||||
mkA2 : A -> Prep -> A2 -- e.g. "vihane" (postGenPrep "peale")
|
mkA2 : A -> Prep -> A2 -- e.g. "vihane" (postGenPrep "peale")
|
||||||
= \a,p -> a ** {c2 = p ; lock_A2 = <>};
|
= \a,p -> lin A2 (a ** {c2 = p}) ;
|
||||||
|
|
||||||
invA : Str -> A ; -- invariable adjectives, such as genitive attributes ; no agreement to head, no comparison forms.
|
invA : Str -> A ; -- invariable adjectives, such as genitive attributes ; no agreement to head, no comparison forms.
|
||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
--
|
--
|
||||||
@@ -237,8 +247,8 @@ oper
|
|||||||
mkV2V : V -> Prep -> V2V ; -- e.g. "käskima" adessive
|
mkV2V : V -> Prep -> V2V ; -- e.g. "käskima" adessive
|
||||||
mkV2V : Str -> V2V ; -- e.g. "käskima" adessive
|
mkV2V : Str -> V2V ; -- e.g. "käskima" adessive
|
||||||
} ;
|
} ;
|
||||||
mkV2Vf : V -> Prep -> InfForm -> V2V ; -- e.g. "keelama" partitive infMast
|
mkV2Vf : V -> Prep -> InfForm -> V2V ; -- e.g. "keelama" partitive infMast
|
||||||
|
|
||||||
mkVA : overload {
|
mkVA : overload {
|
||||||
mkVA : V -> Prep -> VA ; -- e.g. "muutuma" translative
|
mkVA : V -> Prep -> VA ; -- e.g. "muutuma" translative
|
||||||
mkVA : Str -> VA ; -- string, default case translative
|
mkVA : Str -> VA ; -- string, default case translative
|
||||||
@@ -248,21 +258,21 @@ oper
|
|||||||
mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. "värvima" genitive translative
|
mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. "värvima" genitive translative
|
||||||
mkV2A : Str -> V2A ; -- string, default cases genitive and translative
|
mkV2A : Str -> V2A ; -- string, default cases genitive and translative
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkVQ : overload {
|
mkVQ : overload {
|
||||||
mkVQ : V -> VQ ;
|
mkVQ : V -> VQ ;
|
||||||
mkVQ : Str -> VQ ;
|
mkVQ : Str -> VQ ;
|
||||||
} ;
|
} ;
|
||||||
mkV2Q : V -> Prep -> V2Q ; -- e.g. "küsima" ablative
|
mkV2Q : V -> Prep -> V2Q ; -- e.g. "küsima" ablative
|
||||||
|
|
||||||
mkAS : A -> AS ; --%
|
mkAS : A -> AS ; --%
|
||||||
mkA2S : A -> Prep -> A2S ; --%
|
mkA2S : A -> Prep -> A2S ; --%
|
||||||
mkAV : A -> AV ; --%
|
mkAV : A -> AV ; --%
|
||||||
mkA2V : A -> Prep -> A2V ; --%
|
mkA2V : A -> Prep -> A2V ; --%
|
||||||
|
|
||||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
||||||
-- and the second argument is given
|
-- and the second argument is given
|
||||||
-- as an adverb. Likewise
|
-- as an adverb. Likewise
|
||||||
-- $V0$ is just $V$.
|
-- $V0$ is just $V$.
|
||||||
|
|
||||||
V0 : Type ; --%
|
V0 : Type ; --%
|
||||||
@@ -272,48 +282,73 @@ oper
|
|||||||
-- The definitions should not bother the user of the API. So they are
|
-- The definitions should not bother the user of the API. So they are
|
||||||
-- hidden from the document.
|
-- hidden from the document.
|
||||||
|
|
||||||
Case = MorphoEst.Case ;
|
Case = MorphoEst.CasePlus ;
|
||||||
Number = MorphoEst.Number ;
|
Number = MorphoEst.Number ;
|
||||||
|
|
||||||
singular = Sg ;
|
singular = Sg ;
|
||||||
plural = Pl ;
|
plural = Pl ;
|
||||||
|
|
||||||
nominative = Nom ;
|
nominative = Nominative ;
|
||||||
genitive = Gen ;
|
genitive = Genitive ;
|
||||||
partitive = Part ;
|
partitive = Partitive ;
|
||||||
illative = Illat ;
|
illative = Illative ;
|
||||||
inessive = Iness ;
|
inessive = Inessive ;
|
||||||
elative = Elat ;
|
elative = Elative ;
|
||||||
allative = Allat ;
|
allative = Allative ;
|
||||||
adessive = Adess ;
|
adessive = Adessive ;
|
||||||
ablative = Ablat ;
|
ablative = Ablative ;
|
||||||
translative = Transl ;
|
translative = Translative ;
|
||||||
terminative = Termin ;
|
terminative = Terminative ;
|
||||||
essive = Ess ;
|
essive = Essive ;
|
||||||
abessive = Abess ;
|
abessive = Abessive ;
|
||||||
comitative = Comit ;
|
comitative = Comitative ;
|
||||||
|
|
||||||
|
-- IL 2022-04: after introducing stem+suffixes, 4 other cases have just genitive stems.
|
||||||
|
-- isActuallyGenitive is needed for those mkN2 and mkN3 instances that take a Prep as an argument,
|
||||||
|
-- and actual Gen gets isPre=True, and those with genitive stem+suffix should get False.
|
||||||
|
-- This is confusing and error-prone, consider restructuring/renaming things later.
|
||||||
|
isActuallyGenitive : MorphoEst.CasePlus -> Bool = \c -> case c of {
|
||||||
|
{c = MorphoEst.Gen ; suf = ""} => True ;
|
||||||
|
_ => False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- combination of stem + suffix, e.g. infDes = {stem = InfD ; suf = "es"} ;
|
||||||
|
InfForm = ResEst.InfForms ;
|
||||||
infDa = InfDa ; infMa = InfMa ; infMast = InfMast ;
|
infDa = InfDa ; infMa = InfMa ; infMast = InfMast ;
|
||||||
infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ;
|
infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ; infMine = InfMine ;
|
||||||
|
|
||||||
prePrep : Case -> Str -> Prep =
|
mkAdposition : (isPre : Bool) -> Case -> Str -> Prep = \isPre,c,p -> lin Prep {
|
||||||
\c,p -> {c = NPCase c ; s = p ; isPre = True ; lock_Prep = <>} ;
|
c = casep2npformp c ;
|
||||||
postPrep : Case -> Str -> Prep =
|
s = p ;
|
||||||
\c,p -> {c = NPCase c ; s = p ; isPre = False ; lock_Prep = <>} ;
|
isPre = isPre
|
||||||
postGenPrep p = {
|
} ;
|
||||||
c = NPCase genitive ; s = p ; isPre = False ; lock_Prep = <>} ;
|
prePrep : Case -> Str -> Prep = mkAdposition True ;
|
||||||
casePrep : Case -> Prep =
|
postPrep : Case -> Str -> Prep = mkAdposition False ;
|
||||||
\c -> {c = NPCase c ; s = [] ; isPre = True ; lock_Prep = <>} ;
|
postGenPrep : Str -> Prep = postPrep genitive ;
|
||||||
accPrep = {c = NPAcc ; s = [] ; isPre = True ; lock_Prep = <>} ;
|
mkPrep = overload {
|
||||||
|
mkPrep : Str -> Prep = postGenPrep ;
|
||||||
|
mkPrep : Case -> Prep = casePrep ;
|
||||||
|
mkPrep : Case -> Str -> Prep = postPrep ;
|
||||||
|
mkPrep : (isPre : Bool) -> Case -> Str -> Prep = mkAdposition
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- The Prep's isPre field is used in a special (hacky) way in mkN3 and mkN2.
|
||||||
|
-- Used to be able to match whether the Prep's case is Gen, but now several
|
||||||
|
-- Preps use the genitive stem, so we need to check if it's actually genitive.
|
||||||
|
casePrep : Case -> Prep = \c -> mkAdposition (isActuallyGenitive c) c [] ;
|
||||||
|
|
||||||
mkAdv : Str -> Adv = \str -> {s = str ; lock_Adv = <>} ;
|
-- NPAcc is different, it's not formed from a Case(Plus)
|
||||||
mkAdV : Str -> AdV = \str -> {s = str ; lock_AdV = <>} ;
|
accPrep : Prep = lin Prep {
|
||||||
mkAdN : Str -> AdN = \str -> {s = str ; lock_AdN = <>} ;
|
c = case2npformp NPAcc ;
|
||||||
mkAdA : Str -> AdA = \str -> {s = str ; lock_AdA = <>} ;
|
s = [] ;
|
||||||
|
isPre = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkAdv : Str -> Adv = \str -> lin Adv (ss str) ;
|
||||||
|
mkAdV : Str -> AdV = \str -> lin AdV (ss str) ;
|
||||||
|
mkAdN : Str -> AdN = \str -> lin AdN (ss str) ;
|
||||||
|
mkAdA : Str -> AdA = \str -> lin AdA (ss str) ;
|
||||||
|
|
||||||
|
|
||||||
mkConj = overload {
|
mkConj = overload {
|
||||||
mkConj : Str -> Conj = \ja -> lin Conj ((sd2 "" ja) ** {n = Sg}) ;
|
mkConj : Str -> Conj = \ja -> lin Conj ((sd2 "" ja) ** {n = Sg}) ;
|
||||||
mkConj : Str -> Number -> Conj = \ja,num -> lin Conj ((sd2 "" ja) ** {n = num}) ;
|
mkConj : Str -> Number -> Conj = \ja,num -> lin Conj ((sd2 "" ja) ** {n = num}) ;
|
||||||
@@ -321,7 +356,7 @@ oper
|
|||||||
mkConj : Str -> Str -> Number -> Conj = \nii,kui,num -> lin Conj ((sd2 nii kui) ** {n = num}) ;
|
mkConj : Str -> Str -> Number -> Conj = \nii,kui,num -> lin Conj ((sd2 nii kui) ** {n = num}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPConj s = ss s ** {lock_PConj = <>} ;
|
mkPConj s = lin PConj (ss s) ;
|
||||||
|
|
||||||
mkN = overload {
|
mkN = overload {
|
||||||
mkN : (nisu : Str) -> N = mk1N ;
|
mkN : (nisu : Str) -> N = mk1N ;
|
||||||
@@ -335,43 +370,42 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Adjective forms (incl. comp and sup) are derived from noun forms
|
-- Adjective forms (incl. comp and sup) are derived from noun forms
|
||||||
mk1A : Str -> A = \suur ->
|
mk1A : Str -> A = \suur ->
|
||||||
let aforms = aForms2A (nforms2aforms (hjk_type suur))
|
let aforms = aForms2A (nforms2aforms (hjk_type suur))
|
||||||
in aforms ** {infl = Regular } ;
|
in lin A (aforms ** {infl = Regular}) ;
|
||||||
|
|
||||||
mkNA : N -> A = \suur ->
|
|
||||||
let aforms = aForms2A (nforms2aforms (n2nforms suur)) ;
|
|
||||||
in aforms ** {infl = Regular } ;
|
|
||||||
|
|
||||||
|
mkNA : N -> A = \suur ->
|
||||||
|
let aforms = aForms2A (nforms2aforms (n2nforms suur)) ;
|
||||||
|
in lin A (aforms ** {infl = Regular}) ;
|
||||||
|
|
||||||
mk1N : (link : Str) -> N = \s -> nForms2N (hjk_type s) ** {lock_N = <> } ;
|
mk1N : (link : Str) -> N = \s -> lin N (nForms2N (hjk_type s)) ;
|
||||||
|
|
||||||
-- mk2N, mk3N, mk4N make sure that the user specified forms end up in the paradigm,
|
-- mk2N, mk3N, mk4N make sure that the user specified forms end up in the paradigm,
|
||||||
-- even though the rest is wrong
|
-- even though the rest is wrong
|
||||||
mk2N : (link,lingi : Str) -> N = \link,lingi ->
|
mk2N : (link,lingi : Str) -> N = \link,lingi ->
|
||||||
let nfs : NForms = (nForms2 link lingi) ;
|
let nfs : NForms = (nForms2 link lingi) ;
|
||||||
nfs_fixed : NForms = table {
|
nfs_fixed : NForms = table {
|
||||||
0 => link ;
|
0 => link ;
|
||||||
1 => lingi ;
|
1 => lingi ;
|
||||||
2 => nfs ! 2 ;
|
2 => nfs ! 2 ;
|
||||||
3 => nfs ! 3 ;
|
3 => nfs ! 3 ;
|
||||||
4 => nfs ! 4 ;
|
4 => nfs ! 4 ;
|
||||||
5 => nfs ! 5
|
5 => nfs ! 5
|
||||||
} ;
|
} ;
|
||||||
in nForms2N nfs_fixed ** {lock_N = <> } ;
|
in lin N (nForms2N nfs_fixed) ;
|
||||||
|
|
||||||
|
|
||||||
mk3N : (tukk,tuku,tukku : Str) -> N = \tukk,tuku,tukku ->
|
mk3N : (tukk,tuku,tukku : Str) -> N = \tukk,tuku,tukku ->
|
||||||
let nfs : NForms = (nForms3 tukk tuku tukku) ;
|
let nfs : NForms = (nForms3 tukk tuku tukku) ;
|
||||||
nfs_fixed : NForms = table {
|
nfs_fixed : NForms = table {
|
||||||
0 => tukk ;
|
0 => tukk ;
|
||||||
1 => tuku ;
|
1 => tuku ;
|
||||||
2 => tukku ;
|
2 => tukku ;
|
||||||
3 => nfs ! 3 ;
|
3 => nfs ! 3 ;
|
||||||
4 => nfs ! 4 ;
|
4 => nfs ! 4 ;
|
||||||
5 => nfs ! 5
|
5 => nfs ! 5
|
||||||
} ;
|
} ;
|
||||||
in nForms2N nfs_fixed ** {lock_N = <> } ;
|
in lin N (nForms2N nfs_fixed) ;
|
||||||
|
|
||||||
|
|
||||||
mk4N : (paat,paadi,paati,paate : Str) -> N = \paat,paadi,paati,paate ->
|
mk4N : (paat,paadi,paati,paate : Str) -> N = \paat,paadi,paati,paate ->
|
||||||
@@ -381,20 +415,20 @@ oper
|
|||||||
1 => paadi ;
|
1 => paadi ;
|
||||||
2 => paati ;
|
2 => paati ;
|
||||||
3 => nfs ! 3 ;
|
3 => nfs ! 3 ;
|
||||||
4 => nfs ! 4 ;
|
4 => nfs ! 4 ;
|
||||||
5 => paate
|
5 => paate
|
||||||
} ;
|
} ;
|
||||||
in nForms2N nfs_fixed ** {lock_N = <> } ;
|
in lin N (nForms2N nfs_fixed) ;
|
||||||
|
|
||||||
|
|
||||||
mk6N : (oun,ouna,ouna,ounasse,ounte,ounu : Str) -> N =
|
mk6N : (oun,ouna,ouna,ounasse,ounte,ounu : Str) -> N =
|
||||||
\a,b,c,d,e,f -> nForms2N (nForms6 a b c d e f) ** {lock_N = <> } ;
|
\a,b,c,d,e,f -> lin N (nForms2N (nForms6 a b c d e f)) ;
|
||||||
|
|
||||||
mkStrN : Str -> N -> N = \sora,tie -> {
|
mkStrN : Str -> N -> N = \sora,tie -> tie ** {
|
||||||
s = \\c => sora + tie.s ! c ; lock_N = <>
|
s = \\c => sora + tie.s ! c
|
||||||
} ;
|
} ;
|
||||||
mkNN : N -> N -> N = \oma,tunto -> {
|
mkNN : N -> N -> N = \oma,tunto -> tunto ** {
|
||||||
s = \\c => oma.s ! c + tunto.s ! c ; lock_N = <>
|
s = \\c => oma.s ! c + tunto.s ! c ;
|
||||||
} ; ---- TODO: oma in possessive suffix forms
|
} ; ---- TODO: oma in possessive suffix forms
|
||||||
|
|
||||||
|
|
||||||
@@ -510,7 +544,7 @@ oper
|
|||||||
-- voolik/vooliku/voolikut
|
-- voolik/vooliku/voolikut
|
||||||
<_ + #c, _ + #v, _ + #v + "t"> => hjk_type_IVb_audit tukk u ;
|
<_ + #c, _ + #v, _ + #v + "t"> => hjk_type_IVb_audit tukk u ;
|
||||||
|
|
||||||
_ => nForms2 tukk tuku
|
_ => nForms2 tukk tuku
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
nForms4 : (_,_,_,_ : Str) -> NForms = \paat,paadi,paati,paate ->
|
nForms4 : (_,_,_,_ : Str) -> NForms = \paat,paadi,paati,paate ->
|
||||||
@@ -518,33 +552,33 @@ oper
|
|||||||
-- distinguish between joonis and segadus
|
-- distinguish between joonis and segadus
|
||||||
<_ +("ne"|"s"), _+"se", _+"st", _+"seid"> => hjk_type_Va_otsene paat ;
|
<_ +("ne"|"s"), _+"se", _+"st", _+"seid"> => hjk_type_Va_otsene paat ;
|
||||||
<_ +("ne"|"s"), _+"se", _+"st", _+"si"> => hjk_type_Vb_oluline paat ;
|
<_ +("ne"|"s"), _+"se", _+"st", _+"si"> => hjk_type_Vb_oluline paat ;
|
||||||
|
|
||||||
<_ +"ne", _+"se", _+"set", _+"seid"> => nForms3 paat paadi paati ; -- -ne adjectives ('algne') are not like 'tõuge'
|
<_ +"ne", _+"se", _+"set", _+"seid"> => nForms3 paat paadi paati ; -- -ne adjectives ('algne') are not like 'tõuge'
|
||||||
|
|
||||||
--distinguish between kõne and aine
|
--distinguish between kõne and aine
|
||||||
<_ +"e", _+"e", _+"et", _+"sid"> => hjk_type_III_ratsu paat ;
|
<_ +"e", _+"e", _+"et", _+"sid"> => hjk_type_III_ratsu paat ;
|
||||||
<_ +"e", _+"e", _+"et", _+"eid"> => hjk_type_VII_touge2 paat paadi ;
|
<_ +"e", _+"e", _+"et", _+"eid"> => hjk_type_VII_touge2 paat paadi ;
|
||||||
|
|
||||||
_ => nForms3 paat paadi paati
|
_ => nForms3 paat paadi paati
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
--Version that uses pl gen instead of pl part
|
--Version that uses pl gen instead of pl part
|
||||||
nForms4 : (_,_,_,_ : Str) -> NForms = \paat,paadi,paati,paatide ->
|
nForms4 : (_,_,_,_ : Str) -> NForms = \paat,paadi,paati,paatide ->
|
||||||
case <paat,paadi,paati,paatide> of {
|
case <paat,paadi,paati,paatide> of {
|
||||||
-- pl gen can't distinguish between joonis and segadus
|
-- pl gen can't distinguish between joonis and segadus
|
||||||
-- <_ +("ne"|"s"), _+"se", _+"st", _+"seid"> => hjk_type_Va_otsene paat ;
|
-- <_ +("ne"|"s"), _+"se", _+"st", _+"seid"> => hjk_type_Va_otsene paat ;
|
||||||
-- <_ +("ne"|"s"), _+"se", _+"st", _+"si"> => hjk_type_Vb_oluline paat ;
|
-- <_ +("ne"|"s"), _+"se", _+"st", _+"si"> => hjk_type_Vb_oluline paat ;
|
||||||
|
|
||||||
--pl gen can distinguish between kõne and aine
|
--pl gen can distinguish between kõne and aine
|
||||||
--plus side that any noun that is formed with 4-arg,
|
--plus side that any noun that is formed with 4-arg,
|
||||||
--the user given forms are inserted to the paradigm,
|
--the user given forms are inserted to the paradigm,
|
||||||
--and more forms are created from pl gen, none from pl part
|
--and more forms are created from pl gen, none from pl part
|
||||||
<_ +"e", _+"e", _+"et", _+"de"> => hjk_type_III_ratsu paat ;
|
<_ +"e", _+"e", _+"et", _+"de"> => hjk_type_III_ratsu paat ;
|
||||||
<_ +"e", _+"e", _+"et", _+"te"> => hjk_type_VII_touge2 paat paadi ;
|
<_ +"e", _+"e", _+"et", _+"te"> => hjk_type_VII_touge2 paat paadi ;
|
||||||
|
|
||||||
_ => nForms3 paat paadi paati
|
_ => nForms3 paat paadi paati
|
||||||
} ;
|
} ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
mkN2 = overload {
|
mkN2 = overload {
|
||||||
@@ -552,72 +586,72 @@ oper
|
|||||||
mkN2 : N -> Prep -> N2 = mmkN2
|
mkN2 : N -> Prep -> N2 = mmkN2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mmkN2 : N -> Prep -> N2 = \n,c -> n ** {c2 = c ; isPre = mkIsPre c ; lock_N2 = <>} ;
|
mmkN2 : N -> Prep -> N2 = \n,c -> lin N2 (n ** {
|
||||||
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ;
|
c2 = c ;
|
||||||
|
isPre = mkIsPre c ;
|
||||||
|
postmod = []
|
||||||
|
}) ;
|
||||||
|
|
||||||
|
mkN3 = \n,c,e -> lin N3 (n ** {
|
||||||
|
c2 = c ; c3 = e ;
|
||||||
isPre = mkIsPre c ; -- matka Londonist Pariisi
|
isPre = mkIsPre c ; -- matka Londonist Pariisi
|
||||||
isPre2 = mkIsPre e ; -- Suomen voitto Ruotsista
|
isPre2 = mkIsPre e ; -- Suomen voitto Ruotsista
|
||||||
lock_N3 = <>
|
}) ;
|
||||||
} ;
|
|
||||||
|
mkIsPre : Prep -> Bool = \p -> case p.c.npf of {
|
||||||
mkIsPre : Prep -> Bool = \p -> case p.c of {
|
|
||||||
NPCase Gen => notB p.isPre ; -- Jussin veli (prep is <Gen,"",True>, isPre becomes False)
|
NPCase Gen => notB p.isPre ; -- Jussin veli (prep is <Gen,"",True>, isPre becomes False)
|
||||||
_ => True -- syyte Jussia vastaan, puhe Jussin puolesta
|
_ => True -- syyte Jussia vastaan, puhe Jussin puolesta
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPN = overload {
|
mkPN = overload {
|
||||||
mkPN : Str -> PN = mkPN_1 ;
|
mkPN : Str -> PN = mkPN_1 ;
|
||||||
mkPN : N -> PN = \s -> {s = \\c => s.s ! NCase Sg c ; lock_PN = <>} ;
|
mkPN : N -> PN = \s -> lin PN {s = \\c => s.s ! NCase Sg c} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPN_1 : Str -> PN = \s -> {s = \\c => (mk1N s).s ! NCase Sg c ; lock_PN = <>} ;
|
mkPN_1 : Str -> PN = \s -> lin PN {s = \\c => (mk1N s).s ! NCase Sg c} ;
|
||||||
|
|
||||||
-- adjectives
|
-- adjectives
|
||||||
|
|
||||||
mkA = overload {
|
mkA = overload {
|
||||||
mkA : Str -> A = mkA_1 ;
|
mkA : Str -> A = mkA_1 ;
|
||||||
mkA : N -> A = \n -> noun2adjDeg n ** {infl = Regular ; lock_A = <>} ;
|
mkA : N -> A = \n -> noun2adjDeg n ** {infl = Regular} ;
|
||||||
mkA : N -> (parem,parim : Str) -> A = regAdjective ;
|
mkA : N -> (parem,parim : Str) -> A = regAdjective ;
|
||||||
mkA : N -> (infl : Infl) -> A = \n,infl -> noun2adjDeg n ** {infl = infl ; lock_A = <>} ;
|
mkA : N -> (infl : Infl) -> A = \n,infl -> noun2adjDeg n ** {infl = infl} ;
|
||||||
-- TODO: temporary usage of regAdjective1
|
|
||||||
mkA : N -> (valmim,valmeim : Str) -> (infl : Infl) -> A =
|
mkA : N -> (valmim,valmeim : Str) -> (infl : Infl) -> A =
|
||||||
\n,c,s,infl -> (regAdjective1 n c s) ** {infl = infl ; lock_A = <>} ;
|
\n,c,s,infl ->
|
||||||
|
let regA : A = regAdjective n c s
|
||||||
|
in regA ** {infl = infl} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
invA balti = {s = \\_,_ => balti ; infl = Invariable ; lock_A = <>} ;
|
invA balti = lin A {s = \\_,_ => balti ; infl = Invariable} ;
|
||||||
|
|
||||||
mkA_1 : Str -> A = \x -> noun2adjDeg (mk1N x) ** {infl = Regular ; lock_A = <>} ;
|
mkA_1 : Str -> A = \x -> noun2adjDeg (mk1N x) ** {infl = Regular } ;
|
||||||
|
|
||||||
-- auxiliaries
|
-- auxiliaries
|
||||||
mkAdjective : (_,_,_ : Adj) -> A = \hea,parem,parim ->
|
mkAdjective : (_,_,_ : Adj) -> A = \hea,parem,parim -> lin A ({
|
||||||
{s = table {
|
s = table {
|
||||||
Posit => hea.s ;
|
Posit => hea.s ;
|
||||||
Compar => parem.s ;
|
Compar => parem.s ;
|
||||||
Superl => parim.s
|
Superl => parim.s
|
||||||
} ;
|
} ;
|
||||||
infl = Regular ;
|
infl = Regular ;
|
||||||
lock_A = <>
|
}) ;
|
||||||
} ;
|
|
||||||
|
|
||||||
-- Adjectives whose comparison forms are explicitly given.
|
-- Adjectives whose comparison forms are explicitly given.
|
||||||
-- The inflection of these forms with the audit-rule always works.
|
-- The inflection of these forms with the audit-rule always works.
|
||||||
regAdjective : Noun -> Str -> Str -> A = \posit,compar,superl ->
|
regAdjective : Noun -> Str -> Str -> A = \posit,compar,superl ->
|
||||||
mkAdjective
|
mkAdjective
|
||||||
(noun2adj posit)
|
(noun2adj posit)
|
||||||
(noun2adjComp False (nForms2N (hjk_type_IVb_audit compar "a")))
|
(noun2adjComp False (nForms2N (hjk_type_IVb_audit compar "a")))
|
||||||
(noun2adjComp False (nForms2N (hjk_type_IVb_audit superl "a"))) ;
|
(noun2adjComp False (nForms2N (hjk_type_IVb_audit superl "a"))) ;
|
||||||
|
|
||||||
-- TODO: this is a temporary hack that converts A ~> Adjective.
|
|
||||||
-- The caller needs this otherwise ** fails.
|
|
||||||
-- This should be cleaned up but I don't know how (K).
|
|
||||||
regAdjective1 : Noun -> Str -> Str -> Adjective = regAdjective ;
|
|
||||||
|
|
||||||
-- Adjectives whose comparison forms can be derived from the sg gen.
|
-- Adjectives whose comparison forms can be derived from the sg gen.
|
||||||
-- In case of comparative this fails only for 70 adjectives.
|
-- In case of comparative this fails only for 70 adjectives.
|
||||||
-- Superlative is more complex, and does not always exist,
|
-- Superlative is more complex, and does not always exist,
|
||||||
-- e.g. lai -> laiem -> laiim? / laieim?
|
-- e.g. lai -> laiem -> laiim? / laieim?
|
||||||
-- See also: http://www.eki.ee/books/ekk09/index.php?p=3&p1=4&id=208
|
-- See also: http://www.eki.ee/books/ekk09/index.php?p=3&p1=4&id=208
|
||||||
-- Rather use "kõige" + Comp instead of the superlative.
|
-- Rather use "kõige" + Comp instead of the superlative.
|
||||||
noun2adjDeg : Noun -> Adjective = \kaunis ->
|
noun2adjDeg : Noun -> A = \kaunis ->
|
||||||
let
|
let
|
||||||
kauni = (kaunis.s ! NCase Sg Gen) ;
|
kauni = (kaunis.s ! NCase Sg Gen) ;
|
||||||
-- Convert the final 'i' to 'e' for the superlative
|
-- Convert the final 'i' to 'e' for the superlative
|
||||||
@@ -637,31 +671,17 @@ oper
|
|||||||
mkV : (aru : Str) -> (saama : V) -> V = mkPV ; -- particle verbs
|
mkV : (aru : Str) -> (saama : V) -> V = mkPV ; -- particle verbs
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mk1V : Str -> V = \s ->
|
vforms2v : ResEst.VForms -> CatEst.V = \vfs -> lin V (vforms2verb vfs ** {sc = NPCase Nom}) ;
|
||||||
let vfs = vforms2V (vForms1 s) in
|
mk1V : Str -> V = \s -> vforms2v (vForms1 s) ;
|
||||||
vfs ** {sc = NPCase Nom ; lock_V = <>} ;
|
mk2V : (_,_ : Str) -> V = \x,y -> vforms2v (vForms2 x y) ;
|
||||||
mk2V : (_,_ : Str) -> V = \x,y ->
|
mk3V : (_,_,_ : Str) -> V = \x,y,z -> vforms2v (vForms3 x y z) ;
|
||||||
let
|
mk4V : (x1,_,_,x4 : Str) -> V = \a,b,c,d -> vforms2v (vForms4 a b c d) ;
|
||||||
vfs = vforms2V (vForms2 x y)
|
mk8V : (x1,_,_,_,_,_,_,x8 : Str) -> V = \a,b,c,d,e,f,g,h -> vforms2v (vForms8 a b c d e f g h) ;
|
||||||
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
|
mkPV : (aru : Str) -> (saama : V) -> V = \aru,saama -> saama ** {p=aru} ;
|
||||||
mk3V : (_,_,_ : Str) -> V = \x,y,z ->
|
|
||||||
let
|
|
||||||
vfs = vforms2V (vForms3 x y z)
|
-- This used to be the last case: _ => Predef.error (["expected infinitive, found"] ++ ottaa)
|
||||||
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
|
-- regexp example: ("" | ?) + ("a" | "e" | "i") + _ + "aa" =>
|
||||||
mk4V : (x1,_,_,x4 : Str) -> V = \a,b,c,d ->
|
|
||||||
let
|
|
||||||
vfs = vforms2V (vForms4 a b c d)
|
|
||||||
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
|
|
||||||
mk8V : (x1,_,_,_,_,_,_,x8 : Str) -> V = \a,b,c,d,e,f,g,h ->
|
|
||||||
let
|
|
||||||
vfs = vforms2V (vForms8 a b c d e f g h)
|
|
||||||
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
|
|
||||||
mkPV : (aru : Str) -> (saama : V) -> V = \aru,saama ->
|
|
||||||
{s = saama.s ; p = aru ; sc = saama.sc ; lock_V = <> } ;
|
|
||||||
|
|
||||||
|
|
||||||
-- This used to be the last case: _ => Predef.error (["expected infinitive, found"] ++ ottaa)
|
|
||||||
-- regexp example: ("" | ?) + ("a" | "e" | "i") + _ + "aa" =>
|
|
||||||
vForms1 : Str -> VForms = \lugema ->
|
vForms1 : Str -> VForms = \lugema ->
|
||||||
let
|
let
|
||||||
luge = Predef.tk 2 lugema ;
|
luge = Predef.tk 2 lugema ;
|
||||||
@@ -672,7 +692,7 @@ oper
|
|||||||
-- Small class of CVVma
|
-- Small class of CVVma
|
||||||
? + ("ä"|"õ"|"i") + "ima" =>
|
? + ("ä"|"õ"|"i") + "ima" =>
|
||||||
cKaima lugema ; --käima,viima,võima
|
cKaima lugema ; --käima,viima,võima
|
||||||
? + ("aa"|"ee"|"ää") + "ma" =>
|
? + ("aa"|"ee"|"ää") + "ma" =>
|
||||||
cSaama lugema ; -- saama,jääma,keema
|
cSaama lugema ; -- saama,jääma,keema
|
||||||
? + ("oo"|"öö"|"üü") + "ma" =>
|
? + ("oo"|"öö"|"üü") + "ma" =>
|
||||||
cJooma lugema ; --jooma,looma,lööma,müüma,pooma,sööma,tooma
|
cJooma lugema ; --jooma,looma,lööma,müüma,pooma,sööma,tooma
|
||||||
@@ -680,30 +700,30 @@ oper
|
|||||||
-- TS 53
|
-- TS 53
|
||||||
_ + #c + #v + "elema" =>
|
_ + #c + #v + "elema" =>
|
||||||
cTegelema lugema ; --not aelema
|
cTegelema lugema ; --not aelema
|
||||||
|
|
||||||
-- TS 54
|
-- TS 54
|
||||||
-- Small class, just list all members
|
-- Small class, just list all members
|
||||||
("tule"|"sure"|"pane") + "ma" =>
|
("tule"|"sure"|"pane") + "ma" =>
|
||||||
cTulema lugema ;
|
cTulema lugema ;
|
||||||
|
|
||||||
-- TS 55-57
|
-- TS 55-57
|
||||||
-- Consonant gradation
|
-- Consonant gradation
|
||||||
-- Regular (55-56)'leppima' and irregular (57) 'lugema'
|
-- Regular (55-56)'leppima' and irregular (57) 'lugema'
|
||||||
-- For reliable results regarding consonant gradation, use mk3V
|
-- For reliable results regarding consonant gradation, use mk3V
|
||||||
_ + "ndima" =>
|
_ + "ndima" =>
|
||||||
cLeppima lugema ;
|
cLeppima lugema ;
|
||||||
_ + #lmnr + ("k"|"p"|"t"|"b") + ("ima"|"uma") =>
|
_ + #lmnr + ("k"|"p"|"t"|"b") + ("ima"|"uma") =>
|
||||||
cLeppima lugema ;
|
cLeppima lugema ;
|
||||||
_ + ("sk"|"ps"|"ks"|"ts"|"pl") + ("ima") => --|"uma") =>
|
_ + ("sk"|"ps"|"ks"|"ts"|"pl") + ("ima") => --|"uma") =>
|
||||||
cLeppima lugema ;
|
cLeppima lugema ;
|
||||||
_ + ("hk"|"hm"|"hn"|"hr"|"ht") + ("ima") => --most *hCuma are TS 51 (muutuma)
|
_ + ("hk"|"hm"|"hn"|"hr"|"ht") + ("ima") => --most *hCuma are TS 51 (muutuma)
|
||||||
cLeppima lugema ;
|
cLeppima lugema ;
|
||||||
_ + #c + "ssima" => --weaker *ss = *ss; should be weaker Css = Cs
|
_ + #c + "ssima" => --weaker *ss = *ss; should be weaker Css = Cs
|
||||||
cLugema lugema ;
|
cLugema lugema ;
|
||||||
_ + ("pp"|"kk"|"tt"|"ss"|"ff"|"nn"|"mm"|"ll"|"rr") + ("ima"|"uma") =>
|
_ + ("pp"|"kk"|"tt"|"ss"|"ff"|"nn"|"mm"|"ll"|"rr") + ("ima"|"uma") =>
|
||||||
cLeppima lugema ;
|
cLeppima lugema ;
|
||||||
|
|
||||||
-- TS 59 (petma, tapma)
|
-- TS 59 (petma, tapma)
|
||||||
-- Use mk4V for TS 60 (jätma, võtma)
|
-- Use mk4V for TS 60 (jätma, võtma)
|
||||||
? + #v + ("tma"|"pma") =>
|
? + #v + ("tma"|"pma") =>
|
||||||
cPetma lugema (luge + "etakse") ;
|
cPetma lugema (luge + "etakse") ;
|
||||||
@@ -714,31 +734,31 @@ oper
|
|||||||
-- TS 61 (laulma,kuulma,naerma,möönma)
|
-- TS 61 (laulma,kuulma,naerma,möönma)
|
||||||
-- Default vowel e for lma, a for (r|n)ma.
|
-- Default vowel e for lma, a for (r|n)ma.
|
||||||
-- Other vowel with mk3V.
|
-- Other vowel with mk3V.
|
||||||
_ + "lma" =>
|
_ + "lma" =>
|
||||||
cKuulma lugema (loe + "eb") ;
|
cKuulma lugema (loe + "eb") ;
|
||||||
_ + ("r"|"n") + "ma" =>
|
_ + ("r"|"n") + "ma" =>
|
||||||
cKuulma lugema (loe + "ab") ;
|
cKuulma lugema (loe + "ab") ;
|
||||||
|
|
||||||
-- TS 63 (andma,hoidma)
|
-- TS 63 (andma,hoidma)
|
||||||
-- Other vowel than a (tundma~tunneb) with mk3V
|
-- Other vowel than a (tundma~tunneb) with mk3V
|
||||||
_ + "dma" =>
|
_ + "dma" =>
|
||||||
cAndma lugema (loe + "ab") ;
|
cAndma lugema (loe + "ab") ;
|
||||||
|
|
||||||
-- TS 62, 64 (tõusma,mõskma), default vowel e
|
-- TS 62, 64 (tõusma,mõskma), default vowel e
|
||||||
-- 62 alt form (jooksma,joosta) with mk2V
|
-- 62 alt form (jooksma,joosta) with mk2V
|
||||||
-- Other vowel than e with mk3V
|
-- Other vowel than e with mk3V
|
||||||
_ + #c + "ma" =>
|
_ + #c + "ma" =>
|
||||||
cLaskma lugema (loe + "eb") ;
|
cLaskma lugema (loe + "eb") ;
|
||||||
|
|
||||||
-- TS 65 (pesema)
|
-- TS 65 (pesema)
|
||||||
#c + #v + "sema" =>
|
#c + #v + "sema" =>
|
||||||
cPesema lugema ;
|
cPesema lugema ;
|
||||||
|
|
||||||
-- TS 66 (nägema)
|
-- TS 66 (nägema)
|
||||||
-- Small class, just list all members
|
-- Small class, just list all members
|
||||||
("nägema"|"tegema") =>
|
("nägema"|"tegema") =>
|
||||||
cNagema lugema ;
|
cNagema lugema ;
|
||||||
|
|
||||||
-- TS 67-68 with mk2V
|
-- TS 67-68 with mk2V
|
||||||
-- no 100% way to distinguish from 50-52 that end in ama
|
-- no 100% way to distinguish from 50-52 that end in ama
|
||||||
|
|
||||||
@@ -754,7 +774,7 @@ oper
|
|||||||
-- Default case
|
-- Default case
|
||||||
_ =>
|
_ =>
|
||||||
cElama lugema
|
cElama lugema
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
vForms2 : (_,_ : Str) -> VForms = \petma,petta ->
|
vForms2 : (_,_ : Str) -> VForms = \petma,petta ->
|
||||||
-- Arguments: ma infinitive, da infinitive
|
-- Arguments: ma infinitive, da infinitive
|
||||||
@@ -781,22 +801,22 @@ oper
|
|||||||
-- * Non-detectable gradation (sattuma~satub ; pettuma~pettub)
|
-- * Non-detectable gradation (sattuma~satub ; pettuma~pettub)
|
||||||
-- * Non-default vowel in b for TS 58-64 (laulma~laulab)
|
-- * Non-default vowel in b for TS 58-64 (laulma~laulab)
|
||||||
case <taguma,taguda,taob> of {
|
case <taguma,taguda,taob> of {
|
||||||
|
|
||||||
--to be sure about vowel in b
|
--to be sure about vowel in b
|
||||||
<_ + "dma", _ + "da", _> => cAndma taguma taob ;
|
<_ + "dma", _ + "da", _> => cAndma taguma taob ;
|
||||||
<_, _ + #vv + #lmnr + "da", _> => cKuulma taguma taob ;
|
<_, _ + #vv + #lmnr + "da", _> => cKuulma taguma taob ;
|
||||||
<_, _ + #c + "ta", _> => cLaskma taguma taob ;
|
<_, _ + #c + "ta", _> => cLaskma taguma taob ;
|
||||||
|
|
||||||
--irregular gradation
|
--irregular gradation
|
||||||
<_, _, (""|#c) + #c + #v + #v + "b"> => cLugema taguma ; --57
|
<_, _, (""|#c) + #c + #v + #v + "b"> => cLugema taguma ; --57
|
||||||
|
|
||||||
--to be sure about consonant gradation
|
--to be sure about consonant gradation
|
||||||
<_ + #c + "lema", _, _> => vForms2 taguma taguda ; --catch "-Clema" first
|
<_ + #c + "lema", _, _> => vForms2 taguma taguda ; --catch "-Clema" first
|
||||||
<_ + #v + "ma", _+"da", _> => cSattumaPettuma taguma taob ;
|
<_ + #v + "ma", _+"da", _> => cSattumaPettuma taguma taob ;
|
||||||
|
|
||||||
<_,_,_> => vForms2 taguma taguda
|
<_,_,_> => vForms2 taguma taguda
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
vForms4 : (x1,_,_,x4 : Str) -> VForms = \jatma,jatta,jatab,jaetakse ->
|
vForms4 : (x1,_,_,x4 : Str) -> VForms = \jatma,jatta,jatab,jaetakse ->
|
||||||
-- 4 forms needed to get full paradigm for regular verbs
|
-- 4 forms needed to get full paradigm for regular verbs
|
||||||
-- (source: http://www.eki.ee/books/ekk09/index.php?p=3&p1=5&id=227)
|
-- (source: http://www.eki.ee/books/ekk09/index.php?p=3&p1=5&id=227)
|
||||||
@@ -804,7 +824,7 @@ oper
|
|||||||
-- Filter out known irregularities and give rest to regVForms.
|
-- Filter out known irregularities and give rest to regVForms.
|
||||||
-- Not trying to match TS 49 ; can't separate käima (49) from täima (50), or detect compounds like taaslooma.
|
-- Not trying to match TS 49 ; can't separate käima (49) from täima (50), or detect compounds like taaslooma.
|
||||||
case <jatma,jatta,jatab,jaetakse> of {
|
case <jatma,jatta,jatab,jaetakse> of {
|
||||||
<_, _+("kka"|"ppa"|"tta"),
|
<_, _+("kka"|"ppa"|"tta"),
|
||||||
_, _+"takse"> => cPetma jatma jaetakse ;
|
_, _+"takse"> => cPetma jatma jaetakse ;
|
||||||
<_ + "dma", _,
|
<_ + "dma", _,
|
||||||
_, _+"takse"> => cAndma jatma jatab ;
|
_, _+"takse"> => cAndma jatma jatab ;
|
||||||
@@ -813,15 +833,15 @@ oper
|
|||||||
<_, _ + "ha", _, _> => cNagema jatma ;
|
<_, _ + "ha", _, _> => cNagema jatma ;
|
||||||
<_ + #v + "sema", _ + "sta", _, _> => cPesema jatma ;
|
<_ + #v + "sema", _ + "sta", _, _> => cPesema jatma ;
|
||||||
<_,_,_,_> => regVForms jatma jatta jatab jaetakse
|
<_,_,_,_> => regVForms jatma jatta jatab jaetakse
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
caseV c v = {s = v.s ; p = v.p; sc = NPCase c ; lock_V = <>} ;
|
|
||||||
|
|
||||||
vOlema = verbOlema ** {sc = NPCase Nom ; lock_V = <>} ;
|
caseV c v = v ** {sc = NPCase c.c} ;
|
||||||
vMinema = verbMinema ** {sc = NPCase Nom ; lock_V = <>} ;
|
|
||||||
|
|
||||||
mk2V2 : V -> Prep -> V2 = \v,c -> v ** {c2 = c ; lock_V2 = <>} ;
|
vOlema = lin V (verbOlema ** {sc = NPCase Nom}) ;
|
||||||
caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ;
|
vMinema = lin V (verbMinema ** {sc = NPCase Nom}) ;
|
||||||
|
|
||||||
|
mk2V2 : V -> Prep -> V2 = \v,c -> lin V2 (v ** {c2 = c}) ;
|
||||||
|
caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ;
|
||||||
dirV2 v = mk2V2 v accPrep ;
|
dirV2 v = mk2V2 v accPrep ;
|
||||||
|
|
||||||
|
|
||||||
@@ -837,69 +857,69 @@ oper
|
|||||||
dirV2 : V -> V2 ;
|
dirV2 : V -> V2 ;
|
||||||
|
|
||||||
mkV3 = overload {
|
mkV3 = overload {
|
||||||
mkV3 : V -> Prep -> Prep -> V3 = \v,p,q -> v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
|
mkV3 : V -> Prep -> Prep -> V3 = \v,p,q -> lin V3 (v ** {c2 = p ; c3 = q}) ;
|
||||||
mkV2 : V -> V3 = \v -> v ** {c2 = accPrep ;
|
mkV3 : V -> V3 = \v -> lin V3 (v ** {c2 = accPrep ; c3 = casePrep allative}) ;
|
||||||
c3 = (casePrep allative) ;
|
mkV3 : Str -> V3 = \str ->
|
||||||
lock_V3 = <>} ;
|
let v : V = mkV str
|
||||||
mkV2 : Str -> V3 = \str -> (mkV str) ** {c2 = accPrep ;
|
in lin V3 (v ** {c2 = accPrep ; c3 = casePrep allative})
|
||||||
c3 = (casePrep allative) ;
|
} ;
|
||||||
lock_V3 = <>} ;
|
|
||||||
} ;
|
|
||||||
dirV3 v p = mkV3 v accPrep (casePrep p) ;
|
dirV3 v p = mkV3 v accPrep (casePrep p) ;
|
||||||
dirdirV3 v = dirV3 v allative ;
|
dirdirV3 v = dirV3 v allative ;
|
||||||
|
|
||||||
mkVS = overload {
|
mkVS = overload {
|
||||||
mkVS : V -> VS = \v -> v ** {lock_VS = <>} ;
|
mkVS : V -> VS = \v -> lin VS v ;
|
||||||
mkVS : Str -> VS = \str -> (mkV str) ** {lock_VS = <>} ;
|
mkVS : Str -> VS = \str -> let v : V = mkV str in lin VS v ;
|
||||||
} ;
|
} ;
|
||||||
mkVV = overload {
|
mkVV = overload {
|
||||||
mkVV : V -> VV = \v -> mkVVf v infDa ;
|
mkVV : V -> VV = \v -> mkVVf v infDa ;
|
||||||
mkVV : Str -> VV = \str -> mkVVf (mkV str) infDa ;
|
mkVV : Str -> VV = \str -> mkVVf (mkV str) infDa ;
|
||||||
} ;
|
} ;
|
||||||
mkVVf v f = v ** {vi = f ; lock_VV = <>} ;
|
mkVVf v f = lin VV (v ** {vi = f}) ;
|
||||||
mkVQ = overload {
|
mkVQ = overload {
|
||||||
mkVQ : V -> VQ = \v -> v ** {lock_VQ = <>} ;
|
mkVQ : V -> VQ = \v -> lin VQ v ;
|
||||||
mkVQ : Str -> VQ = \str -> (mkV str) ** {lock_VQ = <>} ;
|
mkVQ : Str -> VQ = \str -> let v : V = mkV str in lin VQ v ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
V0 : Type = V ;
|
V0 : Type = V ;
|
||||||
AS, A2S, AV : Type = A ;
|
AS, A2S, AV : Type = A ;
|
||||||
A2V : Type = A2 ;
|
A2V : Type = A2 ;
|
||||||
|
|
||||||
mkV0 v = v ** {lock_V = <>} ;
|
mkV0 v = v ;
|
||||||
mkV2S = overload {
|
mkV2S = overload {
|
||||||
mkV2S : V -> Prep -> V2S = \v,p -> (mk2V2 v p) ** {lock_V2S = <>} ;
|
mkV2S : V -> Prep -> V2S = \v,p -> lin V2S (mk2V2 v p) ;
|
||||||
mkV2S : Str -> V2S = \str -> (mk2V2 (mkV str) (casePrep allative)) ** {lock_VS = <>} ;
|
mkV2S : Str -> V2S = \str ->
|
||||||
|
let v : V = mkV str
|
||||||
|
in lin V2S (mk2V2 v (casePrep allative))
|
||||||
} ;
|
} ;
|
||||||
-- mkV2S v p = mk2V2 v p ** {lock_V2S = <>} ;
|
|
||||||
mkV2V = overload {
|
mkV2V = overload {
|
||||||
mkV2V : V -> Prep -> V2V = \v,p -> mkV2Vf v p infMa ;
|
mkV2V : V -> Prep -> V2V = \v,p -> mkV2Vf v p infMa ;
|
||||||
mkV2V : V -> V2V = \v -> mkV2Vf v (casePrep genitive) infMa ;
|
mkV2V : V -> V2V = \v -> mkV2Vf v (casePrep genitive) infMa ;
|
||||||
mkV2V : Str -> V2V = \str -> mkV2Vf (mkV str) (casePrep genitive) infMa ;
|
mkV2V : Str -> V2V = \str -> mkV2Vf (mkV str) (casePrep genitive) infMa ;
|
||||||
} ;
|
} ;
|
||||||
mkV2Vf v p f = mk2V2 v p ** {vi = f ; lock_V2V = <>} ;
|
mkV2Vf v p f = lin V2V (mk2V2 v p ** {vi = f}) ;
|
||||||
|
|
||||||
mkVA = overload {
|
mkVA = overload {
|
||||||
mkVA : V -> Prep -> VA = \v,p -> v ** {c2 = p ; lock_VA = <>} ;
|
mkVA : V -> Prep -> VA = \v,p -> lin VA (v ** {c2 = p}) ;
|
||||||
mkVA : V -> VA = \v -> v ** {c2 = casePrep translative ; lock_VA = <>} ;
|
mkVA : V -> VA = \v -> lin VA (v ** {c2 = casePrep genitive}) ;
|
||||||
mkVA : Str -> VA = \str -> (mkV str) ** {c2 = casePrep translative ; lock_VA = <>} ;
|
mkVA : Str -> VA = \str -> let v : V = mkV str in
|
||||||
|
lin VA (v ** {c2 = casePrep genitive}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV2A = overload {
|
mkV2A = overload {
|
||||||
mkV2A : V -> Prep -> Prep -> V2A = \v,p,q -> v ** {c2 = p ; c3 = q ; lock_V2A = <>} ;
|
mkV2A : V -> Prep -> Prep -> V2A = \v,p,q ->
|
||||||
mkV2A : V -> V2A = \v -> v ** {c2 = casePrep genitive ;
|
lin V2A (v ** {c2 = p ; c3 = q}) ;
|
||||||
c3 = casePrep translative ;
|
mkV2A : V -> V2A = \v ->
|
||||||
lock_V2A = <>} ;
|
lin V2A (v ** {c2 = casePrep genitive ; c3 = casePrep translative}) ;
|
||||||
mkV2A : Str -> V2A = \str -> (mkV str) ** {c2 = casePrep genitive ;
|
mkV2A : Str -> V2A = \str -> let v : V = mkV str in
|
||||||
c3 = casePrep translative ;
|
lin V2A (v ** {c2 = casePrep genitive ; c3 = casePrep translative}) ;
|
||||||
lock_V2A = <>} ;
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV2Q v p = mk2V2 v p ** {lock_V2Q = <>} ;
|
mkV2Q v p = lin V2Q (mk2V2 v p) ;
|
||||||
|
|
||||||
mkAS v = v ** {lock_A = <>} ;
|
mkAS a = a ;
|
||||||
mkA2S v p = mkA2 v p ** {lock_A = <>} ;
|
mkA2S a p = mkA2 a p ;
|
||||||
mkAV v = v ** {lock_A = <>} ;
|
mkAV a = a ;
|
||||||
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
|
mkA2V a p = mkA2 a p ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ concrete PhraseEst of Phrase = CatEst ** open ResEst, (P = Prelude) in {
|
|||||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Ag Pl P2} ;
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Ag Pl P2} ;
|
||||||
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! AgPol} ;
|
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! AgPol} ;
|
||||||
|
|
||||||
UttIP ip = {s = ip.s ! NPCase Nom} ;
|
UttIP ip = {s = linIP (NPCase Nom) ip} ;
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
UttNP np = {s = np.s ! NPCase Nom} ;
|
UttNP np = {s = linNP (NPCase Nom) np} ;
|
||||||
UttVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfDa} ;
|
UttVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ;
|
||||||
UttAdv adv = adv ;
|
UttAdv adv = adv ;
|
||||||
UttCN np = {s = np.s ! NCase Sg Nom} ;
|
UttCN cn = {s = linCN (NCase Sg Nom) cn} ;
|
||||||
UttAP np = {s = np.s ! P.False ! NCase Sg Nom} ;
|
UttAP np = {s = np.s ! P.False ! NCase Sg Nom} ;
|
||||||
UttCard n = {s = n.s ! Sg ! Nom} ;
|
UttCard n = {s = n.s ! Sg ! Nom} ;
|
||||||
UttInterj i = i ;
|
UttInterj i = i ;
|
||||||
@@ -23,6 +23,6 @@ concrete PhraseEst of Phrase = CatEst ** open ResEst, (P = Prelude) in {
|
|||||||
PConjConj conj = {s = conj.s2} ;
|
PConjConj conj = {s = conj.s2} ;
|
||||||
|
|
||||||
NoVoc = {s = []} ;
|
NoVoc = {s = []} ;
|
||||||
VocNP np = {s = "," ++ np.s ! NPCase Nom} ;
|
VocNP np = {s = "," ++ linNP (NPCase Nom) np} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,19 +5,14 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
QuestCl cl = {
|
QuestCl cl = {
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SQuest
|
s = \\t,a,p => "kas" ++ cl.s ! t ! a ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestVP ip vp =
|
QuestVP ip vp = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) vp.sc) (agrP3 ip.n) vp ;
|
||||||
let
|
|
||||||
cl = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) vp.sc) (agrP3 ip.n) vp
|
|
||||||
in {
|
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
|
||||||
} ;
|
|
||||||
|
|
||||||
QuestSlash ip slash = {
|
QuestSlash ip slash = {
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let
|
let
|
||||||
cls = slash.s ! t ! a ! p ;
|
cls = slash.s ! t ! a ! p ;
|
||||||
who = appCompl True p slash.c2 (ip ** {a = agrP3 ip.n ; isPron = False})
|
who = appCompl True p slash.c2 (ip ** {a = agrP3 ip.n ; isPron = False})
|
||||||
in
|
in
|
||||||
@@ -25,78 +20,72 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestIAdv iadv cl = {
|
QuestIAdv iadv cl = {
|
||||||
s = \\t,a,p => iadv.s ++ cl.s ! t ! a ! p ! SDecl
|
s = \\t,a,p => iadv.s ++ cl.s ! t ! a ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestIComp icomp np = {
|
QuestIComp icomp np = {
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let
|
let
|
||||||
vp = predV (verbOlema ** {sc = NPCase Nom}) ;
|
vp = predV (verbOlema ** {sc = NPCase Nom}) ;
|
||||||
cl = mkClause (subjForm np vp.sc) np.a vp ;
|
cl = mkClause (subjForm np vp.sc) np.a vp ;
|
||||||
in
|
in
|
||||||
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
|
icomp.s ! np.a ++ cl.s ! t ! a ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepIP p ip = {s =
|
PrepIP p ip = {s =
|
||||||
appCompl True Pos p (ip ** {a = agrP3 ip.n ; isPron = False})} ;
|
appCompl True Pos p (ip ** {a = agrP3 ip.n ; isPron = False})} ;
|
||||||
|
|
||||||
AdvIP ip adv = {
|
AdvIP ip adv = ip ** {
|
||||||
s = \\c => ip.s ! c ++ adv.s ;
|
postmod = ip.postmod ++ adv.s ;
|
||||||
n = ip.n
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- The computation of $ncase$ is a special case of that in $NounEst.DetCN$,
|
-- The computation of $IdetCN$ is a special case of that in $NounEst.DetCN$,
|
||||||
-- since we don't have possessive suffixes or definiteness.
|
-- because the interrogative doesn't agree.
|
||||||
--- It could still be nice to have a common oper...
|
|
||||||
|
|
||||||
IdetCN idet cn = let n = idet.n in {
|
IdetCN idet cn = emptyIP ** {
|
||||||
s = \\c =>
|
s = \\c =>
|
||||||
let
|
let
|
||||||
k : Case = npform2case n c ;
|
k : Case = npform2case n c ;
|
||||||
icase : Case = Nom ; --case k of { --mis kassiga
|
ncase : NForm = case <k,idet.isNum> of {
|
||||||
-- (Ess|Abess|Comit|Termin) => Gen ;
|
<Nom, True> => NCase Sg Part ; -- TODO estonian example (Fin was "mitkä kolme kytkintä")
|
||||||
-- _ => k
|
<_, True> => NCase Sg k ; -- TODO estonian example (Fin was "miksi kolmeksi kytkimeksi")
|
||||||
-- } ;
|
_ => NCase n k -- TODO estonian example (Fin was "mitkä kytkimet")
|
||||||
ncase : NForm = case <icase,idet.isNum> of {
|
|
||||||
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
|
|
||||||
<_, True> => NCase Sg k ; -- miksi kolmeksi kytkimeksi
|
|
||||||
_ => NCase n k -- mitkä kytkimet
|
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
idet.s ! icase ++ cn.s ! ncase ;
|
idet.s ! Nom ++ -- mis
|
||||||
n = n
|
idet.post ! k ++ -- kolme
|
||||||
} ;
|
cn.s ! ncase ; -- kassi+ga
|
||||||
|
n = idet.n ; -- needed for agreement, "mis kolm kassi mängivad"
|
||||||
|
} where {
|
||||||
|
n : Number = case idet.isNum of {
|
||||||
|
True => Sg ;
|
||||||
|
False => idet.n } ;
|
||||||
|
} ;
|
||||||
|
|
||||||
IdetIP idet = let n = idet.n in {
|
IdetIP idet = let n = idet.n in emptyIP ** {
|
||||||
s = \\c =>
|
s = \\c =>
|
||||||
let
|
let
|
||||||
k = npform2case n c ;
|
k = npform2case n c ;
|
||||||
in
|
in
|
||||||
idet.s ! k ;
|
case idet.isNum of {
|
||||||
|
True => idet.s ! Nom ++ idet.post ! k ;
|
||||||
|
False => idet.s ! k ++ idet.post ! k
|
||||||
|
} ;
|
||||||
|
|
||||||
n = n
|
n = n
|
||||||
} ;
|
} ;
|
||||||
|
-- The quant and the num may be inflected in different cases:
|
||||||
IdetQuant idet num =
|
-- * mis kolme koeraga, mis kolmega
|
||||||
let
|
-- * millega
|
||||||
n = num.n ;
|
-- * mille 3-ga (this would be the preferable output, but currently outputs "mis 3ga")
|
||||||
isn = num.isNum
|
IdetQuant idet num = num ** {
|
||||||
in {
|
s = \\c => idet.s ! num.n ! c ;
|
||||||
s = \\k =>
|
post = \\c => num.s ! Sg ! c ;
|
||||||
let
|
|
||||||
ncase = case <k,isn> of {
|
|
||||||
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
|
|
||||||
<_, True> => NCase Sg k ; -- miksi kolmeksi kytkimeksi
|
|
||||||
_ => NCase n k -- mitkä kytkimet
|
|
||||||
}
|
|
||||||
in
|
|
||||||
idet.s ! n ! k ++ num.s ! Sg ! k ;
|
|
||||||
n = n ;
|
|
||||||
isNum = isn
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvIAdv i a = {s = i.s ++ a.s} ;
|
AdvIAdv i a = {s = i.s ++ a.s} ;
|
||||||
|
|
||||||
CompIAdv a = {s = \\_ => a.s} ;
|
CompIAdv a = {s = \\_ => a.s} ;
|
||||||
CompIP ip = {s = \\_ => ip.s ! NPCase Nom} ;
|
CompIP ip = {s = \\_ => linIP (NPCase Nom) ip} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,38 +5,40 @@ concrete RelativeEst of Relative = CatEst ** open Prelude, ResEst, MorphoEst in
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
RelCl cl = {
|
RelCl cl = {
|
||||||
s = \\t,a,p,_ => "nii" ++ "et" ++ cl.s ! t ! a ! p ! SDecl ;
|
s = \\t,a,p,_ => "nii" ++ "et" ++ cl.s ! t ! a ! p ;
|
||||||
---- sellainen
|
---- sellainen
|
||||||
c = NPCase Nom
|
c = NPCase Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelVP rp vp = {
|
RelVP rp vp = {
|
||||||
s = \\t,ant,b,ag =>
|
s = \\t,ant,b,ag =>
|
||||||
let
|
let
|
||||||
agr = case rp.a of {
|
agr = case rp.a of {
|
||||||
RNoAg => ag ;
|
RNoAg => ag ;
|
||||||
RAg a => a
|
RAg a => a
|
||||||
} ;
|
} ;
|
||||||
cl = mkClause
|
cl = mkClause
|
||||||
(subjForm {s = rp.s ! (complNumAgr agr) ;
|
(subjForm
|
||||||
a = agr ; isPron = False} vp.sc) agr vp
|
(emptyNP ** {s = rp.s ! complNumAgr agr ; a = agr})
|
||||||
|
vp.sc)
|
||||||
|
agr vp
|
||||||
in
|
in
|
||||||
cl.s ! t ! ant ! b ! SDecl ;
|
cl.s ! t ! ant ! b ;
|
||||||
c = NPCase Nom
|
c = NPCase Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelSlash rp slash = {
|
RelSlash rp slash = {
|
||||||
s = \\t,a,p,ag =>
|
s = \\t,a,p,ag =>
|
||||||
let
|
let
|
||||||
cls = slash.s ! t ! a ! p ;
|
cls = slash.s ! t ! a ! p ;
|
||||||
who = appCompl True p slash.c2 (rp2np (complNumAgr ag) rp)
|
who = appCompl True p slash.c2 (rp2np (complNumAgr ag) rp)
|
||||||
in
|
in
|
||||||
who ++ cls ;
|
who ++ cls ;
|
||||||
c = slash.c2.c
|
c = slash.c2.c.npf
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
FunRP p np rp = {
|
FunRP p np rp = {
|
||||||
s = \\n,c => appCompl True Pos p (rp2np n rp) ++ np.s ! c ; --- is c OK?
|
s = \\n,c => appCompl True Pos p (rp2np n rp) ++ linNP c np ; --- is c OK?
|
||||||
a = RAg np.a
|
a = RAg np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,35 @@ resource ResEst = ParamX ** open Prelude in {
|
|||||||
-- This is the $Case$ as needed for both nouns and $NP$s.
|
-- This is the $Case$ as needed for both nouns and $NP$s.
|
||||||
|
|
||||||
param
|
param
|
||||||
Case = Nom | Gen | Part
|
Case = Nom | Gen | Part | Transl
|
||||||
| Illat | Iness | Elat | Allat | Adess | Ablat
|
| Illat | Iness | Elat | Allat | Adess | Ablat
|
||||||
| Transl | Ess | Termin | Abess | Comit;
|
;
|
||||||
|
NForm = NCase Number Case ;
|
||||||
|
|
||||||
NForm = NCase Number Case ;
|
oper
|
||||||
|
-- Reduce the Case parameter: many cases use the Genitive stem and just add suffix to it
|
||||||
|
CasePlus : Type = {
|
||||||
|
c : Case ; -- e.g. Gen
|
||||||
|
suf : Str -- e.g. "ga" for comitative
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Nominative = {c = Nom ; suf = []} ;
|
||||||
|
Genitive = {c = Gen ; suf = []} ;
|
||||||
|
Partitive = {c = Part ; suf = []} ;
|
||||||
|
Illative = {c = Illat ; suf = []} ;
|
||||||
|
Inessive = {c = Iness ; suf = []} ;
|
||||||
|
Elative = {c = Elat ; suf = []} ;
|
||||||
|
Allative = {c = Allat ; suf = []} ;
|
||||||
|
Adessive = {c = Adess ; suf = []} ;
|
||||||
|
Ablative = {c = Ablat ; suf = []} ;
|
||||||
|
Translative = {c = Transl ; suf = []} ;
|
||||||
|
Terminative = {c = Gen ; suf = BIND ++ "ni"} ;
|
||||||
|
Essive = {c = Gen ; suf = BIND ++ "na"} ;
|
||||||
|
Abessive = {c = Gen ; suf = BIND ++ "ta"} ;
|
||||||
|
Comitative = {c = Gen ; suf = BIND ++ "ga"} ;
|
||||||
|
|
||||||
|
param
|
||||||
-- Agreement of $NP$ has number*person and the polite second ("te olette valmis").
|
-- Agreement of $NP$ has number*person and the polite second ("te olette valmis").
|
||||||
|
|
||||||
|
|
||||||
Agr = Ag Number Person | AgPol ;
|
Agr = Ag Number Person | AgPol ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
@@ -38,8 +57,34 @@ resource ResEst = ParamX ** open Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
|
IPhrase : Type = {
|
||||||
|
s : NPForm => Str ; -- the noun phrase + premodifiers
|
||||||
|
postmod : Str ; -- adverb, RS, etc. other postmods
|
||||||
|
n : Number
|
||||||
|
} ;
|
||||||
|
|
||||||
|
NPhrase : Type = {
|
||||||
|
s : NPForm => Str ; -- the noun phrase + premodifiers
|
||||||
|
postmod : Str ; -- adverb, RS, etc. other postmods
|
||||||
|
a : Agr ;
|
||||||
|
isPron : Bool
|
||||||
|
} ;
|
||||||
|
|
||||||
|
emptyNP : NPhrase = {
|
||||||
|
s = \\_ => [] ;
|
||||||
|
postmod = [] ;
|
||||||
|
a = agrP3 Sg ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
emptyIP : IPhrase = {
|
||||||
|
s = \\_ => [] ;
|
||||||
|
postmod = [] ;
|
||||||
|
n = Sg ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
linNP : NPForm -> NPhrase -> Str = \npf,np -> np.s ! npf ++ np.postmod ;
|
||||||
|
linIP : NPForm -> IPhrase -> Str = \npf,ip -> ip.s ! npf ++ ip.postmod ;
|
||||||
--
|
--
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
--
|
--
|
||||||
@@ -52,20 +97,30 @@ param
|
|||||||
Infl = Regular | Participle | Invariable ;
|
Infl = Regular | Participle | Invariable ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Adjective : Type = {s : Degree => AForm => Str; lock_A : {}} ;
|
Adjective : Type = {s : Degree => AForm => Str} ;
|
||||||
|
|
||||||
|
APhrase : Type = {s : Bool => NForm => Str ; infl : Infl} ;
|
||||||
|
|
||||||
--2 Noun phrases
|
--2 Noun phrases
|
||||||
--
|
--
|
||||||
-- Two forms of *virtual accusative* are needed for nouns in singular,
|
-- Two forms of *virtual accusative* are needed for nouns in singular,
|
||||||
-- the nominative and the genitive one ("loen raamatu"/"loe raamat").
|
-- the nominative and the genitive one ("loen raamatu"/"loe raamat").
|
||||||
-- For nouns in plural, only a nominative accusative exists in positive clauses.
|
-- For nouns in plural, only a nominative accusative exists in positive clauses.
|
||||||
-- Pronouns use the partitive as their accusative form ("mind", "sind"), in both
|
-- Pronouns use the partitive as their accusative form ("mind", "sind"), in both
|
||||||
-- positive and negative, indicative and imperative clauses.
|
-- positive and negative, indicative and imperative clauses.
|
||||||
|
|
||||||
param
|
param
|
||||||
NPForm = NPCase Case | NPAcc ;
|
NPForm = NPCase Case | NPAcc ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
NPFormPlus : Type = {
|
||||||
|
npf : NPForm ; -- e.g. NPCase Gen
|
||||||
|
suf : Str -- e.g. "ga" for comitative
|
||||||
|
} ;
|
||||||
|
|
||||||
|
casep2npformp : CasePlus -> NPFormPlus = \cp -> cp ** {npf = NPCase cp.c} ;
|
||||||
|
case2npformp : NPForm -> NPFormPlus = \npf-> {npf = npf ; suf = []} ;
|
||||||
|
|
||||||
npform2case : Number -> NPForm -> Case = \n,f ->
|
npform2case : Number -> NPForm -> Case = \n,f ->
|
||||||
|
|
||||||
-- type signature: workaround for gfc bug 9/11/2007
|
-- type signature: workaround for gfc bug 9/11/2007
|
||||||
@@ -80,14 +135,14 @@ oper
|
|||||||
-- A special form is needed for the negated plural imperative.
|
-- A special form is needed for the negated plural imperative.
|
||||||
|
|
||||||
param
|
param
|
||||||
VForm =
|
VForm =
|
||||||
Inf InfForm
|
Inf InfStem
|
||||||
| Presn Number Person
|
| Presn Number Person
|
||||||
| Impf Number Person
|
| Impf Number Person
|
||||||
| Condit Number Person
|
| Condit Number Person
|
||||||
| ConditPass --loetagu
|
| ConditPass --loetagu
|
||||||
| Imper Number
|
| Imper Number
|
||||||
| ImperP3
|
| ImperP3
|
||||||
| ImperP1Pl
|
| ImperP1Pl
|
||||||
| ImperPass
|
| ImperPass
|
||||||
| PassPresn Bool
|
| PassPresn Bool
|
||||||
@@ -98,21 +153,35 @@ param
|
|||||||
;
|
;
|
||||||
|
|
||||||
Voice = Act | Pass ;
|
Voice = Act | Pass ;
|
||||||
|
|
||||||
InfForm =
|
InfStem =
|
||||||
InfDa -- lugeda
|
InfD -- luge+da/des, but can be irregular: tulla, tulles
|
||||||
| InfDes -- lugedes
|
| InfM -- lugema/mas/mast/maks/mata/mine
|
||||||
| InfMa -- lugema
|
|
||||||
| InfMas -- lugemas
|
|
||||||
| InfMast -- lugemast
|
|
||||||
| InfMata -- lugemata
|
|
||||||
| InfMaks -- lugemaks
|
|
||||||
;
|
;
|
||||||
|
oper
|
||||||
|
InfForms : Type = {stem : InfStem ; suf : Str} ;
|
||||||
|
|
||||||
SType = SDecl | SQuest | SInv ;
|
InfDa, InfDes, InfMa, InfMas, InfMast, InfMata, InfMaks, InfMine : InfForms ;
|
||||||
|
InfDa = {stem = InfD ; suf = "a"} ; -- lugeda
|
||||||
|
InfDes = {stem = InfD ; suf = "es"} ; -- lugedes
|
||||||
|
InfMa = {stem = InfM ; suf = "a"} ; -- lugema
|
||||||
|
InfMas = {stem = InfM ; suf = "as"} ; -- lugemas
|
||||||
|
InfMast = {stem = InfM ; suf = "ast"} ; -- lugemast
|
||||||
|
InfMata = {stem = InfM ; suf = "ata"} ; -- lugemata
|
||||||
|
InfMaks = {stem = InfM ; suf = "aks"} ; -- lugemaks
|
||||||
|
InfMine = {stem = InfM ; suf = "ine"} ; -- lugemine
|
||||||
|
|
||||||
|
applyInfFormsVP : InfForms -> VP -> {fin,inf : Str} = \if,vp ->
|
||||||
|
let vpforms : VPForms = mkVPForms vp.v ;
|
||||||
|
stemOnly : {fin,inf : Str} = vpforms ! VIInf if.stem ! Simul ! Pos ! agrP3 Sg ;
|
||||||
|
in stemOnly ** {fin = glue stemOnly.fin if.suf} ; -- Despite the name, the infinite form is in the "fin" field, "inf" contains participle
|
||||||
|
|
||||||
|
applyInfFormsV : InfForms -> (VForm => Str) -> Str = \if,vf ->
|
||||||
|
glue (vf ! Inf if.stem) if.suf ;
|
||||||
|
|
||||||
|
param
|
||||||
--2 For $Relative$
|
--2 For $Relative$
|
||||||
|
|
||||||
RAgr = RNoAg | RAg Agr ;
|
RAgr = RNoAg | RAg Agr ;
|
||||||
|
|
||||||
--2 For $Numeral$
|
--2 For $Numeral$
|
||||||
@@ -122,23 +191,27 @@ param
|
|||||||
--2 Transformations between parameter types
|
--2 Transformations between parameter types
|
||||||
|
|
||||||
oper
|
oper
|
||||||
agrP3 : Number -> Agr = \n ->
|
agrP3 : Number -> Agr = \n ->
|
||||||
Ag n P3 ;
|
Ag n P3 ;
|
||||||
|
|
||||||
conjAgr : Agr -> Agr -> Agr = \a,b -> case <a,b> of {
|
conjAgr : Agr -> Agr -> Agr = \a,b -> case <a,b> of {
|
||||||
<Ag n p, Ag m q> => Ag (conjNumber n m) (conjPerson p q) ;
|
<Ag n p, Ag m q> => Ag (conjNumber n m) (conjPerson p q) ;
|
||||||
<Ag n p, AgPol> => Ag Pl (conjPerson p P2) ;
|
<Ag n p, AgPol> => Ag Pl (conjPerson p P2) ;
|
||||||
<AgPol, Ag n p> => Ag Pl (conjPerson p P2) ;
|
<AgPol, Ag n p> => Ag Pl (conjPerson p P2) ;
|
||||||
_ => b
|
_ => b
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Compl : Type = {s : Str ; c : NPForm ; isPre : Bool} ;
|
Compl : Type = {s : Str ; c : NPFormPlus ; isPre : Bool} ;
|
||||||
|
|
||||||
appCompl : Bool -> Polarity -> Compl -> NP -> Str = \isFin,b,co,np ->
|
emptyCompl : Compl = {s = "" ; c = case2npformp NPAcc ; isPre = False} ;
|
||||||
|
|
||||||
|
npfplus2compl : NPFormPlus -> Compl = \npf -> {s = [] ; c = npf ; isPre = False} ;
|
||||||
|
|
||||||
|
appCompl : Bool -> Polarity -> Compl -> NPhrase -> Str = \isFin,b,co,np ->
|
||||||
let
|
let
|
||||||
c = case co.c of {
|
c = case co.c.npf of {
|
||||||
NPAcc => case b of {
|
NPAcc => case b of {
|
||||||
Neg => NPCase Part ; -- ma ei näe raamatut/sind
|
Neg => NPCase Part ; -- ma ei näe raamatut/sind
|
||||||
Pos => case isFin of {
|
Pos => case isFin of {
|
||||||
@@ -149,20 +222,18 @@ param
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
_ => co.c
|
_ => co.c.npf
|
||||||
} ;
|
} ;
|
||||||
{-
|
nps = np.s ! c ++ co.c.suf ; -- complement's NPFormPlus may include suffix for the cases based on Gen stem, e.g. comitative "ga"
|
||||||
c = case <isFin, b, co.c, np.isPron> of {
|
|
||||||
<_, Neg, NPAcc,_> => NPCase Part ; -- en näe taloa/sinua
|
|
||||||
<_, Pos, NPAcc,True> => NPAcc ; -- näen/täytyy sinut
|
|
||||||
<False,Pos, NPAcc,False> => NPCase Nom ; -- täytyy nähdä talo
|
|
||||||
<_,_,coc,_> => coc
|
|
||||||
} ;
|
|
||||||
-}
|
|
||||||
nps = np.s ! c
|
|
||||||
in
|
in
|
||||||
preOrPost co.isPre co.s nps ;
|
preOrPost co.isPre co.s nps ++ np.postmod ;
|
||||||
|
|
||||||
|
-- Used for passive; c2 of V2/VPSlash becomes sc of VP
|
||||||
|
compl2subjcase : Compl -> NPForm = \compl ->
|
||||||
|
case compl.c.npf of {
|
||||||
|
NPCase Gen => NPCase Nom ; -- valisin koera -> koer valitakse
|
||||||
|
_ => compl.c.npf -- rääkisin koerale -> koerale räägitakse
|
||||||
|
} ;
|
||||||
-- For $Verb$.
|
-- For $Verb$.
|
||||||
|
|
||||||
Verb : Type = {
|
Verb : Type = {
|
||||||
@@ -170,67 +241,89 @@ param
|
|||||||
p : Str -- particle verbs
|
p : Str -- particle verbs
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
Verb1 : Type = Verb ** {sc : NPForm} ; --subject case, i.e. "ma näen kassi"/"mul on kass"
|
||||||
|
Verb2 : Type = Verb1 ** {c2 : Compl} ;
|
||||||
|
Verb3 : Type = Verb2 ** {c3 : Compl} ;
|
||||||
|
|
||||||
|
linV2, linV : Verb -> Str = \v -> applyInfFormsV InfMa v.s ++ v.p ;
|
||||||
|
|
||||||
param
|
param
|
||||||
VIForm =
|
VIForm =
|
||||||
VIFin Tense
|
VIFin Tense
|
||||||
| VIInf InfForm
|
| VIInf InfStem
|
||||||
| VIPass Tense
|
| VIPass Tense
|
||||||
| VIPresPart
|
| VIPresPart
|
||||||
| VIImper
|
| VIImper
|
||||||
;
|
;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
VP : Type = {
|
VP : Type = {
|
||||||
s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
|
v : Verb ;
|
||||||
s2 : Bool => Polarity => Agr => Str ; -- raamat/raamatu/raamatut
|
s2 : Bool => Polarity => Agr => Str ; -- raamat/raamatu/raamatut
|
||||||
adv : Str ;
|
adv : Str ;
|
||||||
p : Str ; --uninflecting component in multi-word verbs
|
p : Str ; --uninflecting component in multi-word verbs
|
||||||
ext : Str ;
|
ext : Str ;
|
||||||
sc : NPForm ;
|
sc : NPForm ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
predV : (Verb ** {sc : NPForm}) -> VP = \verb -> {
|
|
||||||
s = \\vi,ant,b,agr0 =>
|
|
||||||
let
|
|
||||||
agr = verbAgr agr0 ;
|
|
||||||
verbs = verb.s ;
|
|
||||||
part : Str = case vi of {
|
|
||||||
VIPass _ => verbs ! (PastPart Pass) ;
|
|
||||||
_ => verbs ! (PastPart Act)
|
|
||||||
} ;
|
|
||||||
|
|
||||||
einegole : Str * Str * Str = case <vi,agr.n> of {
|
|
||||||
<VIFin Pres> => <"ei", verbs ! Imper Sg, "ole"> ;
|
|
||||||
<VIFin Fut> => <"ei", verbs ! Imper Sg, "ole"> ;
|
|
||||||
<VIFin Cond> => <"ei", verbs ! Condit Sg P3, "oleks"> ;
|
|
||||||
<VIFin Past> => <"ei", part, "olnud"> ;
|
|
||||||
<VIImper, Sg> => <"ära", verbs ! Imper Sg, "ole"> ;
|
|
||||||
<VIImper, Pl> => <"ärge", verbs ! Imper Pl, "olge"> ;
|
|
||||||
<VIPass Pres> => <"ei", verbs ! PassPresn False, "ole"> ;
|
|
||||||
<VIPass Fut> => <"ei", verbs ! PassPresn False, "ole"> ; --# notpresent
|
|
||||||
<VIPass Cond> => <"ei", verbs ! ConditPass, "oleks"> ; --# notpresent
|
|
||||||
<VIPass Past> => <"ei", verbs ! PassImpf False, "olnud"> ; --# notpresent
|
|
||||||
<VIPresPart> => <"ei", verbs ! PresPart Act, "olev"> ; --# notpresent
|
|
||||||
<VIInf i> => <"ei", verbs ! Inf i, verbOlema.s ! Inf i>
|
|
||||||
|
|
||||||
} ;
|
passiveVerb : Verb -> Verb = \verb -> verb ** {
|
||||||
|
s = table {
|
||||||
ei : Str = einegole.p1 ;
|
Presn _ _ => verb.s ! PassPresn True ;
|
||||||
neg : Str = einegole.p2 ;
|
Impf _ _ => verb.s ! PassImpf True ; --# notpresent
|
||||||
ole : Str = einegole.p3 ;
|
Condit _ _ => verb.s ! ConditPass ; --# notpresent
|
||||||
|
ImperP3 => verb.s ! ImperPass ;
|
||||||
olema : VForm => Str = verbOlema.s ;
|
Imper Sg => verb.s ! PassPresn False ; -- weird hack, because the Imper Sg field is used for negative form; if VP undergoes PassV*, then its negation should also be in passive.
|
||||||
|
PresPart _ => verb.s ! PresPart Pass ;
|
||||||
vf : Str -> Str -> {fin, inf : Str} = \x,y -> {fin = x ; inf = y} ;
|
PastPart _ => verb.s ! PastPart Pass ;
|
||||||
|
x => verb.s ! x }
|
||||||
mkvf : VForm -> {fin, inf : Str} = \p -> case <ant,b> of {
|
} ;
|
||||||
<Simul,Pos> => vf (verbs ! p) [] ;
|
|
||||||
<Anter,Pos> => vf (olema ! p) part ;
|
|
||||||
<Simul,Neg> => vf (ei ++ neg) [] ;
|
|
||||||
<Anter,Neg> => vf (ei ++ ole) part
|
|
||||||
} ;
|
|
||||||
|
|
||||||
passPol = case b of {Pos => True ; Neg => False} ;
|
-- NB. only chooses passive verb forms, to get subject case need compl2subjcase, used in PassV2
|
||||||
|
passiveVP : VP -> VP = \vp -> vp ** {v = passiveVerb vp.v} ;
|
||||||
|
|
||||||
|
VPForms : Type = VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
|
||||||
|
|
||||||
|
mkVPForms : Verb -> VPForms = \verb -> \\vi,ant,b,agr0 =>
|
||||||
|
let
|
||||||
|
agr = verbAgr agr0 ;
|
||||||
|
verbs = verb.s ;
|
||||||
|
part : Str = case vi of {
|
||||||
|
VIPass _ => verbs ! PastPart Pass ;
|
||||||
|
_ => verbs ! PastPart Act
|
||||||
|
} ;
|
||||||
|
|
||||||
|
einegole : Str * Str * Str = case <vi,agr.n> of {
|
||||||
|
<VIFin Pres> => <"ei", verbs ! Imper Sg, "ole"> ;
|
||||||
|
<VIFin Fut> => <"ei", verbs ! Imper Sg, "ole"> ;
|
||||||
|
<VIFin Cond> => <"ei", verbs ! Condit Sg P3, "oleks"> ;
|
||||||
|
<VIFin Past> => <"ei", part, "olnud"> ;
|
||||||
|
<VIImper, Sg> => <"ära", verbs ! Imper Sg, "ole"> ;
|
||||||
|
<VIImper, Pl> => <"ärge", verbs ! Imper Pl, "olge"> ;
|
||||||
|
<VIPass Pres> => <"ei", verbs ! PassPresn False, "ole"> ;
|
||||||
|
<VIPass Fut> => <"ei", verbs ! PassPresn False, "ole"> ; --# notpresent
|
||||||
|
<VIPass Cond> => <"ei", verbs ! ConditPass, "oleks"> ; --# notpresent
|
||||||
|
<VIPass Past> => <"ei", verbs ! PassImpf False, "olnud"> ; --# notpresent
|
||||||
|
<VIPresPart> => <"ei", verbs ! PresPart Act, "olev"> ; --# notpresent
|
||||||
|
<VIInf i> => <"ei", verbs ! Inf i, verbOlema.s ! Inf i>
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ei : Str = einegole.p1 ;
|
||||||
|
neg : Str = einegole.p2 ;
|
||||||
|
ole : Str = einegole.p3 ;
|
||||||
|
|
||||||
|
olema : VForm => Str = verbOlema.s ;
|
||||||
|
|
||||||
|
vf : Str -> Str -> {fin, inf : Str} = \x,y -> {fin = x ; inf = y} ;
|
||||||
|
|
||||||
|
mkvf : VForm -> {fin, inf : Str} = \p -> case <ant,b> of {
|
||||||
|
<Simul,Pos> => vf (verbs ! p) [] ;
|
||||||
|
<Anter,Pos> => vf (olema ! p) part ;
|
||||||
|
<Simul,Neg> => vf (ei ++ neg) [] ;
|
||||||
|
<Anter,Neg> => vf (ei ++ ole) part
|
||||||
|
} ;
|
||||||
|
|
||||||
|
passPol = case b of {Pos => True ; Neg => False} ;
|
||||||
|
|
||||||
in case vi of {
|
in case vi of {
|
||||||
VIFin Past => mkvf (Impf agr.n agr.p) ; --# notpresent
|
VIFin Past => mkvf (Impf agr.n agr.p) ; --# notpresent
|
||||||
@@ -246,99 +339,84 @@ oper
|
|||||||
VIInf i => mkvf (Inf i)
|
VIInf i => mkvf (Inf i)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
predV : Verb1 -> VP = \verb -> {
|
||||||
|
v = verb ; -- ignoring the subject case of Verb, it is stored in VP.sc later
|
||||||
s2 = \\_,_,_ => [] ;
|
s2 = \\_,_,_ => [] ;
|
||||||
adv = [] ;
|
adv = [] ;
|
||||||
ext = [] ; --relative clause
|
ext = [] ; --relative clause
|
||||||
p = verb.p ; --particle verbs
|
p = verb.p ; --particle verbs
|
||||||
sc = verb.sc
|
sc = verb.sc
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
|
insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
|
||||||
vp ** { s2 = \\fin,b,a => vp.s2 ! fin ! b ! a ++ obj ! fin ! b ! a } ;
|
vp ** { s2 = \\fin,b,a => vp.s2 ! fin ! b ! a ++ obj ! fin ! b ! a } ;
|
||||||
|
|
||||||
insertObjPre : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
|
insertObjPre : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
|
||||||
vp ** { s2 = \\fin,b,a => obj ! fin ! b ! a ++ vp.s2 ! fin ! b ! a } ;
|
vp ** { s2 = \\fin,b,a => obj ! fin ! b ! a ++ vp.s2 ! fin ! b ! a } ;
|
||||||
|
|
||||||
insertAdv : Str -> VP -> VP = \adv,vp ->
|
insertAdv : Str -> VP -> VP = \adv,vp ->
|
||||||
vp ** { adv = vp.adv ++ adv } ;
|
vp ** { adv = vp.adv ++ adv } ;
|
||||||
|
|
||||||
insertExtrapos : Str -> VP -> VP = \obj,vp ->
|
insertExtrapos : Str -> VP -> VP = \obj,vp ->
|
||||||
vp ** { ext = vp.ext ++ obj } ;
|
vp ** { ext = vp.ext ++ obj } ;
|
||||||
|
|
||||||
-- For $Sentence$.
|
-- For $Sentence$.
|
||||||
|
|
||||||
Clause : Type = {
|
Clause : Type = {
|
||||||
s : Tense => Anteriority => Polarity => SType => Str
|
s : Tense => Anteriority => Polarity => Str
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ClausePlus : Type = {
|
ClausePlus : Type = {
|
||||||
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,adv,p,ext : Str}
|
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,adv,p,ext : Str}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- The Finnish version of SQuest featured a word order change and
|
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
||||||
-- the question particle "ko". The Estonian version just prefixes the
|
{ s = \\t,a,b =>
|
||||||
-- declarative sentence with the yes/no-queryword "kas".
|
|
||||||
-- SQuest: "kas" + SDecl
|
|
||||||
-- It would be also correct to use the Finnish structure, just without the ko-particle.
|
|
||||||
-- Inari: added a third SType, SInv.
|
|
||||||
-- Not sure if SInv is needed, but keeping it for possible future use.
|
|
||||||
-- There's need for an inverted word order with auxiliary verbs; infVP handles that. ComplVV calls infVP, which inverts the word order for the complement VP, and puts it into the resulting VP's `compl' field.
|
|
||||||
-- SInv made by mkClause would be for cases where you just need to construct an inverted word order, and then call it from some other place; application grammar (TODO: api oper for SType) or ExtraEst.
|
|
||||||
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
|
||||||
{ s = \\t,a,b =>
|
|
||||||
let
|
let
|
||||||
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
||||||
-- saan sinust aru 0
|
in
|
||||||
-- ma olen täna sinust aru saanud
|
-- saan sinust aru
|
||||||
declCl = c.subj ++ c.fin ++ c.adv ++ c.compl ++ c.p ++ c.inf ++ c.ext ;
|
-- ma olen täna sinust aru saanud
|
||||||
-- [sind näha] 0 tahtnud
|
c.subj ++ c.fin ++ c.adv ++ c.compl ++ c.p ++ c.inf ++ c.ext ;
|
||||||
-- täna olen ma sinust aru saanud
|
} ;
|
||||||
invCl = c.adv ++ c.fin ++ c.subj ++ c.compl ++ c.p ++ c.inf ++ c.ext
|
|
||||||
in
|
|
||||||
table {
|
|
||||||
SDecl => declCl ;
|
|
||||||
SQuest => "kas" ++ declCl ;
|
|
||||||
SInv => invCl
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
existClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
existClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
|
||||||
{ s = \\t,a,b =>
|
{ s = \\t,a,b =>
|
||||||
let
|
let
|
||||||
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
|
||||||
-- (mis) on olnud olemas (lammas)
|
in
|
||||||
declCl = c.subj ++ c.fin ++ c.inf ++ c.compl ;
|
-- c.subj ++ c.fin ++ c.inf ++ c.compl ;
|
||||||
in
|
-- saan sinust aru
|
||||||
table {
|
-- ma olen täna sinust aru saanud
|
||||||
SQuest => "kas" ++ declCl ;
|
-- (mis) on olnud täna olemas …
|
||||||
_ => declCl
|
c.subj ++ c.fin ++ c.inf ++ c.adv ++ c.p ++ c.compl ++ c.ext ;
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkClausePlus : (Polarity -> Str) -> Agr -> VP -> ClausePlus =
|
mkClausePlus : (Polarity -> Str) -> Agr -> VP -> ClausePlus =
|
||||||
\sub,agr,vp -> {
|
\sub,agr,vp -> {
|
||||||
s = \\t,a,b =>
|
s = \\t,a,b =>
|
||||||
let
|
let
|
||||||
agrfin = case vp.sc of {
|
agrfin = case vp.sc of {
|
||||||
NPCase Nom => <agr,True> ;
|
NPCase Nom => <agr,True> ;
|
||||||
_ => <agrP3 Sg,False> -- minule meeldib, minul on
|
_ => <agrP3 Sg,False> -- minule meeldib, minul on
|
||||||
} ;
|
} ;
|
||||||
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
verb = mkVPForms vp.v ! VIFin t ! a ! b ! agrfin.p1 ;
|
||||||
in {subj = sub b ;
|
in {subj = sub b ;
|
||||||
fin = verb.fin ;
|
fin = verb.fin ;
|
||||||
inf = verb.inf ;
|
inf = verb.inf ;
|
||||||
compl = vp.s2 ! agrfin.p2 ! b ! agr ;
|
compl = vp.s2 ! agrfin.p2 ! b ! agr ;
|
||||||
p = vp.p ;
|
p = vp.p ;
|
||||||
adv = vp.adv ;
|
adv = vp.adv ;
|
||||||
ext = vp.ext ;
|
ext = vp.ext ;
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
insertKinClausePlus : Predef.Ints 1 -> ClausePlus -> ClausePlus = \p,cl -> {
|
insertKinClausePlus : Predef.Ints 1 -> ClausePlus -> ClausePlus = \p,cl -> {
|
||||||
s = \\t,a,b =>
|
s = \\t,a,b =>
|
||||||
let
|
let
|
||||||
c = cl.s ! t ! a ! b
|
c = cl.s ! t ! a ! b
|
||||||
in
|
in
|
||||||
case p of {
|
case p of {
|
||||||
0 => {subj = c.subj ++ gi ; fin = c.fin ; inf = c.inf ; -- Jussikin nukkuu
|
0 => {subj = c.subj ++ gi ; fin = c.fin ; inf = c.inf ; -- Jussikin nukkuu
|
||||||
@@ -348,43 +426,44 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertObjClausePlus : Predef.Ints 1 -> Bool -> (Polarity => Str) -> ClausePlus -> ClausePlus =
|
insertObjClausePlus : Predef.Ints 1 -> Bool -> (Polarity => Str) -> ClausePlus -> ClausePlus =
|
||||||
\p,ifKin,obj,cl -> {
|
\p,ifKin,obj,cl -> {
|
||||||
s = \\t,a,b =>
|
s = \\t,a,b =>
|
||||||
let
|
let
|
||||||
c = cl.s ! t ! a ! b ;
|
c = cl.s ! t ! a ! b ;
|
||||||
co = obj ! b ++ if_then_Str ifKin (kin b) [] ;
|
co = obj ! b ++ if_then_Str ifKin (kin b) [] ;
|
||||||
in case p of {
|
in case p of {
|
||||||
0 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
|
0 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
|
||||||
compl = co ; p = c.p ; adv = c.compl ++ c.adv ; ext = c.ext ; h = c.h} ; -- Jussi juo maitoakin
|
compl = co ; p = c.p ; adv = c.compl ++ c.adv ; ext = c.ext ; h = c.h} ; -- Jussi juo maitoakin
|
||||||
1 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
|
1 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
|
||||||
compl = c.compl ; p = c.p ; adv = co ; ext = c.adv ++ c.ext ; h = c.h} -- Jussi nukkuu nytkin
|
compl = c.compl ; p = c.p ; adv = co ; ext = c.adv ++ c.ext ; h = c.h} -- Jussi nukkuu nytkin
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
kin : Polarity -> Str =
|
kin : Polarity -> Str =
|
||||||
\p -> case p of {Pos => "gi" ; Neg => "gi"} ;
|
\p -> case p of {Pos => "gi" ; Neg => "gi"} ;
|
||||||
|
|
||||||
--allomorph "ki", depends only on phonetic rules "üks+ki", "ühe+gi"
|
--allomorph "ki", depends only on phonetic rules "üks+ki", "ühe+gi"
|
||||||
--waiting for post construction in GF :P
|
--waiting for post construction in GF :P
|
||||||
gi : Str = "gi" ;
|
gi : Str = "gi" ;
|
||||||
|
|
||||||
-- This is used for subjects of passives: therefore isFin in False.
|
-- This is used for subjects of passives: therefore isFin in False.
|
||||||
|
|
||||||
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
|
subjForm : NPhrase -> NPForm -> Polarity -> Str = \np,sc,b ->
|
||||||
appCompl False b {s = [] ; c = sc ; isPre = True} np ;
|
appCompl False b {s = [] ; c = case2npformp sc ; isPre = True} np ;
|
||||||
|
|
||||||
infVP : NPForm -> Polarity -> Agr -> VP -> InfForm -> Str = infVPAnt Simul ;
|
infVP : NPForm -> Polarity -> Agr -> VP -> InfForms -> Str = infVPAnt Simul ;
|
||||||
|
|
||||||
infVPAnt : Anteriority -> NPForm -> Polarity -> Agr -> VP -> InfForm -> Str =
|
infVPAnt : Anteriority -> NPForm -> Polarity -> Agr -> VP -> InfForms -> Str =
|
||||||
\ant,sc,pol,agr,vp,vi ->
|
\ant,sc,pol,agr,vp,vi ->
|
||||||
let
|
let
|
||||||
fin = case sc of { -- subject case
|
complCase = case sc of { -- choosing case for the complement. sometimes this function is called so that sc is the VP's subject case, but other times it's some other form.
|
||||||
NPCase Nom => True ; -- mina tahan joosta
|
NPCase Nom => True ;
|
||||||
_ => False -- minul peab auto olema
|
_ => False
|
||||||
} ;
|
} ;
|
||||||
verb = vp.s ! VIInf vi ! ant ! Pos ! agr ; -- no "ei"
|
verbStem = mkVPForms vp.v ! VIInf vi.stem ! ant ! Pos ! agr ; -- no "ei"
|
||||||
compl = vp.s2 ! fin ! pol ! agr ; -- but compl. case propagated
|
verb = verbStem ** {fin = glue verbStem.fin vi.suf} ;
|
||||||
|
compl = vp.s2 ! complCase ! pol ! agr ; -- but compl. case propagated
|
||||||
adv = vp.adv
|
adv = vp.adv
|
||||||
in
|
in
|
||||||
-- inverted word order; e.g.
|
-- inverted word order; e.g.
|
||||||
@@ -393,12 +472,12 @@ oper
|
|||||||
--TODO adv placement?
|
--TODO adv placement?
|
||||||
--TODO inf ++ fin or fin ++ inf? does it ever become a case here?
|
--TODO inf ++ fin or fin ++ inf? does it ever become a case here?
|
||||||
|
|
||||||
-- The definitions below were moved here from $MorphoEst$ so that
|
-- The definitions below were moved here from $MorphoEst$ so that
|
||||||
-- auxiliary of predication can be defined.
|
-- auxiliary of predication can be defined.
|
||||||
|
|
||||||
verbOlema : Verb =
|
verbOlema : Verb =
|
||||||
let olema = mkVerb
|
let olema = mkVerb
|
||||||
"olema" "olla" "olen" "ollakse"
|
"olema" "olla" "olen" "ollakse"
|
||||||
"olge" "oli" "olnud" "oldud"
|
"olge" "oli" "olnud" "oldud"
|
||||||
in {s = table {
|
in {s = table {
|
||||||
Presn _ P3 => "on" ;
|
Presn _ P3 => "on" ;
|
||||||
@@ -407,9 +486,9 @@ oper
|
|||||||
p = []
|
p = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
verbMinema : Verb =
|
verbMinema : Verb =
|
||||||
let minema = mkVerb
|
let minema = mkVerb
|
||||||
"minema" "minna" "läheb" "minnakse"
|
"minema" "minna" "läheb" "minnakse"
|
||||||
"minge" "läks" "läinud" "mindud"
|
"minge" "läks" "läinud" "mindud"
|
||||||
in {s = table {
|
in {s = table {
|
||||||
Impf Sg P1 => "läksin" ;
|
Impf Sg P1 => "läksin" ;
|
||||||
@@ -422,20 +501,17 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
p = []
|
p = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--3 Verbs
|
--3 Verbs
|
||||||
|
|
||||||
--Auxiliary for internal use
|
--Auxiliary for internal use
|
||||||
mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> Verb =
|
mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> Verb =
|
||||||
\tulema,tulla,tuleb,tullakse,tulge,tuli,tulnud,tuldud ->
|
\tulema,tulla,tuleb,tullakse,tulge,tuli,tulnud,tuldud ->
|
||||||
vforms2V (vForms8
|
vforms2verb (vForms8 tulema tulla tuleb tullakse tulge tuli tulnud tuldud) ;
|
||||||
tulema tulla tuleb tullakse tulge tuli tulnud tuldud
|
|
||||||
) ;
|
|
||||||
|
|
||||||
--below moved here from MorphoEst
|
|
||||||
VForms : Type = Predef.Ints 7 => Str ;
|
VForms : Type = Predef.Ints 7 => Str ;
|
||||||
|
|
||||||
vForms8 : (x1,_,_,_,_,_,_,x8 : Str) -> VForms =
|
vForms8 : (x1,_,_,_,_,_,_,x8 : Str) -> VForms =
|
||||||
\tulema,tulla,tuleb,tullakse,tulge,tuli,tulnud,tuldud ->
|
\tulema,tulla,tuleb,tullakse,tulge,tuli,tulnud,tuldud ->
|
||||||
table {
|
table {
|
||||||
@@ -449,40 +525,40 @@ oper
|
|||||||
7 => tuldud
|
7 => tuldud
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
vforms2V : VForms -> Verb = \vh ->
|
vforms2verb : VForms -> Verb = \vh ->
|
||||||
let
|
let
|
||||||
tulema = vh ! 0 ;
|
tulema = vh ! 0 ;
|
||||||
tulla = vh ! 1 ;
|
tulla = vh ! 1 ;
|
||||||
tuleb = vh ! 2 ;
|
tuleb = vh ! 2 ;
|
||||||
tullakse = vh ! 3 ; --juuakse; loetakse
|
tullakse = vh ! 3 ; --juuakse; loetakse
|
||||||
tulge = vh ! 4 ; --necessary for tulla, surra (otherwise *tulege, *surege)
|
tulge = vh ! 4 ; --necessary for tulla, surra (otherwise *tulege, *surege)
|
||||||
tuli = vh ! 5 ; --necessary for jooma-juua-jõi
|
tuli = vh ! 5 ; --necessary for jooma-juua-jõi
|
||||||
tulnud = vh ! 6 ;
|
tulnud = vh ! 6 ;
|
||||||
tuldud = vh ! 7 ; --necessary for t/d in tuldi; loeti
|
tuldud = vh ! 7 ; --necessary for t/d in tuldi; loeti
|
||||||
|
|
||||||
tull_ = init tulla ; --juu(a); saad(a); tull(a);
|
tull_ = init tulla ; --juu(a); saad(a); tull(a);
|
||||||
tulles = tull_ + "es" ; --juues; saades; tulles;
|
tulles = tull_ + "es" ; --juues; saades; tulles;
|
||||||
|
|
||||||
tule_ = init tuleb ;
|
tule_ = init tuleb ;
|
||||||
|
|
||||||
lask_ = Predef.tk 2 tulema ;
|
lask_ = Predef.tk 2 tulema ;
|
||||||
laulev = case (last lask_) of { --sooma~soov ; laulma~laulev
|
laulev = case (last lask_) of { --sooma~soov ; laulma~laulev
|
||||||
("a"|"e"|"i"|"o"|"u"|"õ"|"ä"|"ö"|"ü") => lask_ + "v" ;
|
("a"|"e"|"i"|"o"|"u"|"õ"|"ä"|"ö"|"ü") => lask_ + "v" ;
|
||||||
_ => lask_ + "ev" } ; --consonant stem in -ma, add e
|
_ => lask_ + "ev" } ; --consonant stem in -ma, add e
|
||||||
|
|
||||||
--imperfect stem
|
--imperfect stem
|
||||||
kaisi_ = case (Predef.dp 3 tuli) of {
|
kaisi_ = case (Predef.dp 3 tuli) of {
|
||||||
"sis" => lask_ + "i" ; --tõusin, tõusis
|
"sis" => lask_ + "i" ; --tõusin, tõusis
|
||||||
_ + "i" => tuli ; --jõin, jõi
|
_ + "i" => tuli ; --jõin, jõi
|
||||||
_ => lask_ + "si" --käisin, käis; muutsin, muutis
|
_ => lask_ + "si" --käisin, käis; muutsin, muutis
|
||||||
};
|
};
|
||||||
|
|
||||||
tuld_ = Predef.tk 2 tuldud ; --d/t choice for tuldi etc.
|
tuld_ = Predef.tk 2 tuldud ; --d/t choice for tuldi etc.
|
||||||
tulgu = (init tulge) + "u" ;
|
tulgu = (init tulge) + "u" ;
|
||||||
in
|
in
|
||||||
{s = table {
|
{s = table {
|
||||||
Inf InfDa => tulla ;
|
Inf InfD => tull_ ;
|
||||||
Inf InfDes => tulles ;
|
Inf InfM => init tulema ;
|
||||||
Presn Sg P1 => tule_ + "n" ;
|
Presn Sg P1 => tule_ + "n" ;
|
||||||
Presn Sg P2 => tule_ + "d" ;
|
Presn Sg P2 => tule_ + "d" ;
|
||||||
Presn Sg P3 => tuleb ;
|
Presn Sg P3 => tuleb ;
|
||||||
@@ -504,27 +580,22 @@ oper
|
|||||||
ConditPass => tuld_ + "aks" ; --# notpresent
|
ConditPass => tuld_ + "aks" ; --# notpresent
|
||||||
Imper Sg => tule_ ; -- tule / ära tule
|
Imper Sg => tule_ ; -- tule / ära tule
|
||||||
Imper Pl => tulge ; -- tulge / ärge tulge
|
Imper Pl => tulge ; -- tulge / ärge tulge
|
||||||
ImperP3 => tulgu ; -- tulgu (ta/nad)
|
ImperP3 => tulgu ; -- tulgu (ta/nad)
|
||||||
ImperP1Pl => tulge + "m" ; -- tulgem
|
ImperP1Pl => tulge + "m" ; -- tulgem
|
||||||
ImperPass => tuld_ + "agu" ; --tuldagu
|
ImperPass => tuld_ + "agu" ; --tuldagu
|
||||||
PassPresn True => tullakse ;
|
PassPresn True => tullakse ;
|
||||||
PassPresn False => tuld_ + "a" ; --da or ta
|
PassPresn False => tuld_ + "a" ; --da or ta
|
||||||
PassImpf True => tuld_ + "i" ; --di or ti
|
PassImpf True => tuld_ + "i" ; --di or ti
|
||||||
PassImpf False => tuldud ;
|
PassImpf False => tuldud ;
|
||||||
Quotative Act => lask_ + "vat" ;
|
Quotative Act => lask_ + "vat" ;
|
||||||
Quotative Pass => tuld_ + "avat" ; --d or t
|
Quotative Pass => tuld_ + "avat" ; --d or t
|
||||||
PresPart Act => laulev ;
|
PresPart Act => laulev ;
|
||||||
PresPart Pass => tuld_ + "av" ; --d or t
|
PresPart Pass => tuld_ + "av" ; --d or t
|
||||||
PastPart Act => tulnud ;
|
PastPart Act => tulnud ;
|
||||||
PastPart Pass => tuldud ;
|
PastPart Pass => tuldud
|
||||||
Inf InfMa => tulema ;
|
|
||||||
Inf InfMas => tulema + "s" ;
|
|
||||||
Inf InfMast => tulema + "st" ;
|
|
||||||
Inf InfMata => tulema + "ta" ;
|
|
||||||
Inf InfMaks => tulema + "ks"
|
|
||||||
} ;
|
} ;
|
||||||
sc = NPCase Nom ;
|
sc = NPCase Nom ;
|
||||||
p = []
|
p = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- For regular verbs, paradigm from 4 base forms
|
-- For regular verbs, paradigm from 4 base forms
|
||||||
@@ -541,12 +612,12 @@ oper
|
|||||||
"t" => "k" ;
|
"t" => "k" ;
|
||||||
_ => "g"
|
_ => "g"
|
||||||
} ;
|
} ;
|
||||||
toit_ = case (last vestle_) of {
|
toit_ = case (last vestle_) of {
|
||||||
("t"|"d") => vesteld_ ; --toit(ma) -> toitke;
|
("t"|"d") => vesteld_ ; --toit(ma) -> toitke;
|
||||||
_ => vestel_ --vestle(ma) -> vestelge
|
_ => vestel_ --vestle(ma) -> vestelge
|
||||||
} ;
|
} ;
|
||||||
laski_ = case (last vestle_) of {
|
laski_ = case (last vestle_) of {
|
||||||
("a"|"e"|"i"|"o"|"u"|"õ"|"ä"|"ö"|"ü")
|
("a"|"e"|"i"|"o"|"u"|"õ"|"ä"|"ö"|"ü")
|
||||||
=> vestle_ ; --vestle(ma) -> vestles
|
=> vestle_ ; --vestle(ma) -> vestles
|
||||||
_ => vestle_ + "i" --lask(ma) -> laskis
|
_ => vestle_ + "i" --lask(ma) -> laskis
|
||||||
} ;
|
} ;
|
||||||
@@ -560,10 +631,10 @@ oper
|
|||||||
(laski_ + "s") --ma: kindla kõneviisi lihtmineviku pöörded;
|
(laski_ + "s") --ma: kindla kõneviisi lihtmineviku pöörded;
|
||||||
(toit_ + "nud") --da: isikulise tegumoe mineviku kesksõna
|
(toit_ + "nud") --da: isikulise tegumoe mineviku kesksõna
|
||||||
(jaet_ + "ud"); --takse: ülejäänud umbisikulise tgm vormid
|
(jaet_ + "ud"); --takse: ülejäänud umbisikulise tgm vormid
|
||||||
|
|
||||||
|
|
||||||
regVerb : (_,_,_,_ : Str) -> Verb = \kinkima,kinkida,kingib,kingitakse ->
|
regVerb : (_,_,_,_ : Str) -> Verb = \kinkima,kinkida,kingib,kingitakse ->
|
||||||
vforms2V (regVForms kinkima kinkida kingib kingitakse) ;
|
vforms2verb (regVForms kinkima kinkida kingib kingitakse) ;
|
||||||
|
|
||||||
|
|
||||||
noun2adj : Noun -> Adj = noun2adjComp True ;
|
noun2adj : Noun -> Adj = noun2adjComp True ;
|
||||||
@@ -574,8 +645,8 @@ oper
|
|||||||
-- parem -> paremini
|
-- parem -> paremini
|
||||||
-- parim -> kõige paremini | parimalt?
|
-- parim -> kõige paremini | parimalt?
|
||||||
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"
|
||||||
in {s = table {
|
in {s = table {
|
||||||
AN f => tuore.s ! f ;
|
AN f => tuore.s ! f ;
|
||||||
@@ -584,8 +655,16 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Noun = {s : NForm => Str} ;
|
Noun : Type = {s : NForm => Str} ;
|
||||||
|
|
||||||
|
CNoun : Type = Noun ** {postmod : Str} ;
|
||||||
|
|
||||||
|
emptyCN : CNoun = {
|
||||||
|
s = \\nf => [] ;
|
||||||
|
postmod = []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
linCN : NForm -> CNoun -> Str = \nf,cn -> cn.s ! nf ++ cn.postmod ;
|
||||||
|
|
||||||
-- 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.
|
||||||
@@ -596,26 +675,26 @@ oper
|
|||||||
compAP = icompAP [] ;
|
compAP = icompAP [] ;
|
||||||
|
|
||||||
icompAP : Str -> {s : Bool => NForm => Str} -> {s : Agr => Str} = \kui,ap ->
|
icompAP : Str -> {s : Bool => NForm => Str} -> {s : Agr => Str} = \kui,ap ->
|
||||||
{ s = \\agr =>
|
{ s = \\agr =>
|
||||||
let n = complNumAgr agr ;
|
let n = complNumAgr agr ;
|
||||||
in kui ++ ap.s ! False ! NCase n Nom } ;
|
in kui ++ ap.s ! False ! NCase n Nom } ;
|
||||||
|
|
||||||
compCN : Noun -> {s : Agr => Str} = \cn ->
|
compCN : Noun -> {s : Agr => Str} = \cn ->
|
||||||
{ s = \\agr =>
|
{ s = \\agr =>
|
||||||
let n = complNumAgr agr ;
|
let n = complNumAgr agr ;
|
||||||
in cn.s ! NCase n Nom } ;
|
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$.
|
||||||
|
|
||||||
reflPron : Agr -> NP = \agr ->
|
reflPron : Agr -> NPhrase = \agr ->
|
||||||
let
|
let
|
||||||
ise = nForms2N (nForms6 "ise" "enda" "ennast" "endasse" "endi" "endid") ;
|
ise = nForms2N (nForms6 "ise" "enda" "ennast" "endasse" "endi" "endid") ;
|
||||||
n = case agr of {
|
n = case agr of {
|
||||||
AgPol => Sg ;
|
AgPol => Sg ;
|
||||||
Ag n _ => n } ;
|
Ag n _ => n } ;
|
||||||
in {
|
in emptyNP ** {
|
||||||
s = table {
|
s = table {
|
||||||
NPAcc => "ennast" ;
|
NPAcc => "ennast" ;
|
||||||
NPCase c => fixPlNom "endid" ise.s ! NCase n c
|
NPCase c => fixPlNom "endid" ise.s ! NCase n c
|
||||||
@@ -632,7 +711,7 @@ oper
|
|||||||
|
|
||||||
NForms : Type = Predef.Ints 5 => Str ;
|
NForms : Type = Predef.Ints 5 => Str ;
|
||||||
|
|
||||||
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms =
|
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms =
|
||||||
\jogi,joe,joge,joesse, -- sg nom, gen, part, ill
|
\jogi,joe,joge,joesse, -- sg nom, gen, part, ill
|
||||||
jogede,jogesid -> table { -- pl gen, part,
|
jogede,jogesid -> table { -- pl gen, part,
|
||||||
0 => jogi ;
|
0 => jogi ;
|
||||||
@@ -640,7 +719,7 @@ oper
|
|||||||
2 => joge ;
|
2 => joge ;
|
||||||
3 => joesse ;
|
3 => joesse ;
|
||||||
4 => jogede ;
|
4 => jogede ;
|
||||||
5 => jogesid
|
5 => jogesid
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
n2nforms : Noun -> NForms = \ukko -> table {
|
n2nforms : Noun -> NForms = \ukko -> table {
|
||||||
@@ -649,12 +728,12 @@ oper
|
|||||||
2 => ukko.s ! NCase Sg Part ;
|
2 => ukko.s ! NCase Sg Part ;
|
||||||
3 => ukko.s ! NCase Sg Illat ;
|
3 => ukko.s ! NCase Sg Illat ;
|
||||||
4 => ukko.s ! NCase Pl Gen ;
|
4 => ukko.s ! NCase Pl Gen ;
|
||||||
5 => ukko.s ! NCase Pl Part
|
5 => ukko.s ! NCase Pl Part
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- 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 -> Noun = \f ->
|
nForms2N : NForms -> Noun = \f ->
|
||||||
let
|
let
|
||||||
jogi = f ! 0 ;
|
jogi = f ! 0 ;
|
||||||
joe = f ! 1 ;
|
joe = f ! 1 ;
|
||||||
@@ -662,44 +741,39 @@ oper
|
|||||||
joesse = f ! 3 ;
|
joesse = f ! 3 ;
|
||||||
jogede = f ! 4 ;
|
jogede = f ! 4 ;
|
||||||
jogesid = f ! 5 ;
|
jogesid = f ! 5 ;
|
||||||
in
|
in
|
||||||
{s = table {
|
{s = table {
|
||||||
NCase Sg Nom => jogi ;
|
NCase Sg Nom => jogi ;
|
||||||
NCase Sg Gen => joe ;
|
NCase Sg Gen => joe ;
|
||||||
NCase Sg Part => joge ;
|
NCase Sg Part => joge ;
|
||||||
NCase Sg Transl => joe + "ks" ;
|
NCase Sg Transl => joe + "ks" ;
|
||||||
NCase Sg Ess => joe + "na" ;
|
|
||||||
NCase Sg Iness => joe + "s" ;
|
NCase Sg Iness => joe + "s" ;
|
||||||
NCase Sg Elat => joe + "st" ;
|
NCase Sg Elat => joe + "st" ;
|
||||||
NCase Sg Illat => joesse ;
|
NCase Sg Illat => joesse ;
|
||||||
NCase Sg Adess => joe + "l" ;
|
NCase Sg Adess => joe + "l" ;
|
||||||
NCase Sg Ablat => joe + "lt" ;
|
NCase Sg Ablat => joe + "lt" ;
|
||||||
NCase Sg Allat => joe + "le" ;
|
NCase Sg Allat => joe + "le" ;
|
||||||
NCase Sg Abess => joe + "ta" ;
|
|
||||||
NCase Sg Comit => joe + "ga" ;
|
|
||||||
NCase Sg Termin => joe + "ni" ;
|
|
||||||
|
|
||||||
NCase Pl Nom => joe + "d" ;
|
NCase Pl Nom => joe + "d" ;
|
||||||
NCase Pl Gen => jogede ;
|
NCase Pl Gen => jogede ;
|
||||||
NCase Pl Part => jogesid ;
|
NCase Pl Part => jogesid ;
|
||||||
NCase Pl Transl => jogede + "ks" ;
|
NCase Pl Transl => jogede + "ks" ;
|
||||||
NCase Pl Ess => jogede + "na" ;
|
|
||||||
NCase Pl Iness => jogede + "s" ;
|
NCase Pl Iness => jogede + "s" ;
|
||||||
NCase Pl Elat => jogede + "st" ;
|
NCase Pl Elat => jogede + "st" ;
|
||||||
NCase Pl Illat => jogede + "sse" ;
|
NCase Pl Illat => jogede + "sse" ;
|
||||||
NCase Pl Adess => jogede + "l" ;
|
NCase Pl Adess => jogede + "l" ;
|
||||||
NCase Pl Ablat => jogede + "lt" ;
|
NCase Pl Ablat => jogede + "lt" ;
|
||||||
NCase Pl Allat => jogede + "le" ;
|
NCase Pl Allat => jogede + "le"
|
||||||
NCase Pl Abess => jogede + "ta" ;
|
|
||||||
NCase Pl Comit => jogede + "ga" ;
|
|
||||||
NCase Pl Termin => jogede + "ni"
|
|
||||||
|
|
||||||
} --;
|
}
|
||||||
-- lock_N = <>
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
rp2np : Number -> {s : Number => NPForm => Str ; a : RAgr} -> NP = \n,rp -> {
|
-- Technically, we could also add a postmod field for RP,
|
||||||
|
-- because multiple applications of FunRP add multiple complements.
|
||||||
|
-- But I will only add it if I see a real-world sentence that uses multiple applications of FunRP.
|
||||||
|
RelPron : Type = {s : Number => NPForm => Str ; a : RAgr} ;
|
||||||
|
rp2np : Number -> RelPron -> NPhrase = \n,rp -> emptyNP ** {
|
||||||
s = rp.s ! n ;
|
s = rp.s ! n ;
|
||||||
a = agrP3 Sg ; -- does not matter (--- at least in Slash)
|
a = agrP3 Sg ; -- does not matter (--- at least in Slash)
|
||||||
isPron = False -- has no special accusative
|
isPron = False -- has no special accusative
|
||||||
@@ -707,7 +781,19 @@ oper
|
|||||||
|
|
||||||
etta_Conj : Str = "et" ;
|
etta_Conj : Str = "et" ;
|
||||||
|
|
||||||
heavyDet : PDet -> PDet ** {sp : Case => Str} = \d -> d ** {sp = d.s} ;
|
Determiner : Type = {
|
||||||
|
s : Case => Str ; -- minun kolme
|
||||||
|
sp : Case => Str ; -- se (substantival form)
|
||||||
|
n : Number ; -- Pl (agreement feature for verb)
|
||||||
|
isNum : Bool ; -- True (a numeral is present)
|
||||||
|
isDef : Bool -- True (verb agrees in Pl, Nom is not Part) --I: actually, can we get rid of this?
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IDeterminer : Type = {s, post : Case => Str ; n : Number ; isNum : Bool} ;
|
||||||
|
|
||||||
|
linIDet : IDeterminer -> Str = \idet -> idet.s ! Nom ++ idet.post ! Nom ;
|
||||||
|
|
||||||
|
heavyDet : PDet -> Determiner = \d -> d ** {sp = d.s} ;
|
||||||
PDet : Type = {
|
PDet : Type = {
|
||||||
s : Case => Str ;
|
s : Case => Str ;
|
||||||
n : Number ;
|
n : Number ;
|
||||||
@@ -715,9 +801,9 @@ oper
|
|||||||
isDef : Bool
|
isDef : Bool
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
heavyQuant : PQuant -> PQuant ** {sp : Number => Case => Str} = \d ->
|
heavyQuant : PQuant -> PQuant ** {sp : Number => Case => Str} = \d ->
|
||||||
d ** {sp = d.s} ;
|
d ** {sp = d.s} ;
|
||||||
PQuant : Type =
|
PQuant : Type =
|
||||||
{s : Number => Case => Str ; isDef : Bool} ;
|
{s : Number => Case => Str ; isDef : Bool} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,18 +9,17 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
|
|||||||
PredSCVP sc vp = mkClause (\_ -> sc.s) (agrP3 Sg) vp ;
|
PredSCVP sc vp = mkClause (\_ -> sc.s) (agrP3 Sg) vp ;
|
||||||
|
|
||||||
ImpVP vp = {
|
ImpVP vp = {
|
||||||
s = \\pol,agr =>
|
s = \\pol,agr =>
|
||||||
let
|
let
|
||||||
verb = vp.s ! VIImper ! Simul ! pol ! agr ;
|
verb = mkVPForms vp.v ! VIImper ! Simul ! pol ! agr ;
|
||||||
compl = vp.s2 ! False ! pol ! agr ++ vp.ext --- False = like inf (osta auto)
|
compl = vp.s2 ! False ! pol ! agr ++ vp.ext --- False = like inf (osta auto)
|
||||||
in --(ära) loe raamat(ut) läbi
|
in --(ära) loe raamat(ut) läbi
|
||||||
verb.fin ++ verb.inf ++ compl ++ vp.p ;
|
verb.fin ++ verb.inf ++ compl ++ vp.p ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
|
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
|
||||||
|
|
||||||
SlashVP np vp = {
|
SlashVP np vp = mkClause (subjForm np vp.sc) np.a vp ** {
|
||||||
s = \\t,a,p => (mkClause (subjForm np vp.sc) np.a vp).s ! t ! a ! p ! SDecl ;
|
|
||||||
c2 = vp.c2
|
c2 = vp.c2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -29,26 +28,23 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
|
|||||||
c2 = slash.c2
|
c2 = slash.c2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashPrep cl prep = {
|
SlashPrep cl prep = cl ** {
|
||||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl ;
|
|
||||||
c2 = prep
|
c2 = prep
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVS np vs slash = {
|
SlashVS np vs slash =
|
||||||
s = \\t,a,p =>
|
let cl : Clause =
|
||||||
(mkClause (subjForm np vs.sc) np.a
|
mkClause
|
||||||
(insertExtrapos (etta_Conj ++ slash.s)
|
(subjForm np vs.sc) np.a
|
||||||
(predV vs))
|
(insertExtrapos (etta_Conj ++ slash.s) (predV vs))
|
||||||
).s ! t ! a ! p ! SDecl ;
|
in cl ** {c2 = slash.c2} ;
|
||||||
c2 = slash.c2
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
EmbedS s = {s = etta_Conj ++ s.s} ;
|
EmbedS s = {s = etta_Conj ++ s.s} ;
|
||||||
EmbedQS qs = {s = qs.s} ;
|
EmbedQS qs = {s = qs.s} ;
|
||||||
EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfDa} ; --- case,pol,agr,infform
|
EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfDa} ; --- case,pol,agr,infform
|
||||||
|
|
||||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! SDecl} ;
|
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
||||||
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
||||||
UseRCl t p cl = {
|
UseRCl t p cl = {
|
||||||
s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! r ;
|
s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! r ;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ concrete StructuralEst of Structural = CatEst **
|
|||||||
either7or_DConj = sd2 "kas" "või" ** {n = Sg} ;
|
either7or_DConj = sd2 "kas" "või" ** {n = Sg} ;
|
||||||
everybody_NP = makeNP (mkN "igaüks") Sg ;
|
everybody_NP = makeNP (mkN "igaüks") Sg ;
|
||||||
every_Det = mkDet Sg (mkN "iga") ;
|
every_Det = mkDet Sg (mkN "iga") ;
|
||||||
everything_NP = makeNP ((mkN "kõik") ** {lock_N = <>}) Sg ;
|
everything_NP = makeNP (mkN "kõik") Sg ;
|
||||||
everywhere_Adv = ss "kõikjal" ;
|
everywhere_Adv = ss "kõikjal" ;
|
||||||
few_Det = mkDet Sg (mkN "mõni") ;
|
few_Det = mkDet Sg (mkN "mõni") ;
|
||||||
--- first_Ord = {s = \\n,c => (mkN "ensimmäinen").s ! NCase n c} ;
|
--- first_Ord = {s = \\n,c => (mkN "ensimmäinen").s ! NCase n c} ;
|
||||||
@@ -48,6 +48,7 @@ concrete StructuralEst of Structural = CatEst **
|
|||||||
how8much_IAdv = ss "kui palju" ;
|
how8much_IAdv = ss "kui palju" ;
|
||||||
how8many_IDet = {
|
how8many_IDet = {
|
||||||
s = \\c => "kui" ++ (mkN "mitu" "mitme" "mitut" "TODO" "TODO" "TODO").s ! NCase Sg c ;
|
s = \\c => "kui" ++ (mkN "mitu" "mitme" "mitut" "TODO" "TODO" "TODO").s ! NCase Sg c ;
|
||||||
|
post = \\c => [] ;
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
isNum = False
|
isNum = False
|
||||||
} ;
|
} ;
|
||||||
@@ -78,10 +79,8 @@ concrete StructuralEst of Structural = CatEst **
|
|||||||
quite_Adv = ss "üsna" ;
|
quite_Adv = ss "üsna" ;
|
||||||
she_Pron = mkPronoun "tema" "tema" "teda" Sg P3 ;
|
she_Pron = mkPronoun "tema" "tema" "teda" Sg P3 ;
|
||||||
so_AdA = ss "nii" ;
|
so_AdA = ss "nii" ;
|
||||||
somebody_NP = {
|
somebody_NP = emptyNP ** {
|
||||||
s = \\c => jokuPron ! Sg ! npform2case Sg c ;
|
s = \\c => jokuPron ! Sg ! npform2case Sg c ;
|
||||||
a = agrP3 Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
someSg_Det = heavyDet {
|
someSg_Det = heavyDet {
|
||||||
s = jokuPron ! Sg ;
|
s = jokuPron ! Sg ;
|
||||||
@@ -92,10 +91,8 @@ concrete StructuralEst of Structural = CatEst **
|
|||||||
isNum = False ; isDef = True ;
|
isNum = False ; isDef = True ;
|
||||||
n = Pl
|
n = Pl
|
||||||
} ;
|
} ;
|
||||||
something_NP = {
|
something_NP = emptyNP ** {
|
||||||
s = \\c => mikaInt ! Sg ! npform2case Sg c ;
|
s = \\c => mikaInt ! Sg ! npform2case Sg c ;
|
||||||
a = agrP3 Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
somewhere_Adv = ss "kuskil" ;
|
somewhere_Adv = ss "kuskil" ;
|
||||||
that_Quant = heavyQuant {
|
that_Quant = heavyQuant {
|
||||||
@@ -133,11 +130,11 @@ concrete StructuralEst of Structural = CatEst **
|
|||||||
very_AdA = ss "väga" ;
|
very_AdA = ss "väga" ;
|
||||||
want_VV = mkVV (mkV "tahtma") ;
|
want_VV = mkVV (mkV "tahtma") ;
|
||||||
we_Pron = mkPronoun "meie" "meie" "meid" Pl P1 ;
|
we_Pron = mkPronoun "meie" "meie" "meid" Pl P1 ;
|
||||||
whatPl_IP = {
|
whatPl_IP = emptyIP ** {
|
||||||
s = table {NPAcc => "mida" ; c => mikaInt ! Pl ! npform2case Pl c} ;
|
s = table {NPAcc => "mida" ; c => mikaInt ! Pl ! npform2case Pl c} ;
|
||||||
n = Pl
|
n = Pl
|
||||||
} ;
|
} ;
|
||||||
whatSg_IP = {
|
whatSg_IP = emptyIP ** {
|
||||||
s = \\c => mikaInt ! Sg ! npform2case Sg c ;
|
s = \\c => mikaInt ! Sg ! npform2case Sg c ;
|
||||||
n = Sg
|
n = Sg
|
||||||
} ;
|
} ;
|
||||||
@@ -145,11 +142,11 @@ concrete StructuralEst of Structural = CatEst **
|
|||||||
when_Subj = ss "kui" ;
|
when_Subj = ss "kui" ;
|
||||||
where_IAdv = ss "kus" ;
|
where_IAdv = ss "kus" ;
|
||||||
which_IQuant = { s = mikaInt } ;
|
which_IQuant = { s = mikaInt } ;
|
||||||
whoSg_IP = {
|
whoSg_IP = emptyIP ** {
|
||||||
s = table {NPAcc => "keda" ; c => kukaInt ! Sg ! npform2case Sg c} ;
|
s = table {NPAcc => "keda" ; c => kukaInt ! Sg ! npform2case Sg c} ;
|
||||||
n = Sg
|
n = Sg
|
||||||
} ;
|
} ;
|
||||||
whoPl_IP = {
|
whoPl_IP = emptyIP ** {
|
||||||
s = table {NPAcc => "keda" ; c => kukaInt ! Pl ! npform2case Pl c} ;
|
s = table {NPAcc => "keda" ; c => kukaInt ! Pl ! npform2case Pl c} ;
|
||||||
n = Pl
|
n = Pl
|
||||||
} ;
|
} ;
|
||||||
@@ -198,27 +195,21 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--TODO does this work?
|
mikaInt : MorphoEst.Number => MorphoEst.Case => Str =
|
||||||
mikaInt : MorphoEst.Number => (MorphoEst.Case) => Str =
|
|
||||||
let {
|
let {
|
||||||
mi = mkN "mille"
|
mi : N = mkN "mis" "mille" "mida" "millesse" "millede" "mida"
|
||||||
} in
|
} in
|
||||||
table {
|
table {
|
||||||
Sg => table {
|
Sg => table {
|
||||||
Nom => "mis" ;
|
|
||||||
Gen => "mille" ;
|
|
||||||
Part => "mida" ;
|
|
||||||
c => mi.s ! NCase Sg c
|
c => mi.s ! NCase Sg c
|
||||||
} ;
|
} ;
|
||||||
Pl => table {
|
Pl => table {
|
||||||
Nom => "mis" ;
|
Nom => "mis" ;
|
||||||
Gen => "mille" ;
|
|
||||||
Part => "mida" ;
|
|
||||||
c => mi.s ! NCase Pl c
|
c => mi.s ! NCase Pl c
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
kukaInt : MorphoEst.Number => (MorphoEst.Case) => Str =
|
kukaInt : MorphoEst.Number => MorphoEst.Case => Str =
|
||||||
let
|
let
|
||||||
kuka = mkN "kes" "kelle" "keda" "kellesse"
|
kuka = mkN "kes" "kelle" "keda" "kellesse"
|
||||||
"kellede" "keda" ;
|
"kellede" "keda" ;
|
||||||
@@ -256,12 +247,10 @@ oper
|
|||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
makeNP : N -> MorphoEst.Number -> CatEst.NP ;
|
makeNP : N -> MorphoEst.Number -> NPhrase ;
|
||||||
makeNP noun num = {
|
makeNP noun num = emptyNP ** {
|
||||||
s = \\c => noun.s ! NCase num (npform2case num c) ;
|
s = \\c => noun.s ! NCase num (npform2case num c) ;
|
||||||
a = agrP3 num ;
|
a = agrP3 num ;
|
||||||
isPron = False ;
|
|
||||||
lock_NP = <>
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
@@ -273,16 +262,14 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
if_then_Conj = {s1 = "kui" ; s2 = "siis" ; n = Sg} ;
|
if_then_Conj = {s1 = "kui" ; s2 = "siis" ; n = Sg} ;
|
||||||
nobody_NP = {
|
nobody_NP = emptyNP ** {
|
||||||
s = \\c => "mitte" ++ kukaanPron ! Sg ! npform2case Sg c ;
|
s = \\c => "mitte" ++ kukaanPron ! Sg ! npform2case Sg c ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
nothing_NP = {
|
nothing_NP = emptyNP ** {
|
||||||
s = \\c => "mitte" ++ mikaanPron ! Sg ! npform2case Sg c ;
|
s = \\c => "mitte" ++ mikaanPron ! Sg ! npform2case Sg c ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
at_least_AdN = ss "vähemalt" ;
|
at_least_AdN = ss "vähemalt" ;
|
||||||
|
|||||||
@@ -8,20 +8,14 @@ lin
|
|||||||
FloatPN i = {s = \\c => i.s} ; --- c
|
FloatPN i = {s = \\c => i.s} ; --- c
|
||||||
NumPN i = {s = \\c => i.s!Sg!Nom } ; --- c
|
NumPN i = {s = \\c => i.s!Sg!Nom } ; --- c
|
||||||
|
|
||||||
CNIntNP cn i = {
|
CNIntNP cn i = let np : NP = NounEst.MassNP cn in np ** {
|
||||||
s = \\c => cn.s ! NCase Sg (npform2case Sg c) ++ i.s ;
|
postmod = np.postmod ++ i.s ;
|
||||||
a = agrP3 Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = let detcn = NounEst.DetCN det cn in {
|
CNSymbNP det cn xs = let np : NP = NounEst.DetCN det cn in np ** {
|
||||||
s = \\c => detcn.s ! c ++ xs.s ;
|
postmod = np.postmod ++ xs.s ;
|
||||||
a = detcn.a ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
CNNumNP cn i = {
|
CNNumNP cn i = let np : NP = NounEst.MassNP cn in np ** {
|
||||||
s = \\c => cn.s ! NCase Sg (npform2case Sg c) ++ i.s ! Sg ! Nom ;
|
postmod = np.postmod ++ i.s ! Sg ! Nom ;
|
||||||
a = agrP3 Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SymbS sy = sy ;
|
SymbS sy = sy ;
|
||||||
@@ -29,7 +23,7 @@ lin
|
|||||||
SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ;
|
SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ;
|
||||||
SymbOrd n = {s = \\_ => glue n.s "."} ;
|
SymbOrd n = {s = \\_ => glue n.s "."} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
|
|
||||||
Symb, [Symb] = SS ;
|
Symb, [Symb] = SS ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../abstract:../common
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
concrete TerminologyEst of Terminology = CatEst ** open
|
concrete TerminologyEst of Terminology = CatEst ** open
|
||||||
ResEst,
|
ResEst,
|
||||||
ParadigmsEst,
|
ParadigmsEst,
|
||||||
(G = GrammarEst),
|
(G = GrammarEst),
|
||||||
@@ -17,9 +17,9 @@ lincat
|
|||||||
ParameterType = G.N ;
|
ParameterType = G.N ;
|
||||||
Parameter = G.N ;
|
Parameter = G.N ;
|
||||||
Modifier = G.A ;
|
Modifier = G.A ;
|
||||||
|
|
||||||
Heading = {s : Str} ;
|
Heading = {s : Str} ;
|
||||||
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
noun_Category = mkN "käändsõna" ;
|
noun_Category = mkN "käändsõna" ;
|
||||||
@@ -59,7 +59,7 @@ lin
|
|||||||
|
|
||||||
active_Parameter = mkN "isikuline tegumood" ;
|
active_Parameter = mkN "isikuline tegumood" ;
|
||||||
passive_Parameter = mkN "umbsikuline tegumood" ;
|
passive_Parameter = mkN "umbsikuline tegumood" ;
|
||||||
|
|
||||||
imperative_Parameter = mkN "käskiv kõneviis" "käskiva kõneviisi";
|
imperative_Parameter = mkN "käskiv kõneviis" "käskiva kõneviisi";
|
||||||
indicative_Parameter = mkN "kindel kõneviis" "kindla kõneviisi";
|
indicative_Parameter = mkN "kindel kõneviis" "kindla kõneviisi";
|
||||||
conjunctive_Parameter = mkN "konjunktiiv" ;
|
conjunctive_Parameter = mkN "konjunktiiv" ;
|
||||||
@@ -67,7 +67,7 @@ lin
|
|||||||
|
|
||||||
present_Parameter = mkN "olevik" ;
|
present_Parameter = mkN "olevik" ;
|
||||||
past_Parameter = mkN "lihtminevik" ;
|
past_Parameter = mkN "lihtminevik" ;
|
||||||
future_Parameter = mkN "futuur" ; ---- ???
|
future_Parameter = mkN "futuur" ; ---- ???
|
||||||
conditional_Parameter = mkN "tingiv kõneviis" "tingiva kõneviisi";
|
conditional_Parameter = mkN "tingiv kõneviis" "tingiva kõneviisi";
|
||||||
perfect_Parameter = mkN "täisminevik" ;
|
perfect_Parameter = mkN "täisminevik" ;
|
||||||
quotative_Parameter = mkN "kaudne kõneviis" "kaudse kõneviisi";
|
quotative_Parameter = mkN "kaudne kõneviis" "kaudse kõneviisi";
|
||||||
@@ -91,7 +91,7 @@ lin
|
|||||||
nounHeading n = ss (n.s ! NCase Sg Nom) ;
|
nounHeading n = ss (n.s ! NCase Sg Nom) ;
|
||||||
nounPluralHeading n = ss (n.s ! NCase Pl Nom) ;
|
nounPluralHeading n = ss (n.s ! NCase Pl Nom) ;
|
||||||
|
|
||||||
formGF_N = mkN "vorm" ;
|
formGr_N = mkN "vorm" ;
|
||||||
exampleGr_N = mkN "näide" ;
|
exampleGr_N = mkN "näide" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,17 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
|
|||||||
|
|
||||||
SlashV2a v = predV v ** {c2 = v.c2} ;
|
SlashV2a v = predV v ** {c2 = v.c2} ;
|
||||||
|
|
||||||
Slash2V3 v np =
|
Slash2V3 v np =
|
||||||
insertObj
|
insertObj
|
||||||
(\\fin,b,_ => appCompl fin b v.c2 np) (predV v) ** {c2 = v.c3} ;
|
(\\fin,b,_ => appCompl fin b v.c2 np) (predV v) ** {c2 = v.c3} ;
|
||||||
Slash3V3 v np =
|
Slash3V3 v np =
|
||||||
insertObj
|
insertObj
|
||||||
(\\fin,b,_ => appCompl fin b v.c3 np) (predV v) ** {c2 = v.c2} ;
|
(\\fin,b,_ => appCompl fin b v.c3 np) (predV v) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
ComplVV v vp =
|
ComplVV v vp =
|
||||||
insertObj
|
insertObj
|
||||||
(\\_,b,a => infVP v.sc b a vp v.vi)
|
(\\_,b,a => infVP v.sc b a vp v.vi)
|
||||||
(predV {s = v.s ;
|
(predV {s = v.s ;
|
||||||
p = v.p ;
|
p = v.p ;
|
||||||
sc = case vp.sc of {
|
sc = case vp.sc of {
|
||||||
NPCase Nom => v.sc ; -- minul tuleb kirjutada (VV 'tulema' determines the subject case)
|
NPCase Nom => v.sc ; -- minul tuleb kirjutada (VV 'tulema' determines the subject case)
|
||||||
@@ -30,76 +30,68 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
|
|||||||
|
|
||||||
ComplVS v s = insertExtrapos (etta_Conj ++ s.s) (predV v) ;
|
ComplVS v s = insertExtrapos (etta_Conj ++ s.s) (predV v) ;
|
||||||
ComplVQ v q = insertExtrapos ( q.s) (predV v) ;
|
ComplVQ v q = insertExtrapos ( q.s) (predV v) ;
|
||||||
ComplVA v ap =
|
ComplVA v ap =
|
||||||
insertObj
|
insertObj
|
||||||
(\\_,b,agr =>
|
(\\_,b,agr =>
|
||||||
let n = (complNumAgr agr) in
|
let n = (complNumAgr agr) in
|
||||||
ap.s ! False ! (NCase n (npform2case n v.c2.c))) --- v.cs.s ignored
|
ap.s ! False ! (NCase n (npform2case n v.c2.c.npf))) --- v.cs.s ignored
|
||||||
(predV v) ;
|
(predV v) ;
|
||||||
|
|
||||||
SlashV2S v s =
|
SlashV2S v s =
|
||||||
insertExtrapos (etta_Conj ++ s.s) (predV v) ** {c2 = v.c2} ;
|
insertExtrapos (etta_Conj ++ s.s) (predV v) ** {c2 = v.c2} ;
|
||||||
SlashV2Q v q =
|
SlashV2Q v q =
|
||||||
insertExtrapos (q.s) (predV v) ** {c2 = v.c2} ;
|
insertExtrapos (q.s) (predV v) ** {c2 = v.c2} ;
|
||||||
SlashV2V v vp =
|
SlashV2V v vp =
|
||||||
insertObj (\\_,b,a => infVP v.sc b a vp v.vi) (predV v) ** {c2 = v.c2} ;
|
insertObj (\\_,b,a => infVP v.sc b a vp v.vi) (predV v) ** {c2 = v.c2} ;
|
||||||
---- different infinitives
|
---- different infinitives
|
||||||
SlashV2A v ap =
|
SlashV2A v ap =
|
||||||
insertObj
|
insertObj
|
||||||
(\\fin,b,_ =>
|
(\\fin,b,_ =>
|
||||||
ap.s ! False ! (NCase Sg (npform2case Sg v.c3.c))) ----agr to obj
|
ap.s ! False ! (NCase Sg (npform2case Sg v.c3.c.npf))) ----agr to obj
|
||||||
(predV v) ** {c2 = v.c2} ;
|
(predV v) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
ComplSlash vp np = insertObjPre (\\fin,b,_ => appCompl fin b vp.c2 np) vp ;
|
ComplSlash vp np = insertObjPre (\\fin,b,_ => appCompl fin b vp.c2 np) vp ;
|
||||||
|
|
||||||
UseComp comp =
|
UseComp comp =
|
||||||
insertObj (\\_,_ => comp.s) (predV (verbOlema ** {sc = NPCase Nom})) ;
|
insertObj (\\_,_ => comp.s) (predV (verbOlema ** {sc = NPCase Nom})) ;
|
||||||
|
|
||||||
SlashVV v vp =
|
SlashVV v vp =
|
||||||
insertObj
|
insertObj
|
||||||
(\\_,b,a => infVP v.sc b a vp v.vi)
|
(\\_,b,a => infVP v.sc b a vp v.vi)
|
||||||
(predV {s = v.s ;
|
(predV {s = v.s ;
|
||||||
p = v.p ;
|
p = v.p ;
|
||||||
sc = case vp.sc of {
|
sc = case vp.sc of {
|
||||||
NPCase Nom => v.sc ; -- minun täytyy pestä auto
|
NPCase Nom => v.sc ; -- minun täytyy pestä auto
|
||||||
c => c -- minulla täytyy olla auto
|
c => c -- minulla täytyy olla auto
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
) ** {c2 = vp.c2} ; ---- correct ??
|
) ** {c2 = vp.c2} ; ---- correct ??
|
||||||
|
|
||||||
SlashV2VNP v np vp =
|
SlashV2VNP v np vp =
|
||||||
insertObjPre
|
insertObjPre
|
||||||
(\\fin,b,a => appCompl True b v.c2 np ++ ---- fin -> stack overflow
|
(\\fin,b,a => appCompl True b v.c2 np ++ ---- fin -> stack overflow
|
||||||
infVP v.sc b a vp v.vi)
|
infVP v.sc b a vp v.vi)
|
||||||
(predV v) ** {c2 = vp.c2} ;
|
(predV v) ** {c2 = vp.c2} ;
|
||||||
|
|
||||||
AdvVP vp adv = insertAdv adv.s vp ;
|
AdvVP vp adv = insertAdv adv.s vp ;
|
||||||
|
|
||||||
|
AdvVPSlash vp adv = insertAdv adv.s vp ** vp ;
|
||||||
|
|
||||||
|
VPSlashPrep vp prep = vp ** {c2 = prep} ;
|
||||||
|
|
||||||
AdVVP adv vp = insertAdv adv.s vp ;
|
AdVVP adv vp = insertAdv adv.s vp ;
|
||||||
|
|
||||||
ReflVP v = insertObjPre (\\fin,b,agr => appCompl fin b v.c2 (reflPron agr)) v ;
|
ReflVP v = insertObjPre (\\fin,b,agr => appCompl fin b v.c2 (reflPron agr)) v ;
|
||||||
|
|
||||||
PassV2 v =
|
PassV2 v = let vp : ResEst.VP = passiveVP (predV v) in vp ** {
|
||||||
let
|
sc = compl2subjcase v.c2 -- koer valitakse ; koerale räägitakse
|
||||||
vp = predV v ;
|
|
||||||
subjCase = case v.c2.c of { --this is probably a reason to not get rid of NPAcc; TODO check
|
|
||||||
NPCase Gen => NPCase Nom ; --valisin koera -> koer valitakse
|
|
||||||
_ => v.c2.c --rääkisin koerale -> koerale räägitakse
|
|
||||||
}
|
|
||||||
in {
|
|
||||||
s = \\_ => vp.s ! VIPass Pres ;
|
|
||||||
s2 = \\_,_,_ => [] ;
|
|
||||||
adv = [] ;
|
|
||||||
p = vp.p ;
|
|
||||||
ext = vp.ext ;
|
|
||||||
sc = subjCase -- koer valitakse ; koerale räägitakse
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
----b UseVS, UseVQ = \v -> v ** {c2 = {s = [] ; c = NPAcc ; isPre = True}} ;
|
----b UseVS, UseVQ = \v -> v ** {c2 = {s = [] ; c = NPAcc ; isPre = True}} ;
|
||||||
|
|
||||||
CompAP = compAP ;
|
CompAP = compAP ;
|
||||||
CompCN = compCN ;
|
CompCN = compCN ;
|
||||||
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
|
CompNP np = {s = \\_ => linNP (NPCase Nom) np} ;
|
||||||
CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -108,17 +100,17 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
|
|||||||
--2 The object case
|
--2 The object case
|
||||||
--
|
--
|
||||||
-- The rules involved are ComplV2 and ComplVV above.
|
-- The rules involved are ComplV2 and ComplVV above.
|
||||||
-- The work is done jointly in ResEst.infVP and appCompl.
|
-- The work is done jointly in ResEst.infVP and appCompl.
|
||||||
-- Cases to test: l -table (to see negated forms)
|
-- Cases to test: l -table (to see negated forms)
|
||||||
--```
|
--```
|
||||||
-- minun täytyy ostaa auto
|
-- minun täytyy ostaa auto
|
||||||
-- PredVP (UsePron i_Pron) (ComplVV must_VV
|
-- PredVP (UsePron i_Pron) (ComplVV must_VV
|
||||||
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
||||||
-- minä tahdon ostaa auton
|
-- minä tahdon ostaa auton
|
||||||
-- PredVP (UsePron i_Pron) (ComplVV want_VV
|
-- PredVP (UsePron i_Pron) (ComplVV want_VV
|
||||||
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
||||||
-- minulla täytyy olla auto
|
-- minulla täytyy olla auto
|
||||||
-- PredVP (UsePron i_Pron) (ComplVV must_VV
|
-- PredVP (UsePron i_Pron) (ComplVV must_VV
|
||||||
-- (ComplV2 have_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
-- (ComplV2 have_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
||||||
--```
|
--```
|
||||||
-- Unfortunately, there is no nice way to say "I want to have a car".
|
-- Unfortunately, there is no nice way to say "I want to have a car".
|
||||||
|
|||||||
126
src/estonian/unittest/comitative.gftest
Normal file
126
src/estonian/unittest/comitative.gftest
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
-- Comitative, Essive, Abessive and Terminative cases are not in the inflection table of nominal categories,
|
||||||
|
-- instead they use the Genitive stem and add a suffix with BIND token.
|
||||||
|
-- Here are tests for those cases.
|
||||||
|
|
||||||
|
-- NB. Ignore any weirdness with the word "koos".
|
||||||
|
-- That just happens to be the linearisation of with_Prep,
|
||||||
|
-- we can as easily replace it with just the case -ga,
|
||||||
|
-- or in an application, have two versions, one "koos …ga" and other just "…ga".
|
||||||
|
-- But do point out any other unexpected weirdness/ungrammaticality!
|
||||||
|
|
||||||
|
-- Comitative, case attaches to the noun
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (AdvVP (UseV play_V) (PrepNP with_Prep (DetCN (DetQuant this_Quant NumSg) (UseN dog_N))))
|
||||||
|
LangEng: I play with this dog
|
||||||
|
LangEst: mina mängin koos selle koera BIND ga
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron we_Pron) (AdvVP (UseV play_V) (PrepNP with_Prep (DetCN (DetQuant this_Quant NumPl) (UseN dog_N))))
|
||||||
|
LangEng: we play with these dogs
|
||||||
|
LangEst: meie mängime koos nende koerte BIND ga
|
||||||
|
|
||||||
|
-- Interrogative versions
|
||||||
|
|
||||||
|
-- First, reason why the interrogative pronoun doesn't inflect is this http://www.eki.ee/books/ekk09/index.php?p=5&p1=3&id=452
|
||||||
|
-- "Üldse ei ühildu: asesõnad mis (kui ta ei osuta omadusele, vaid on identifitseerivas funktsioonis) [..],
|
||||||
|
-- nt 'Mis keelt te räägite?' "
|
||||||
|
-- So because of that, it doesn't inflect in any position. Here is the eki example:
|
||||||
|
|
||||||
|
Lang: QuestSlash (IdetCN (IdetQuant which_IQuant NumSg) (UseN language_N)) (SlashVP (UsePron youSg_Pron) (SlashV2a speak_V2))
|
||||||
|
LangEng: which language do you speak
|
||||||
|
LangEst: mis keelt sina räägid
|
||||||
|
|
||||||
|
-- But should the interrogative inflect when PrepIP is applied? Or is "koos mis koeraga" still fine?
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep (IdetCN (IdetQuant which_IQuant NumSg) (UseN dog_N))) (PredVP (UsePron youSg_Pron) (UseV play_V))
|
||||||
|
LangEng: with which dog do you play
|
||||||
|
LangEst: koos mis koera BIND ga sina mängid
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep (IdetCN (IdetQuant which_IQuant NumPl) (UseN dog_N))) (PredVP (UsePron youPl_Pron) (UseV play_V))
|
||||||
|
LangEng: with which dogs do you play
|
||||||
|
LangEst: koos mis koerte BIND ga teie mängite
|
||||||
|
|
||||||
|
-- Adding a number, does it affect the behaviour of
|
||||||
|
-- a) suffix attachment? b) agreement of interrogative?
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (AdvVP (UseV play_V) (PrepNP with_Prep (DetCN (DetQuant this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))))))) (UseN dog_N))))
|
||||||
|
LangEng: I play with these three dogs
|
||||||
|
LangEst: mina mängin koos nende kolme koera BIND ga
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (AdvVP (UseV play_V) (PrepNP with_Prep (DetCN (DetQuant this_Quant (NumCard (NumDigits (IDig D_3)))) (UseN dog_N))))
|
||||||
|
LangEng: I play with these 3 dogs
|
||||||
|
LangEst: mina mängin koos nende 3 koera BIND ga
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep (IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))))))) (UseN dog_N))) (PredVP (UsePron youPol_Pron) (UseV play_V))
|
||||||
|
LangEng: with which three dogs do you play
|
||||||
|
LangEst: koos mis kolme koera BIND ga teie mängite
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep (IdetCN (IdetQuant which_IQuant (NumCard (NumDigits (IDig D_3)))) (UseN dog_N))) (PredVP (UsePron youPl_Pron) (UseV play_V))
|
||||||
|
LangEng: with which 3 dogs do you play
|
||||||
|
LangEst: koos mis 3 koera BIND ga teie mängite
|
||||||
|
-- Technically the version below is better, but we'd need to add another param and who wants that :-P
|
||||||
|
-- LangEst: koos mille 3 koera BIND ga teie mängite
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------
|
||||||
|
-- Now we skip the content word, and make the determiner (possibly with number) into NP/IP
|
||||||
|
-- The relevant functions are DetNP : Det -> NP and IDetIP : IDet -> IP
|
||||||
|
|
||||||
|
-- No number, case attaches to determiner/interrogative
|
||||||
|
Lang: PredVP (UsePron i_Pron) (AdvVP (UseV play_V) (PrepNP with_Prep (DetNP (DetQuant this_Quant NumPl))))
|
||||||
|
LangEng: I play with these
|
||||||
|
LangEst: mina mängin koos nende BIND ga
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep whoSg_IP) (PredVP (UsePron youSg_Pron) (UseV sing_V))
|
||||||
|
LangEng: with whom do you sing
|
||||||
|
LangEst: koos kelle BIND ga sina laulad
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep whoPl_IP) (PredVP (UsePron youSg_Pron) (UseV sing_V))
|
||||||
|
LangEng: with whom do you sing
|
||||||
|
LangEst: koos kellede BIND ga sina laulad
|
||||||
|
|
||||||
|
-- Adding a number to a determiner, does this affect the comitative suffix placement?
|
||||||
|
-- Context of the sentence is an ellipsis, "I sing with these 3 (singers)"
|
||||||
|
|
||||||
|
Lang: PredVP (UsePron i_Pron) (AdvVP (UseV sing_V) (PrepNP with_Prep (DetNP (DetQuant this_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))))))))))
|
||||||
|
LangEng: I sing with these three
|
||||||
|
LangEst: mina laulan koos nende kolme BIND ga
|
||||||
|
|
||||||
|
-- Orthography should be 3-ga, but this can be easily postprocessed in applications, so I don't bother
|
||||||
|
Lang: PredVP (UsePron i_Pron) (AdvVP (UseV sing_V) (PrepNP with_Prep (DetNP (DetQuant this_Quant (NumCard (NumDigits (IDig D_3)))))))
|
||||||
|
LangEng: I sing with these 3
|
||||||
|
LangEst: mina laulan koos nende 3 BIND ga
|
||||||
|
|
||||||
|
-- Adding a number to an interrogative, how does suffix placement + agreement work now?
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep (IdetIP (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))))))))) (PredVP (UsePron youSg_Pron) (UseV sing_V))
|
||||||
|
LangEng: with which three do you sing
|
||||||
|
LangEst: koos mis kolme BIND ga sina laulad
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep (IdetIP (IdetQuant which_IQuant (NumCard (NumDigits (IDig D_3)))))) (PredVP (UsePron youSg_Pron) (UseV sing_V))
|
||||||
|
LangEng: with which 3 do you sing
|
||||||
|
LangEst: koos mis 3 BIND ga sina laulad
|
||||||
|
-- Also ok:
|
||||||
|
-- LangEst: koos mille 3 BIND ga sina laulad
|
||||||
|
|
||||||
|
-- Adding premodifiers to the number, does that change anything?
|
||||||
|
|
||||||
|
-- None of the alternatives sounds actually good, so we just use the same strategy as interrogative + number
|
||||||
|
-- This can be one of the cases where some trees in the RGL don't make sense, and so application grammarians should use other trees that make more sense.
|
||||||
|
-- Leaving these ungrammatical/nonsensical edge cases here just for documentation, and to catch any unintended side effects of later tweaks to the grammar.
|
||||||
|
Lang: PredVP (UsePron i_Pron) (AdvVP (UseV sing_V) (PrepNP with_Prep (DetNP (DetQuant this_Quant (NumCard (AdNum at_most_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3))))))))))))
|
||||||
|
LangEng: I sing with these at most three
|
||||||
|
LangEst: mina laulan koos nende kuni kolme BIND ga
|
||||||
|
|
||||||
|
Lang: QuestIAdv (PrepIP with_Prep (IdetIP (IdetQuant which_IQuant (NumCard (AdNum at_most_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3))))))))))) (PredVP (UsePron youSg_Pron) (UseV sing_V))
|
||||||
|
LangEng: with which at most three do you sing
|
||||||
|
LangEst: koos mis kuni kolme BIND ga sina laulad
|
||||||
|
|
||||||
|
-- Appendix: if you really want to ask "with which at most three do you sing", you can use these strategies
|
||||||
|
|
||||||
|
-- koos kellega (kuni kolmega) sina laulad? -- this one is by far the best
|
||||||
|
-- koos kellega (kuni kolm) sina laulad? --
|
||||||
|
-- koos kellega (kuni 3) sina laulad? --
|
||||||
|
-- koos kellega (kuni 3-ga) sina laulad? --
|
||||||
|
-- Now I get it, the sentence doesn't have any asking verb, "kellega koos sina laulad" VS "kellega koos sina *tahad* laulda?"
|
||||||
|
-- If you want the answerer to specify the up-to-three to sing together with, then you have to let specify also whether-or-not the answerer even wants to sing :-)
|
||||||
|
-- *) kuni kolmega nendest, kellega sina laulaud? -- this is correct but just weird
|
||||||
|
-- *) kuni kolmega nendest, kellega sina tahad laulda? -- this is correct and understandable
|
||||||
52
src/estonian/unittest/interrogative-agreement.gftest
Normal file
52
src/estonian/unittest/interrogative-agreement.gftest
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
-- Test cases related to the agreement of interrogative pronouns
|
||||||
|
-- for tests about interrogative agreement in comitative, see comitative.gftest
|
||||||
|
|
||||||
|
-- As object: case of the numberal is determined by the verb's object case
|
||||||
|
|
||||||
|
-- For comparison, the Finnish linearisation is
|
||||||
|
-- LangFin: mitkä kahdeksan opiskelijaa sinä näet
|
||||||
|
-- Estonian partitive here comes from see_V2
|
||||||
|
Lang: QuestSlash (IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n8)))))))) (UseN student_N)) (SlashVP (UsePron youSg_Pron) (SlashV2a see_V2))
|
||||||
|
LangEng: which eight students do you see
|
||||||
|
LangEst: mis kaheksat tudengit sina näed
|
||||||
|
|
||||||
|
-- In Finnish, partitive comes from the number (mitkä kahdeksan opiskelijaa sinä myyt opettajille)
|
||||||
|
-- In Estonian, we have eight and student both in genitive.
|
||||||
|
Lang: QuestSlash (IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n8)))))))) (UseN student_N)) (SlashVP (UsePron youSg_Pron) (Slash3V3 sell_V3 (DetCN (DetQuant DefArt NumPl) (UseN teacher_N))))
|
||||||
|
LangEng: which eight students do you sell to the teachers
|
||||||
|
LangEst: mis kaheksa tudengi sina müüd õpetajatele
|
||||||
|
|
||||||
|
-- Both Finnish and Estonian inflect eight and student, Finnish also inflects which (mistä kahdeksasta opiskelijasta sinä pidät)
|
||||||
|
Lang: QuestSlash (IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n8)))))))) (UseN student_N)) (SlashVP (UsePron youSg_Pron) (SlashV2a like_V2))
|
||||||
|
LangEng: which eight students do you like
|
||||||
|
LangEst: mis kaheksast tudengist sina pead lugu
|
||||||
|
|
||||||
|
-- For comparison, this is Finnish partitive coming from the verb: the word "eight" is also inflected
|
||||||
|
Lang: QuestSlash (IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n8)))))))) (UseN student_N)) (SlashVP (UsePron youSg_Pron) (SlashV2a love_V2))
|
||||||
|
LangEng: which eight students do you love
|
||||||
|
LangEst: mis kaheksat tudengit sina armastad
|
||||||
|
-- LangFin: mitä kahdeksaa opiskelijaa sinä rakastat
|
||||||
|
|
||||||
|
|
||||||
|
-- As subject
|
||||||
|
|
||||||
|
-- No numeral in IDet
|
||||||
|
Lang: QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN horse_N)) (UseV play_V)
|
||||||
|
LangEng: which horse plays
|
||||||
|
LangEst: mis hobune mängib
|
||||||
|
|
||||||
|
Lang: QuestVP (IdetCN (IdetQuant which_IQuant NumPl) (UseN horse_N)) (UseV play_V)
|
||||||
|
LangEng: which horses play
|
||||||
|
LangEst: mis hobused mängivad
|
||||||
|
|
||||||
|
-- With numeral
|
||||||
|
|
||||||
|
-- Number 1 doesn't behave like numerals
|
||||||
|
Lang: QuestVP (IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01))))))) (UseN horse_N)) (UseV play_V)
|
||||||
|
LangEng: which one horse plays
|
||||||
|
LangEst: mis üks hobune mängib
|
||||||
|
|
||||||
|
|
||||||
|
Lang: QuestVP (IdetCN (IdetQuant which_IQuant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n8)))))))) (UseN horse_N)) (UseV play_V)
|
||||||
|
LangEng: which eight horses play
|
||||||
|
LangEst: mis kaheksa hobust mängivad
|
||||||
@@ -713,7 +713,15 @@ mkVS = overload {
|
|||||||
mkA : V -> A = presActA ;
|
mkA : V -> A = presActA ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkA_1 : Str -> A = \x -> lin A (noun2adjDeg (mk1N x)) ;
|
-- Adjectives that are not really adjectives are given in WordNet like "sähkö-"
|
||||||
|
-- We can at least make them into prefixA to make slightly better linearisation.
|
||||||
|
mkA_1 : Str -> A = \x ->
|
||||||
|
case x of {
|
||||||
|
prefix + "-"
|
||||||
|
=> let regA : A = noun2adjDeg (mk1N prefix) ;
|
||||||
|
in prefixA prefix regA ;
|
||||||
|
_ => noun2adjDeg (mk1N x)
|
||||||
|
} ;
|
||||||
|
|
||||||
-- auxiliaries
|
-- auxiliaries
|
||||||
mkAdjective : (_,_,_ : SAdj) -> A = \hyva,parempi,paras -> lin A
|
mkAdjective : (_,_,_ : SAdj) -> A = \hyva,parempi,paras -> lin A
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ concrete StructuralFin of Structural = CatFin **
|
|||||||
less_CAdv = X.mkCAdv "vähemmän" "kuin" ;
|
less_CAdv = X.mkCAdv "vähemmän" "kuin" ;
|
||||||
many_Det = MorphoFin.mkDet Sg (snoun2nounBind (mkN "moni" "monia")) ;
|
many_Det = MorphoFin.mkDet Sg (snoun2nounBind (mkN "moni" "monia")) ;
|
||||||
more_CAdv = X.mkCAdv "enemmän" "kuin" ;
|
more_CAdv = X.mkCAdv "enemmän" "kuin" ;
|
||||||
most_Predet = {s = \\n,c => (nForms2N (dSuurin "useinta")).s ! NCase n (npform2case n c)} ;
|
most_Predet = {s = \\n,c => (nForms2N (dSuurin "usein")).s ! NCase n (npform2case n c)} ;
|
||||||
much_Det = MorphoFin.mkDet Sg (snoun2nounBind (exceptNomN (mkN "paljo") "paljon")) ** {isNum = True} ; --Harmony not relevant, it's just a CommonNoun
|
much_Det = MorphoFin.mkDet Sg (snoun2nounBind (exceptNomN (mkN "paljo") "paljon")) ** {isNum = True} ; --Harmony not relevant, it's just a CommonNoun
|
||||||
must_VV = mkVV (caseV genitive (mkV "täytyä")) ;
|
must_VV = mkVV (caseV genitive (mkV "täytyä")) ;
|
||||||
no_Utt = ssp "INTERJ" "ei" ;
|
no_Utt = ssp "INTERJ" "ei" ;
|
||||||
|
|||||||
@@ -50,11 +50,13 @@ concrete CatGer of Cat =
|
|||||||
|
|
||||||
-- Noun
|
-- Noun
|
||||||
|
|
||||||
CN = {s : Adjf => Number => Case => Str ;
|
CN = {
|
||||||
rc : Number => Str ; -- Frage , [rc die ich gestellt habe]
|
s : Adjf => Number => Case => Str ;
|
||||||
ext : Str ; -- Frage , [sc wo sie schläft])
|
rc : Number => Str ; -- Frage , [rc die ich gestellt habe]
|
||||||
adv : Str ; -- Frage [a von Max]
|
ext : Str ; -- Frage , [sc wo sie schläft]
|
||||||
g : Gender} ;
|
adv : Str ; -- Haus [adv auf dem Hügel]
|
||||||
|
g : Gender
|
||||||
|
} ;
|
||||||
NP = ResGer.NP ;
|
NP = ResGer.NP ;
|
||||||
Pron = {s : NPForm => Str ; a : Agr} ;
|
Pron = {s : NPForm => Str ; a : Agr} ;
|
||||||
Det, DAP = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} ;
|
Det, DAP = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} ;
|
||||||
@@ -86,10 +88,10 @@ concrete CatGer of Cat =
|
|||||||
|
|
||||||
-- Open lexical classes, e.g. Lexicon
|
-- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
V, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ;
|
V, VA, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ;
|
||||||
VV = Verb ** {isAux : Bool} ;
|
VV = Verb ** {isAux : Bool} ;
|
||||||
V2, VA, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ;
|
V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ;
|
||||||
V2V = Verb ** {c2 : Preposition ; isAux : Bool ; ctrl : Control} ;
|
V2V = Verb ** {c2 : Preposition ; isAux : Bool ; objCtrl : Bool} ;
|
||||||
V3 = Verb ** {c2, c3 : Preposition} ;
|
V3 = Verb ** {c2, c3 : Preposition} ;
|
||||||
|
|
||||||
A = {s : Degree => AForm => Str} ;
|
A = {s : Degree => AForm => Str} ;
|
||||||
@@ -113,7 +115,7 @@ concrete CatGer of Cat =
|
|||||||
ClSlash = \cls -> cls.s ! MIndic ! Pres ! Simul ! Pos ! Main ++ cls.c2.s ;
|
ClSlash = \cls -> cls.s ! MIndic ! Pres ! Simul ! Pos ! Main ++ cls.c2.s ;
|
||||||
|
|
||||||
VP = \vp -> useInfVP False vp ;
|
VP = \vp -> useInfVP False vp ;
|
||||||
VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ;
|
VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ++ vps.ext;
|
||||||
|
|
||||||
AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext ;
|
AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext ;
|
||||||
A2 = \a2 -> a2.s ! Posit ! APred ++ a2.c2.s ;
|
A2 = \a2 -> a2.s ! Posit ! APred ++ a2.c2.s ;
|
||||||
|
|||||||
@@ -36,19 +36,19 @@ lin
|
|||||||
|
|
||||||
bottle_of_CN np = N.ApposCN (mkCN (mkN "Flasche")) np ;
|
bottle_of_CN np = N.ApposCN (mkCN (mkN "Flasche")) np ;
|
||||||
cup_of_CN np = N.ApposCN (mkCN (mkN "Tasse")) np ;
|
cup_of_CN np = N.ApposCN (mkCN (mkN "Tasse")) np ;
|
||||||
glass_of_CN np = N.ApposCN (mkCN (mkN "Glas")) np ;
|
glass_of_CN np = N.ApposCN (mkCN (mkN "Glas" "Gläser" neuter)) np ;
|
||||||
|
|
||||||
-- spatial deixis and motion verbs
|
-- spatial deixis and motion verbs
|
||||||
where_go_QCl np = mkQCl (lin IAdv (ss "wohin")) (mkCl np (mkVP L.go_V)) ;
|
where_go_QCl np = mkQCl (lin IAdv (ss "wohin")) (mkCl np (mkVP L.go_V)) ;
|
||||||
where_come_from_QCl np = mkQCl (lin IAdv (ss "woher")) (mkCl np (mkVP L.come_V)) ;
|
where_come_from_QCl np = mkQCl (lin IAdv (ss "woher")) (mkCl np (mkVP L.come_V)) ;
|
||||||
|
|
||||||
go_here_VP = mkVP (mkVP L.go_V) (mkAdv "her") ;
|
go_here_VP = mkVP (mkVP L.go_V) (ParadigmsGer.mkAdv "her") ;
|
||||||
come_here_VP = mkVP (mkVP L.come_V) (mkAdv "her") ;
|
come_here_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "her") ;
|
||||||
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "von hier") ;
|
come_from_here_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "von hier") ;
|
||||||
|
|
||||||
go_there_VP = mkVP (mkVP L.go_V) (mkAdv "hin") ;
|
go_there_VP = mkVP (mkVP L.go_V) (ParadigmsGer.mkAdv "hin") ;
|
||||||
come_there_VP = mkVP (mkVP L.come_V) (mkAdv "hin") ;
|
come_there_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "hin") ;
|
||||||
come_from_there_VP = mkVP (mkVP L.come_V) (mkAdv "von dort") ;
|
come_from_there_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "von dort") ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Weekday = N ;
|
Weekday = N ;
|
||||||
|
|||||||
@@ -15315,6 +15315,7 @@ lin
|
|||||||
glans_N = mkN "Glans" "Glandes" feminine ;
|
glans_N = mkN "Glans" "Glandes" feminine ;
|
||||||
glanzleistung_N = mkN "Glanzleistung" ;
|
glanzleistung_N = mkN "Glanzleistung" ;
|
||||||
glaren_V = regV "glaren" ;
|
glaren_V = regV "glaren" ;
|
||||||
|
glas_N = mkN "Glas" "Gläser" neuter ;
|
||||||
glasampulle_N = mkN "Glasampulle" "Glasampullen" feminine ;
|
glasampulle_N = mkN "Glasampulle" "Glasampullen" feminine ;
|
||||||
glasauge_N = mkN "Glasauge" "Glasaugen" neuter ;
|
glasauge_N = mkN "Glasauge" "Glasaugen" neuter ;
|
||||||
glasbaustein_N = mkN "Glasbaustein" "Glasbausteine" masculine ;
|
glasbaustein_N = mkN "Glasbaustein" "Glasbausteine" masculine ;
|
||||||
|
|||||||
@@ -15313,6 +15313,7 @@ fun
|
|||||||
glans_N : N ;
|
glans_N : N ;
|
||||||
glanzleistung_N : N ;
|
glanzleistung_N : N ;
|
||||||
glaren_V : V ;
|
glaren_V : V ;
|
||||||
|
glas_N : N ;
|
||||||
glasampulle_N : N ;
|
glasampulle_N : N ;
|
||||||
glasauge_N : N ;
|
glasauge_N : N ;
|
||||||
glasbaustein_N : N ;
|
glasbaustein_N : N ;
|
||||||
|
|||||||
@@ -147,8 +147,8 @@ lin
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
NoDefinition t = {s=t.s};
|
NoDefinition t = {s=t.s};
|
||||||
MkDefinition t d = {s="<p><b>Definierung:</b>"++t.s++d.s++"</p>"};
|
MkDefinition t d = {s="<p><b>Definition:</b>"++t.s++d.s++"</p>"};
|
||||||
MkDefinitionEx t d e = {s="<p><b>Definierung:</b>"++t.s++d.s++"</p><p><b>Beispiel:</b>"++e.s++"</p>"};
|
MkDefinitionEx t d e = {s="<p><b>Definition:</b>"++t.s++d.s++"</p><p><b>Beispiel:</b>"++e.s++"</p>"};
|
||||||
|
|
||||||
MkDocument d i e = ss (i.s1 ++ d.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
MkDocument d i e = ss (i.s1 ++ d.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||||
MkTag i = ss i.t ;
|
MkTag i = ss i.t ;
|
||||||
|
|||||||
@@ -35,9 +35,8 @@ lin
|
|||||||
ConjVPI = conjunctDistrTable Bool ;
|
ConjVPI = conjunctDistrTable Bool ;
|
||||||
|
|
||||||
ComplVPIVV v vpi =
|
ComplVPIVV v vpi =
|
||||||
-- insertInf (vpi.s ! v.isAux) (
|
insertInf {inpl = <\\_ => [], (vpi.s ! v.isAux)> ; extr = \\_ => []} -- HL 3/22
|
||||||
insertInf {s=(vpi.s ! v.isAux);isAux=v.isAux;ctrl=SubjC} ( -- HL ??
|
(predVGen v.isAux v) ;
|
||||||
predVGen v.isAux v) ; ----
|
|
||||||
|
|
||||||
BaseVPS = twoTable2 Order Agr ;
|
BaseVPS = twoTable2 Order Agr ;
|
||||||
ConsVPS = consrTable2 Order Agr comma ;
|
ConsVPS = consrTable2 Order Agr comma ;
|
||||||
@@ -70,37 +69,46 @@ lin
|
|||||||
m = tm.m ;
|
m = tm.m ;
|
||||||
subj = [] ;
|
subj = [] ;
|
||||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||||
|
haben = verb.inf2 ;
|
||||||
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
|
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
|
||||||
-- obj1 = (vp.nn ! agr).p1 ;
|
-- obj1 = (vp.nn ! agr).p1 ;
|
||||||
-- obj = (vp.nn ! agr).p2 ;
|
-- obj = (vp.nn ! agr).p2 ;
|
||||||
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
||||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ nonpronouns
|
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
||||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
|
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
||||||
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||||
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
||||||
inf = vp.inf.s ++ verb.inf ++ verb.inf2 ;
|
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
|
||||||
extra = vp.ext ;
|
infPred = vp.inf.inpl.p2 ;
|
||||||
infE : Str = -- HL 30/6/2019
|
infCompl : Str = case <t,a,vp.isAux> of {
|
||||||
case <t,a,vp.isAux> of {
|
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||||
<Fut|Cond,Simul,True> => inf ; --# notpresent
|
_ => infObjs ++ infPred } ;
|
||||||
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
|
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||||
=> verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
<Fut|Cond,Anter,True> => --# notpresent
|
||||||
<_,Anter,True> => inf ; --# notpresent
|
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||||
_ => verb.inf ++ verb.inf2 ++ vp.inf.s } ;
|
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||||
inffin : Str =
|
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||||
case <t,a,vp.isAux> of {
|
<_,Anter,True> => --# notpresent
|
||||||
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
|
{inf = verb.inf ++ haben ; --# notpresent
|
||||||
=> verb.fin ++ verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||||
<_,Anter,True> --# notpresent
|
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||||
=> verb.fin ++ inf ; -- double inf --# notpresent
|
<Pres,_,_> =>
|
||||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
{inf = verb.inf ++ haben ;
|
||||||
} ;
|
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||||
|
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||||
|
; --# notpresent
|
||||||
|
_ => --# notpresent
|
||||||
|
{inf = verb.inf ++ haben ; --# notpresent
|
||||||
|
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||||
|
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||||
|
} ;
|
||||||
|
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ infE ++ extra ;
|
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||||
Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ infE ++ extra ;
|
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||||
Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra
|
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete ExtraGer of ExtraGerAbs = CatGer **
|
concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||||
open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer) in {
|
open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer), (N = NounGer) in {
|
||||||
flags coding=utf8 ;
|
flags coding=utf8 ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
@@ -12,16 +12,9 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
|||||||
MkVPI vp = {s = \\b => useInfVP b vp} ;
|
MkVPI vp = {s = \\b => useInfVP b vp} ;
|
||||||
ConjVPI = conjunctDistrTable Bool ;
|
ConjVPI = conjunctDistrTable Bool ;
|
||||||
|
|
||||||
ComplVPIVV v vpi =
|
ComplVPIVV v vpi =
|
||||||
-- insertInf (vpi.s ! v.isAux) (
|
insertInf {inpl = <\\_ => [], (vpi.s ! v.isAux)> ; extr = \\_ => []} -- HL 3/22
|
||||||
insertInf {s=(vpi.s ! v.isAux);isAux=v.isAux;ctrl=SubjC} ( -- HL ??
|
(predVGen v.isAux v) ;
|
||||||
predVGen v.isAux v) ; ----
|
|
||||||
{-
|
|
||||||
insertExtrapos vpi.p3 (
|
|
||||||
insertInf vpi.p2 (
|
|
||||||
insertObj vpi.p1 (
|
|
||||||
predVGen v.isAux v))) ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
PPzuAdv cn = {s = case cn.g of {
|
PPzuAdv cn = {s = case cn.g of {
|
||||||
Masc | Neutr => "zum" ;
|
Masc | Neutr => "zum" ;
|
||||||
@@ -33,27 +26,23 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
|||||||
|
|
||||||
moegen_VV = auxVV mögen_V ;
|
moegen_VV = auxVV mögen_V ;
|
||||||
|
|
||||||
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred ;
|
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred ;
|
||||||
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext} ;
|
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext} ;
|
||||||
|
|
||||||
CompIQuant iq = {s = table {Ag g n p => iq.s ! n ! g ! Nom} ; ext = ""} ;
|
CompIQuant iq = {s = table {Ag g n p => iq.s ! n ! g ! Nom} ; ext = ""} ;
|
||||||
|
|
||||||
IAdvAdv adv = {s = "wie" ++ adv.s} ;
|
IAdvAdv adv = {s = "wie" ++ adv.s} ;
|
||||||
|
|
||||||
DetNPMasc det = {
|
DetNPMasc det = {
|
||||||
s = \\c => det.sp ! Masc ! c ; ---- genders
|
s = \\c => det.sp ! Masc ! c ;
|
||||||
a = agrP3 det.n ;
|
a = agrgP3 Masc det.n ;
|
||||||
-- isPron = False ;
|
|
||||||
-- isLight = True ;
|
|
||||||
w = WLight ;
|
w = WLight ;
|
||||||
ext, rc = []
|
ext, rc = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetNPFem det = {
|
DetNPFem det = {
|
||||||
s = \\c => det.sp ! Fem ! c ; ---- genders
|
s = \\c => det.sp ! Fem ! c ;
|
||||||
a = agrP3 det.n ;
|
a = agrgP3 Fem det.n ;
|
||||||
-- isPron = False ;
|
|
||||||
-- isLight = True ;
|
|
||||||
w = WLight ;
|
w = WLight ;
|
||||||
ext, rc = []
|
ext, rc = []
|
||||||
} ;
|
} ;
|
||||||
@@ -66,37 +55,36 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
PassVPSlash vp =
|
PassVPSlash vp =
|
||||||
let c = case <vp.c2.c,vp.c2.isPrep> of {
|
insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
|
||||||
<NPC Acc,False> => NPC Nom ;
|
{ c1 = subjPrep vp.c2 } ;
|
||||||
_ => vp.c2.c}
|
-- this also gives "mit dir wird gerechnet" ;
|
||||||
in insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
|
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
|
||||||
{subjc = vp.c2 ** {c= c}} ;
|
|
||||||
-- regulates passivised object: accusative objects -> nom; all others: same case
|
|
||||||
-- this also gives "mit dir wird gerechnet" ;
|
|
||||||
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
|
|
||||||
|
|
||||||
PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
|
PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
|
||||||
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
|
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
|
||||||
|
|
||||||
Pass3V3 v = -- HL 7/19
|
Pass3V3 v = -- HL 7/19
|
||||||
let bekommenPass : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen")
|
let bekommen : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen")
|
||||||
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommenPass) ** { subjc = PrepNom ; c2 = v.c2 } ;
|
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommen) **
|
||||||
|
{ c1 = PrepNom ; c2 = v.c2 ; objCtrl = False } ;
|
||||||
|
|
||||||
PastPartAP vp = {
|
PastPartAP vp =
|
||||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ vp.inf.s ++
|
let a = agrP3 Sg in {
|
||||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj
|
||||||
isPre = True ;
|
++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||||
c = <[],[]> ;
|
isPre = True ;
|
||||||
ext = []
|
c = <[],[]> ;
|
||||||
|
ext = vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PastPartAgentAP vp np =
|
PastPartAgentAP vp np =
|
||||||
let agent = appPrepNP P.von_Prep np
|
let a = agrP3 Sg ;
|
||||||
in {
|
agent = appPrepNP P.von_Prep np
|
||||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ agent ++
|
in {
|
||||||
vp.inf.s ++
|
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3
|
||||||
vp.c2.s ++ --- junk if not TV
|
++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2
|
||||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
++ vp.c2.s -- junk if not TV
|
||||||
|
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||||
isPre = True ;
|
isPre = True ;
|
||||||
c = <[],[]> ;
|
c = <[],[]> ;
|
||||||
ext = []
|
ext = []
|
||||||
@@ -136,113 +124,217 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
|||||||
a = tm.a ;
|
a = tm.a ;
|
||||||
t = tm.t ;
|
t = tm.t ;
|
||||||
m = tm.m ;
|
m = tm.m ;
|
||||||
subj = [] ;
|
subj = [] ++ tm.s ++ p.s ;
|
||||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||||
|
haben = verb.inf2 ;
|
||||||
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
|
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
|
||||||
-- obj1 = (vp.nn ! agr).p1 ;
|
-- obj1 = (vp.nn ! agr).p1 ;
|
||||||
-- obj = (vp.nn ! agr).p2 ;
|
-- obj = (vp.nn ! agr).p2 ;
|
||||||
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
||||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ nonpronouns
|
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
||||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
|
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
||||||
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||||
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
||||||
inf = vp.inf.s ++ verb.inf ++ verb.inf2 ;
|
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
|
||||||
extra = vp.ext ;
|
infPred = vp.inf.inpl.p2 ;
|
||||||
infE : Str = -- HL 30/6/2019
|
infCompl : Str = case <t,a,vp.isAux> of {
|
||||||
case <t,a,vp.isAux> of {
|
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||||
<Fut|Cond,Simul,True> => inf ; --# notpresent
|
_ => infObjs ++ infPred } ;
|
||||||
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
|
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||||
=> verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
<Fut|Cond,Anter,True> => --# notpresent
|
||||||
<_,Anter,True> => inf ; --# notpresent
|
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||||
_ => verb.inf ++ verb.inf2 ++ vp.inf.s } ;
|
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||||
inffin : Str =
|
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||||
case <t,a,vp.isAux> of {
|
<_,Anter,True> => --# notpresent
|
||||||
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
|
{inf = verb.inf ++ haben ; --# notpresent
|
||||||
=> verb.fin ++ verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||||
<_,Anter,True> --# notpresent
|
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||||
=> verb.fin ++ inf ; -- double inf --# notpresent
|
<Pres,_,_> =>
|
||||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
{inf = verb.inf ++ haben ;
|
||||||
} ;
|
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||||
|
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||||
|
; --# notpresent
|
||||||
|
_ => --# notpresent
|
||||||
|
{inf = verb.inf ++ haben ; --# notpresent
|
||||||
|
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||||
|
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||||
|
} ;
|
||||||
|
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ infE ++ extra ;
|
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||||
Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ infE ++ extra ;
|
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||||
Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra
|
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||||
|
|
||||||
|
-- Reflexive noun phrases -- (HL 5/2022: improved and completed, RNPList added)
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
RNP = {s : Agr => Case => Str} ;
|
RNP = {s : Agr => Case => Str ; rc,ext : Str ; isPron : Bool} ;
|
||||||
|
RNPList = {s1,s2 : Agr => Case => Str} ;
|
||||||
|
|
||||||
|
linref
|
||||||
|
RNP = \rnp -> rnp.s ! (Ag Masc Sg P3) ! Acc ++ rnp.ext ++ rnp.rc ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ReflRNP vps rnp =
|
ReflRNP vps rnp =
|
||||||
insertObj (\\a => appPrep vps.c2
|
insertObjReflNP vps rnp ;
|
||||||
(\\k => usePrepC k (\c -> rnp.s ! a ! c))) vps ;
|
|
||||||
|
|
||||||
ReflPoss num cn = {s = \\a,c => num.s ! cn.g ! c ++ possPron a num.n cn.g c ++ cn.s ! adjfCase Strong c ! num.n ! c} ;
|
ReflPron = { -- personal pronoun, with "sich" in P3 Sg
|
||||||
|
s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ;
|
||||||
|
|
||||||
-- implementation of some of the relevant Foc rules from Extra
|
-- We might define ReflPron by the stronger reflPronSelf below, using "selbst"
|
||||||
|
-- to distinguish personal pronoun from reflexive pronoun:
|
||||||
|
-- du kennst mich vs. ich kenne mich selbst
|
||||||
|
-- er kennt ihn vs. er kennt sich (selbst)
|
||||||
|
-- sie kennen sich (selbst) =/= sie kennen einander
|
||||||
|
|
||||||
|
ReflPoss num cn =
|
||||||
|
{s = \\a,c => let adjf = case num.n of {Sg => Strong ; Pl => Weak} -- Duden 477, HL 5/2022
|
||||||
|
in possPron a num.n cn.g c ++ num.s ! cn.g ! c -- HL 5/2022: meine wenigstens 3 cn,
|
||||||
|
++ cn.s ! adjfCase adjf c ! num.n ! c -- not: wenigstens 3 meine cn
|
||||||
|
++ cn.adv ;
|
||||||
|
ext = cn.ext ; rc = cn.rc ! num.n ;
|
||||||
|
isPron = False} ;
|
||||||
|
|
||||||
|
-- We might define ReflPoss by the stronger reflPossPron below, using "eigen(er)"
|
||||||
|
-- to distinguish possessive pronoun from reflexive possessive pronoun:
|
||||||
|
-- du kennst meine Fehler vs. ich kenne meine eigenen Fehler
|
||||||
|
-- er|sie|es kennt seine|ihre Fehler vs. er|sie|es kennt seine|ihre|seine eigenen Fehler
|
||||||
|
|
||||||
|
PredetRNP pred rnp = rnp ** { -- HL 5/2022
|
||||||
|
s = \\a,c => let n = case pred.a of {PAg n => n ; _ => numberAgr a} ;
|
||||||
|
g = genderAgr a ;
|
||||||
|
d = case pred.c.k of {NoCase => c ; PredCase k => (prepC k).c} ;
|
||||||
|
in case rnp.isPron of {
|
||||||
|
True => pred.s ! Pl ! Masc ! (NPC c) ++ "von" ++ rnp.s ! a ! Dat ;
|
||||||
|
_ => pred.s ! n ! genderAgr a ! (NPC c) ++ pred.c.p ++ rnp.s ! a ! d} ;
|
||||||
|
ext = rnp.ext ; rc = rnp.rc ;
|
||||||
|
isPron = False} ;
|
||||||
|
-- ok: alle von uns; die meisten von uns ; wrong: *nur von uns =/= nur wir
|
||||||
|
|
||||||
|
AdvRNP np prep rnp = {s = \\a,c => np.s ! (NPC c)
|
||||||
|
++ appPrepC prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ;
|
||||||
|
ext = np.ext ; rc = np.rc ; isPron = False} ;
|
||||||
|
|
||||||
|
AdvRAP ap prep rnp =
|
||||||
|
let -- ? adv ++ ap.s ! af
|
||||||
|
adv = appPrepC prep (rnp.s ! agrP3 Sg) ; -- bug: fixed agreement
|
||||||
|
in ap ** { s = \\af => ap.s ! af ++ adv } ; -- e.g. unknown in one's youth
|
||||||
|
|
||||||
|
ReflA2RNP adj rnp = -- would need AP.c : Agr => Str*Str, not AP.c : Str*Str
|
||||||
|
let -- as we have no reflexive AP,
|
||||||
|
compl = appPrepC adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement
|
||||||
|
in {
|
||||||
|
s = adj.s ! Posit ;
|
||||||
|
isPre = True ;
|
||||||
|
c = case adj.c2.isPrep of {False => <compl, []> ; True => <[], compl>} ;
|
||||||
|
ext = rnp.ext ++ rnp.rc
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PossPronRNP pron num cn rnp =
|
||||||
|
N.DetCN (N.DetQuant (N.PossPron pron) num)
|
||||||
|
(N.PossNP cn (lin NP {s = \\pc => usePrepC pc (\c -> rnp.s ! pron.a ! c) ;
|
||||||
|
a = pron.a ;
|
||||||
|
w = WLight ;
|
||||||
|
ext = rnp.ext ;
|
||||||
|
rc = rnp.rc})) ;
|
||||||
|
|
||||||
|
-- AdvRVP : VP -> Prep -> RNP -> VP not implemented, as the reflexive adverb (Prep + RNP): Agr => Str
|
||||||
|
-- could only be added to vp.a2:Str with fixed agreement, but can depend on nominal subject or object,
|
||||||
|
-- e.g. "er spricht mit ihr über sein Kind" vs. "er spricht mit ihr über ihr Kind".
|
||||||
|
|
||||||
|
ConjRNP conj rnps = conjunctDistrTable2 Agr Case conj rnps
|
||||||
|
** {isPron = False ; ext,rc = []} ;
|
||||||
|
|
||||||
|
Base_rr_RNP x y = twoTable2 Agr Case x y ;
|
||||||
|
Base_nr_RNP x y = twoTable2 Agr Case {s = \\_,c => x.s ! (NPC c) ++ x.ext ++ x.rc} y ;
|
||||||
|
Base_rn_RNP x y = twoTable2 Agr Case x {s = \\_,c => y.s ! (NPC c) ++ y.ext ++ y.rc} ;
|
||||||
|
|
||||||
|
Cons_rr_RNP x xs = consrTable2 Agr Case comma x xs ;
|
||||||
|
Cons_nr_RNP x xs = consrTable2 Agr Case comma {s = \\_,c => x.s ! (NPC c) ++ x.ext ++ x.rc} xs ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ;
|
||||||
|
|
||||||
|
reflPossPron : Agr -> Number -> Gender -> Case -> Str =
|
||||||
|
let eigen = adjForms "eigen" "eigen" in
|
||||||
|
\a,n,g,c -> possPron a n g c ++ (eigen ! (AMod (gennum g n) c)) ;
|
||||||
|
|
||||||
|
insertObjReflNP : ResGer.VPSlash -> RNP -> ResGer.VP = -- HL 5/2022
|
||||||
|
\vp,rnp -> -- generalize ResGer.insertObjRefl
|
||||||
|
let prep = vp.c2 ;
|
||||||
|
c = case prep.c of { NPC cc => cc ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ?
|
||||||
|
obj : Agr => Str = \\a => prep.s ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc
|
||||||
|
in vp ** {
|
||||||
|
nn = \\a =>
|
||||||
|
let vpnn = vp.nn ! a in
|
||||||
|
case <prep.isPrep, rnp.isPron, c> of { -- consider non-pron rnp as light, add to vpnn.p2
|
||||||
|
<False,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch:
|
||||||
|
<False,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron
|
||||||
|
<False,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal
|
||||||
|
<True,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- SS: implementation of some of the relevant Foc rules from Extra
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;
|
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
FocObj np cl =
|
FocObj np cl =
|
||||||
let n = appPrepNP cl.c2 np
|
let n = appPrepNP cl.c2 np in mkFoc n cl ;
|
||||||
in mkFoc n cl ;
|
|
||||||
|
|
||||||
FocAdv adv cl = mkFoc adv.s cl ;
|
FocAdv adv cl = mkFoc adv.s cl ;
|
||||||
|
|
||||||
FocAP ap np =
|
FocAP ap np =
|
||||||
let adj = ap.s ! APred ;
|
let adj = ap.s ! APred ;
|
||||||
vp = predV sein_V ** {ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext};
|
vp = predV ResGer.sein_V ** {ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext};
|
||||||
-- potentially not correct analysis for all examples
|
-- potentially not correct analysis for all examples
|
||||||
-- works for:
|
-- works for:
|
||||||
-- "treu ist sie ihm"
|
-- "treu ist sie ihm"
|
||||||
-- "froh ist sie dass er da ist"
|
-- "froh ist sie dass er da ist"
|
||||||
-- "stolz ist sie auf ihn"
|
-- "stolz ist sie auf ihn"
|
||||||
subj = mkSubj np vp.subjc ;
|
subj = mkSubj np vp.c1 ;
|
||||||
cl = mkClause subj.p1 subj.p2 vp
|
cl = mkClause subj.p1 subj.p2 vp
|
||||||
in mkFoc adj cl ;
|
in mkFoc adj cl ;
|
||||||
|
|
||||||
UseFoc t p f = {s = t.s ++ p.s ++ f.s ! t.m ! t.t ! t.a ! p.p} ;
|
UseFoc t p f = {s = t.s ++ p.s ++ f.s ! t.m ! t.t ! t.a ! p.p} ;
|
||||||
|
|
||||||
|
|
||||||
-- extra rules to get some of the "es" alternative linearisations
|
-- extra rules to get some of the "es" alternative linearisations
|
||||||
|
|
||||||
lin
|
lin
|
||||||
EsVV vv vp = predV vv ** {
|
EsVV vv vp = -- HL 3/2022
|
||||||
nn = \\a => let n = vp.nn ! a in <"es" ++ n.p1, n.p2, n.p3, n.p4, n.p5, n.p6> ;
|
let inf = mkInf False Simul Pos vp ; -- False = force extraction
|
||||||
inf = vp.inf ** {s = vp.s.s ! (VInf True) ++ vp.inf.s} ; -- ich genieße es zu versuchen zu gehen; alternative word order could be produced by vp.inf ++ vp.s.s... (zu gehen zu versuchen)
|
objs : Agr => Str * Str * Str * Str = \\a => <"es",[],[],[]> ;
|
||||||
a1 = vp.a1 ;
|
vps = predV vv ** { nn = objs }
|
||||||
a2 = vp.a2 ;
|
in insertExtrapos vp.ext (
|
||||||
ext = vp.ext ;
|
insertInf inf vps) ;
|
||||||
infExt = vp.infExt ;
|
|
||||||
adj = vp.adj } ;
|
EsV2A v2a ap s = predV v2a ** {
|
||||||
|
nn = \\_ => <"es",[],[],[]> ;
|
||||||
EsV2A v2a ap s = predV v2a ** {
|
adj = ap.s ! APred ;
|
||||||
nn = \\_ => <"es",[],[],[],[],[]> ;
|
ext = "," ++ conjThat ++ s.s ! Sub} ;
|
||||||
adj = ap.s ! APred ;
|
|
||||||
ext = "," ++ "dass" ++ s.s ! Sub} ;
|
|
||||||
|
|
||||||
-- "es wird gelacht"; generating formal sentences
|
-- "es wird gelacht"; generating formal sentences
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
FClause = ResGer.VP ** {subj : ResGer.NP} ;
|
FClause = ResGer.VP ** {subj : ResGer.NP} ;
|
||||||
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
VPass v =
|
VPass v =
|
||||||
let vp = predV werdenPass ;
|
let vp = predV werdenPass
|
||||||
in vp ** {
|
in vp ** {subj = esSubj ;
|
||||||
subj = esSubj ;
|
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
|
||||||
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
|
|
||||||
|
|
||||||
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
|
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
|
||||||
|
|
||||||
FtoCl cl =
|
FtoCl cl =
|
||||||
let subj = mkSubj cl.subj cl.subjc
|
let subj = mkSubj cl.subj cl.c1
|
||||||
in DisToCl subj.p1 subj.p2 cl ;
|
in DisToCl subj.p1 subj.p2 cl ;
|
||||||
|
|
||||||
|
|
||||||
@@ -251,16 +343,14 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
|||||||
mkFoc : Str -> Cl -> Foc = \focus, cl ->
|
mkFoc : Str -> Cl -> Foc = \focus, cl ->
|
||||||
lin Foc {s = \\m,t,a,p => focus ++ cl.s ! m ! t ! a ! p ! Inv} ;
|
lin Foc {s = \\m,t,a,p => focus ++ cl.s ! m ! t ! a ! p ! Inv} ;
|
||||||
|
|
||||||
esSubj : NP = lin NP {
|
esSubj : CatGer.NP = lin NP {
|
||||||
s = \\_ => "es" ;
|
s = \\_ => "es" ;
|
||||||
rc, ext = [] ;
|
rc, ext = [] ;
|
||||||
a = Ag Neutr Sg P3 ;
|
a = Ag Neutr Sg P3 ;
|
||||||
-- isLight = True ;
|
w = WPron
|
||||||
-- isPron = True
|
} ;
|
||||||
w = WPron
|
|
||||||
} ;
|
|
||||||
|
|
||||||
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
|
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
|
||||||
let vps = useVP vp in {
|
let vps = useVP vp in {
|
||||||
s = \\m,t,a,b,o =>
|
s = \\m,t,a,b,o =>
|
||||||
let
|
let
|
||||||
@@ -273,20 +363,23 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
|||||||
obj1 = (vp.nn ! agr).p1 ;
|
obj1 = (vp.nn ! agr).p1 ;
|
||||||
obj2 = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ;
|
obj2 = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ;
|
||||||
compl = obj1 ++ neg ++ vp.adj ++ obj2 ++ vp.a2 ; -- adj added
|
compl = obj1 ++ neg ++ vp.adj ++ obj2 ++ vp.a2 ; -- adj added
|
||||||
inf = vp.inf.s ++ verb.inf ; -- not used for linearisation of Main/Inv
|
inf = vp.inf.inpl.p2 ++ verb.inf ; -- not used for linearisation of Main/Inv
|
||||||
|
infExt = vp.inf.extr ! agr ;
|
||||||
extra = vp.ext ;
|
extra = vp.ext ;
|
||||||
inffin : Str =
|
inffin : Str =
|
||||||
case <a,vp.isAux> of {
|
case <a,vp.isAux> of {
|
||||||
<Anter,True> => verb.fin ++ inf ; -- double inf --# notpresent
|
<Anter,True> => verb.fin ++ inf ; -- double inf --# notpresent
|
||||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
|
Main => subj ++ verb.fin ++ compl ++ infExt ++ verb.inf ++ extra ++ vp.inf.inpl.p2 ;
|
||||||
Inv => verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
|
Inv => verb.fin ++ compl ++ infExt ++ verb.inf ++ extra ++ vp.inf.inpl.p2 ; -- vp.inf.s ;
|
||||||
Sub => compl ++ vp.infExt ++ inffin ++ extra }
|
Sub => compl ++ infExt ++ inffin ++ extra }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- this function is not entirely satisfactory as largely
|
-- this function is not entirely satisfactory as largely
|
||||||
-- though not entirely duplicating mkClause in ResGer
|
-- though not entirely duplicating mkClause in ResGer
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ abstract ExtraGerAbs = Extra [
|
|||||||
VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP,
|
VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP,
|
||||||
Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP,
|
Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP,
|
||||||
Foc,FocObj,FocAdv,FocAP,UseFoc,
|
Foc,FocObj,FocAdv,FocAP,UseFoc,
|
||||||
RNP,ReflRNP,ReflPoss
|
RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP
|
||||||
|
,RNPList,ConjRNP,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP
|
||||||
|
,DetNPMAsc,DetNPFem
|
||||||
] ** {
|
] ** {
|
||||||
flags coding=utf8;
|
flags coding=utf8;
|
||||||
|
|
||||||
cat
|
cat
|
||||||
FClause ; -- formal clause
|
FClause ; -- formal clause
|
||||||
|
|
||||||
fun
|
fun
|
||||||
PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche
|
PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche
|
||||||
TImpfSubj : Tense ; -- ich möchte... --# notpresent
|
TImpfSubj : Tense ; -- ich möchte... --# notpresent
|
||||||
@@ -26,5 +27,16 @@ abstract ExtraGerAbs = Extra [
|
|||||||
AdvFor : Adv -> FClause -> FClause ; -- es wird heute gelacht - addition of adverbs
|
AdvFor : Adv -> FClause -> FClause ; -- es wird heute gelacht - addition of adverbs
|
||||||
FtoCl : FClause -> Cl ; -- embedding FClause within the RGL, to allow generation of S, Utt, etc.
|
FtoCl : FClause -> Cl ; -- embedding FClause within the RGL, to allow generation of S, Utt, etc.
|
||||||
|
|
||||||
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
|
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
|
||||||
|
|
||||||
|
-- further constructions usin RNP, declared in abstract/Extra.gf:
|
||||||
|
|
||||||
|
AdvRNP : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife
|
||||||
|
AdvRVP : VP -> Prep -> RNP -> VP ; -- lectured about her travels
|
||||||
|
AdvRAP : AP -> Prep -> RNP -> AP ; -- adamant in his refusal
|
||||||
|
|
||||||
|
ReflA2RNP : A2 -> RNP -> AP ; -- indifferent to their surroundings
|
||||||
|
-- NOTE: generalizes ReflA2
|
||||||
|
|
||||||
|
PossPronRNP : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ concrete IdiomGer of Idiom = CatGer **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
ImpP3 np vp = {
|
ImpP3 np vp = {
|
||||||
s = (mkClause ((mkSubj np vp.subjc).p1) np.a vp).s !
|
s = (mkClause ((mkSubj np vp.c1).p1) np.a vp).s !
|
||||||
MConjunct ! Pres ! Simul ! Pos ! Inv
|
MConjunct ! Pres ! Simul ! Pos ! Inv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,13 @@ oper
|
|||||||
mkPrep : Str -> PCase -> Preposition = \s,c ->
|
mkPrep : Str -> PCase -> Preposition = \s,c ->
|
||||||
{s = s ; s2 = [] ; c = c ; isPrep = True} ;
|
{s = s ; s2 = [] ; c = c ; isPrep = True} ;
|
||||||
|
|
||||||
nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ;
|
nameNounPhrase : Gender -> {s : Case => Str} -> {s : PCase => Str ;
|
||||||
-- isLight, isPron : Bool ;
|
a : Agr ;
|
||||||
w : Weight ;
|
w : Weight ;
|
||||||
ext,rc : Str} = \name -> heavyNP {
|
ext,rc : Str} =
|
||||||
|
\g,name -> heavyNP {
|
||||||
s = \\c => usePrepC c (\k -> name.s ! k) ;
|
s = \\c => usePrepC c (\k -> name.s ! k) ;
|
||||||
a = agrP3 Sg
|
a = agrgP3 g Sg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
detLikeAdj : Bool -> Number -> Str ->
|
detLikeAdj : Bool -> Number -> Str ->
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ oper
|
|||||||
dative : Case ;
|
dative : Case ;
|
||||||
genitive : Case ;
|
genitive : Case ;
|
||||||
|
|
||||||
anDat_Case : Case ; -- preposition "an" accusative with contraction "am" --%
|
anDat_Case : Case ; -- preposition "an" dative with contraction "am" --%
|
||||||
inAcc_Case : Case ; -- preposition "in" accusative with contraction "ins" --%
|
inAcc_Case : Case ; -- preposition "in" accusative with contraction "ins" --%
|
||||||
inDat_Case : Case ; -- preposition "in" dative with contraction "im" --%
|
inDat_Case : Case ; -- preposition "in" dative with contraction "im" --%
|
||||||
zuDat_Case : Case ; -- preposition "zu" dative with contractions "zum", "zur" --%
|
zuDat_Case : Case ; -- preposition "zu" dative with contractions "zum", "zur" --%
|
||||||
@@ -607,17 +607,17 @@ mkV2 : overload {
|
|||||||
|
|
||||||
mkV2V = overload { -- default: object-control
|
mkV2V = overload { -- default: object-control
|
||||||
mkV2V : V -> V2V
|
mkV2V : V -> V2V
|
||||||
= \v -> dirV2 v ** {isAux = False ; ctrl = ObjC ; lock_V2V = <>} ;
|
= \v -> dirV2 v ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ; -- ermahne jmdn, sich zu waschen
|
||||||
mkV2V : V -> Prep -> V2V
|
mkV2V : V -> Prep -> V2V
|
||||||
= \v,p -> prepV2 v p ** {isAux = False ; ctrl = ObjC ; lock_V2V = <>} ;
|
= \v,p -> prepV2 v p ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ;
|
||||||
} ;
|
} ;
|
||||||
auxV2V = overload {
|
auxV2V = overload {
|
||||||
auxV2V : V -> V2V
|
auxV2V : V -> V2V
|
||||||
= \v -> dirV2 v ** {isAux = True ; ctrl = ObjC ; lock_V2V = <>} ;
|
= \v -> dirV2 v ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ; -- lasse jmdn sich waschen
|
||||||
auxV2V : V -> Prep -> V2V
|
auxV2V : V -> Prep -> V2V
|
||||||
= \v,p -> prepV2 v p ** {isAux = True ; ctrl = ObjC ; lock_V2V = <>} ;
|
= \v,p -> prepV2 v p ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ;
|
||||||
} ;
|
} ;
|
||||||
subjV2V v = v ** {ctrl = SubjC} ;
|
subjV2V v = v ** {objCtrl = False} ;
|
||||||
|
|
||||||
mkV2A = overload {
|
mkV2A = overload {
|
||||||
mkV2A : V -> V2A
|
mkV2A : V -> V2A
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ open MorphoGer, ResGer, ParadigmsGer, SyntaxGer, Prelude, HTML in {
|
|||||||
flags literal=Symb ; coding = utf8 ;
|
flags literal=Symb ; coding = utf8 ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ComplVV v ant p vp =
|
{- ComplVV v ant p vp =
|
||||||
let
|
let
|
||||||
vpi = infVP v.isAux vp
|
vpi = infVP v.isAux vp
|
||||||
in
|
in
|
||||||
@@ -35,6 +35,14 @@ lin
|
|||||||
insertInf vpi.p2 (
|
insertInf vpi.p2 (
|
||||||
insertObj vpi.p1 (
|
insertObj vpi.p1 (
|
||||||
predVGen v.isAux v)))) ;
|
predVGen v.isAux v)))) ;
|
||||||
|
-}
|
||||||
|
ComplVV v ant pol vp = -- HL 4/22
|
||||||
|
let
|
||||||
|
vps = predVGen v.isAux v ;
|
||||||
|
inf = mkInf v.isAux ant pol vp
|
||||||
|
in
|
||||||
|
insertExtrapos vp.ext (
|
||||||
|
insertInf inf vps) ;
|
||||||
|
|
||||||
PastPartRS ant pol sl = { -- guessed by KA, some fields in sl are ignored!!
|
PastPartRS ant pol sl = { -- guessed by KA, some fields in sl are ignored!!
|
||||||
s = \\gn => let agr = agrgP3 Masc (numGenNum gn)
|
s = \\gn => let agr = agrgP3 Masc (numGenNum gn)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
|
|||||||
s = \\m,t,a,p =>
|
s = \\m,t,a,p =>
|
||||||
let
|
let
|
||||||
vp = predV sein_V ** {ext = icomp.ext};
|
vp = predV sein_V ** {ext = icomp.ext};
|
||||||
subj = mkSubj np vp.subjc ;
|
subj = mkSubj np vp.c1 ;
|
||||||
cls = (mkClause subj.p1 subj.p2 vp).s ! m ! t ! a ! p ;
|
cls = (mkClause subj.p1 subj.p2 vp).s ! m ! t ! a ! p ;
|
||||||
why = icomp.s ! np.a
|
why = icomp.s ! np.a
|
||||||
in table {
|
in table {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
oper
|
oper
|
||||||
NPNom : PCase = NPC Nom ;
|
NPNom : PCase = NPC Nom ;
|
||||||
PrepNom : Preposition = {s,s2 = "" ; isPrep = False ; c = NPNom} ;
|
PrepNom : Preposition = {s,s2 = "" ; isPrep = False ; c = NPNom} ;
|
||||||
|
|
||||||
prepC : PCase -> {s : Str ; c : Case} = \cp -> case cp of {
|
prepC : PCase -> {s : Str ; c : Case} = \cp -> case cp of {
|
||||||
NPC c => {s = [] ; c = c} ;
|
NPC c => {s = [] ; c = c} ;
|
||||||
NPP CAnDat => {s = "an" ; c = Dat} ;
|
NPP CAnDat => {s = "an" ; c = Dat} ;
|
||||||
@@ -54,12 +55,15 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
NPP CInDat => {s = "in" ; c = Dat} ;
|
NPP CInDat => {s = "in" ; c = Dat} ;
|
||||||
NPP CZuDat => {s = "zu" ; c = Dat} ;
|
NPP CZuDat => {s = "zu" ; c = Dat} ;
|
||||||
NPP CVonDat => {s = "von" ; c = Dat}
|
NPP CVonDat => {s = "von" ; c = Dat}
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
usePrepC : PCase -> (Case -> Str) -> Str = \c,fs ->
|
usePrepC : PCase -> (Case -> Str) -> Str = \c,fs ->
|
||||||
let sc = prepC c in sc.s ++ fs sc.c ;
|
let sc = prepC c in sc.s ++ fs sc.c ;
|
||||||
|
|
||||||
|
appPrepC : Preposition -> (Case => Str) -> Str = \prep,arg ->
|
||||||
|
let sc = prepC prep.c
|
||||||
|
in prep.s ++ sc.s ++ arg ! sc.c ++ prep.s2 ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
mkAgr : {g : Gender ; n : Number ; p : Person} -> Agr = \r ->
|
mkAgr : {g : Gender ; n : Number ; p : Person} -> Agr = \r ->
|
||||||
Ag r.g r.n r.p ;
|
Ag r.g r.n r.p ;
|
||||||
@@ -101,14 +105,14 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
--2 For $Verb$
|
--2 For $Verb$
|
||||||
|
|
||||||
param VForm =
|
param VForm =
|
||||||
VInf Bool -- True = with the particle "zu"
|
VInf Bool -- True = with the particle "zu"
|
||||||
| VFin Bool VFormFin -- True = prefix glued to verb
|
| VFin Bool VFormFin -- True = prefix glued to verb
|
||||||
| VImper Number -- prefix never glued
|
| VImper Number -- prefix never glued
|
||||||
| VPresPart AForm -- prefix always glued
|
| VPresPart AForm -- prefix always glued
|
||||||
| VPastPart AForm ;
|
| VPastPart AForm ;
|
||||||
|
|
||||||
param VFormFin =
|
param VFormFin =
|
||||||
VPresInd Number Person
|
VPresInd Number Person
|
||||||
| VPresSubj Number Person
|
| VPresSubj Number Person
|
||||||
| VImpfInd Number Person --# notpresent
|
| VImpfInd Number Person --# notpresent
|
||||||
@@ -124,10 +128,6 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
param VType = VAct | VRefl Case ;
|
param VType = VAct | VRefl Case ;
|
||||||
|
|
||||||
-- Implicit subject of embedded vp equals subject resp. object of matrix verb v:V2V:
|
|
||||||
|
|
||||||
param Control = SubjC | ObjC | NoC ; -- NoC : verb without infinite vp-complement
|
|
||||||
|
|
||||||
-- The order of a sentence depends on whether it is used as a main
|
-- The order of a sentence depends on whether it is used as a main
|
||||||
-- clause, inverted, or subordinate.
|
-- clause, inverted, or subordinate.
|
||||||
|
|
||||||
@@ -255,11 +255,8 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
s : PCase => Str ;
|
s : PCase => Str ;
|
||||||
rc : Str ; -- die Frage , [rc die ich gestellt habe]
|
rc : Str ; -- die Frage , [rc die ich gestellt habe]
|
||||||
ext : Str ; -- die Frage , [sc wo sie schläft] ; die Regel , [vp kein Fleisch zu essen] | [s dass ...]
|
ext : Str ; -- die Frage , [sc wo sie schläft] ; die Regel , [vp kein Fleisch zu essen] | [s dass ...]
|
||||||
-- adv : Str ; -- die Frage [a von Max] -- HL: cannot be extracted
|
|
||||||
a : Agr ;
|
a : Agr ;
|
||||||
-- isLight : Bool ; -- light NPs come before negation in simple clauses (expensive)
|
w : Weight } ; -- light NPs come before negation in simple clauses (expensive)
|
||||||
-- isPron : Bool } ; -- needed to put accPron before datPron
|
|
||||||
w : Weight } ;
|
|
||||||
|
|
||||||
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun =
|
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun =
|
||||||
\Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> {
|
\Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> {
|
||||||
@@ -446,6 +443,14 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
noPreposition : Case -> Preposition = \c ->
|
noPreposition : Case -> Preposition = \c ->
|
||||||
{s,s2 = [] ; c = NPC c ; isPrep = False} ;
|
{s,s2 = [] ; c = NPC c ; isPrep = False} ;
|
||||||
|
|
||||||
|
-- To build passive: accusative object -> nom subject; others -> same case or prep
|
||||||
|
|
||||||
|
subjPrep : Preposition -> Preposition = \prep ->
|
||||||
|
case <prep.c,prep.isPrep> of {
|
||||||
|
<NPC Acc,False> => prep ** {c = NPC Nom} ;
|
||||||
|
_ => prep
|
||||||
|
} ;
|
||||||
|
|
||||||
-- Pronouns and articles
|
-- Pronouns and articles
|
||||||
-- Here we define personal and relative pronouns.
|
-- Here we define personal and relative pronouns.
|
||||||
-- All personal pronouns, except "ihr", conform to the simple
|
-- All personal pronouns, except "ihr", conform to the simple
|
||||||
@@ -546,22 +551,23 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
VP : Type = {
|
VP : Type = {
|
||||||
s : Verb ; -- HL 6/2019: <refl|pron,NP,PP,AP|CN|Adv,ObjInf,EmbedInfs>
|
s : Verb ; -- HL 6/2019: <refl|pron,NP,PP,AP|CN|Adv>
|
||||||
nn : Agr => Str * Str * Str * Str -- <sich|ihr,deine Frau,an sie,gut,
|
nn : Agr => Str * Str * Str * Str ; -- <sich|ihr,deine Frau,an sie,gut>
|
||||||
* Str * Str ; -- splitInfExt: (rate) dir, dich zu bemühen mir zu helfen>
|
a1 : Str ; -- was: adV inserted before negation, unused?
|
||||||
a1 : Str ; -- adv before negation, adV
|
a2 : Str ; -- adverb
|
||||||
a2 : Str ; -- heute = adv
|
adj : Str ; -- adjectival complement of V(2)A, e.g. ich finde dich schön
|
||||||
adj : Str ; -- adjectival complement ("ich finde dich schön")
|
isAux : Bool ; -- is a double infinitive?, e.g. müssen:VV, lassen:V2V
|
||||||
isAux : Bool ; -- is a double infinitive
|
ext : Str ; -- sentential complement of V(2)S, V(2)Q, e.g. dass|ob sie kommt
|
||||||
inf : {s:Str ; isAux:Bool ; ctrl:Control} ; -- infinitival complement of VV or V2V
|
inf : {inpl: (Agr => Str)*Str ; -- infinitival complement of V(2)V HL 3/2022
|
||||||
ext : Str ; -- dass sie kommt
|
extr: (Agr => Str)} ; -- e.g. ihn [] versuchen (lasse) [, ihr zu helfen]
|
||||||
infExt : Str ; -- infinitival complements of inf
|
c1 : Preposition -- case of subject
|
||||||
-- e.g. ich hoffe [ihr zu helfen] zu versuchen
|
|
||||||
subjc : Preposition -- case of subject
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
VPSlash = VP ** {c2 : Preposition ;
|
VPSlash = VP ** {c2 : Preposition ; objCtrl : Bool} ; -- HL 3/2019 objCtr added
|
||||||
objCtrl : Bool } ; -- True = embedded reflexives agree with object
|
|
||||||
|
-- objCtrl distinguishes object-control from subject-control verb v:V2V in VP.s:
|
||||||
|
-- if True, reflexives in vp.inf and vp.nn have to agree with c2-object (added
|
||||||
|
-- by ComplSlash), else with subject (added by mkClause).
|
||||||
|
|
||||||
useVP : VP -> VPC = \vp ->
|
useVP : VP -> VPC = \vp ->
|
||||||
let
|
let
|
||||||
@@ -604,11 +610,12 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
Cond => vf True (wuerde a) vinf [] ; --# notpresent
|
Cond => vf True (wuerde a) vinf [] ; --# notpresent
|
||||||
Pres => vf b (vfin b m t a) [] []
|
Pres => vf b (vfin b m t a) [] []
|
||||||
} ;
|
} ;
|
||||||
VPFinite m t Anter => case t of { --# notpresent
|
VPFinite m t Anter => case t of {
|
||||||
Pres | Past => vf True (hat m t a) vpart [] ; --# notpresent
|
Past => vf True (hat m t a) vpart [] ; --# notpresent
|
||||||
Fut => vf True (wird m a) vpart haben ; --# notpresent
|
Fut => vf True (wird m a) vpart haben ; --# notpresent
|
||||||
Cond => vf True (wuerde a) vpart haben --# notpresent
|
Cond => vf True (wuerde a) vpart haben ; --# notpresent
|
||||||
} ; --# notpresent
|
Pres => vf True (hat m t a) vpart []
|
||||||
|
} ;
|
||||||
VPImperat False => vf False (verb.s ! VImper (numberAgr a)) [] [] ;
|
VPImperat False => vf False (verb.s ! VImper (numberAgr a)) [] [] ;
|
||||||
VPImperat True => vf False (verb.s ! VFin False (VPresSubj Pl P3)) [] [] ;
|
VPImperat True => vf False (verb.s ! VFin False (VPresSubj Pl P3)) [] [] ;
|
||||||
VPInfinit Anter => vf True [] (vpart ++ haben) [] ; --# notpresent
|
VPInfinit Anter => vf True [] (vpart ++ haben) [] ; --# notpresent
|
||||||
@@ -616,31 +623,23 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
predV : Verb -> VPSlash = predVGen False ;
|
predV : Verb -> VP = predVGen False ;
|
||||||
|
|
||||||
predVc : Verb ** {c2 : Preposition} -> VPSlash = \v ->
|
predVc : Verb ** {c2 : Preposition} -> VPSlash = \v ->
|
||||||
predV v ** {c2 = v.c2 ; objCtrl = False} ;
|
predV v ** {c2 = v.c2 ; objCtrl = False} ;
|
||||||
|
|
||||||
predVGen : Bool -> Verb -> VPSlash = \isAux, verb -> {
|
predVGen : Bool -> Verb -> VP = \isAux, verb -> {
|
||||||
s = {
|
s = verb ;
|
||||||
s = verb.s ;
|
|
||||||
prefix = verb.prefix ;
|
|
||||||
particle = verb.particle ;
|
|
||||||
aux = verb.aux ;
|
|
||||||
vtype = verb.vtype
|
|
||||||
} ;
|
|
||||||
a1,a2 : Str = [] ;
|
a1,a2 : Str = [] ;
|
||||||
nn : Agr => Str * Str * Str * Str * Str * Str = case verb.vtype of {
|
nn : Agr => Str * Str * Str * Str = case verb.vtype of {
|
||||||
VAct => \\_ => <[],[],[],[],[],[]> ;
|
VAct => \\_ => <[],[],[],[]> ;
|
||||||
VRefl c => \\a => <reflPron ! a ! c,[],[],[],[],[]>
|
VRefl c => \\a => <reflPron ! a ! c,[],[],[]>
|
||||||
} ;
|
} ;
|
||||||
isAux = isAux ; ----
|
isAux = isAux ; ----
|
||||||
inf = {s=[]; isAux=True; ctrl=NoC} ; -- default infinitive complement
|
-- default infinitival complement:
|
||||||
ext,infExt,adj : Str = [] ; -- (isAux=True => no endcomma)
|
inf = {inpl = <\\_ => [], []>; extr = \\_ => []} ;
|
||||||
subjc = PrepNom ;
|
ext,adj : Str = [] ;
|
||||||
-- Dummy values for subtyping.
|
c1 = PrepNom
|
||||||
c2 = PrepNom ;
|
|
||||||
objCtrl = False
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
auxPerfect : Verb -> VForm => Str = \verb ->
|
auxPerfect : Verb -> VForm => Str = \verb ->
|
||||||
@@ -702,100 +701,109 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
-- IL 24/04/2018 Fixing the scope of reflexives
|
-- IL 24/04/2018 Fixing the scope of reflexives
|
||||||
objAgr : { a : Agr } -> VP -> VP = \obj,vp -> vp ** {
|
objAgr : { a : Agr } -> VP -> VP = \obj,vp -> vp ** {
|
||||||
nn = \\a => vp.nn ! obj.a } ;
|
nn = \\a => vp.nn ! obj.a ;
|
||||||
-- HL: if reflexive only: <vp.nn.p1 ! np.a, vp.nn.p1 ! a, ..>
|
inf = {inpl = <\\a => vp.inf.inpl.p1 ! obj.a, vp.inf.inpl.p2> ; -- HL 3/2022
|
||||||
|
extr = \\a => vp.inf.extr ! obj.a} } ; -- HL 3/2022
|
||||||
|
|
||||||
-- Extending a verb phrase with new constituents.
|
-- Extending a verb phrase with new constituents.
|
||||||
|
|
||||||
insertObj : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp -> -- obj:Comp A|Adv|CN
|
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> -- obj:Comp A|Adv|CN
|
||||||
vp ** { nn = \\a => let vpnn = vp.nn ! a
|
vp ** { nn = \\a => let vpnn = vp.nn ! a in
|
||||||
in <vpnn.p1, vpnn.p2, vpnn.p3, obj ! a ++ vpnn.p4, vpnn.p5, vpnn.p6> } ;
|
<vpnn.p1, vpnn.p2, vpnn.p3, obj ! a ++ vpnn.p4> } ;
|
||||||
|
|
||||||
insertObjc : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp ->
|
insertObjc : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp ->
|
||||||
insertObj obj vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl } ;
|
insertObj obj vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl } ;
|
||||||
|
|
||||||
insertObjNP : NP -> Preposition -> VPSlash -> VPSlash = \np,prep,vp ->
|
insertObjNP : NP -> Preposition -> VPSlash -> VPSlash = \np,prep,vp ->
|
||||||
let c = case prep.c of { NPC cc => cc ; _ => Nom } ;
|
let c = case prep.c of { NPC cc => cc ; _ => Nom } ;
|
||||||
obj : Agr => Str = \\_ => appPrepNP prep np ;
|
obj = appPrepNP prep np ;
|
||||||
in vp ** {
|
in vp ** {
|
||||||
nn = \\a => -- HL 11/6/19: rough objNP order: (p5,p6 = splitInfExt)
|
nn = \\a =>
|
||||||
let vpnn = vp.nn ! a in -- vfin < accPron < refl < (gen|dat)Pron < nonPronNP < neg < prepNP < vinf|comp
|
let vpnn = vp.nn ! a in
|
||||||
{- less expensive if isLight is removed from NPs:
|
-- HL 11/6/19: rough object NP order (expensive):
|
||||||
case <np.isPron,prep.isPrep,c> of {
|
-- vfin < accPron < refl < (gen|dat)Pron < lightNP < neg < heavyNP|PP < vinf|comp
|
||||||
-- (assuming v.c2=acc) nonPron: dat < acc|gen (acc < gen not enforced)
|
case <prep.isPrep, np.w, c> of { -- 2 * 3 * 4 = 24 cases
|
||||||
<True, False,Acc> => -- <es|ihn sich, np, pp, comp, _,_>
|
<True, _,_> => -- <prons, light, heavy++pp, compl>
|
||||||
<obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj, vpnn.p4> ;
|
||||||
<True, False,_ > => -- <sich ihm, np, pp, comp>
|
<False,WPron, Acc> => -- <ihn ++ sich, light, heavy, comp>
|
||||||
<vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
<obj ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||||
<False,False,Dat> => -- <prons, dat ++ np, pp, comp>
|
|
||||||
<vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
|
||||||
<False,False,_ > => -- <prons, np ++ gen|acc, pp, comp>
|
|
||||||
<vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
|
||||||
<_, True,_ > => -- <prons, np, pp++pp, compl>
|
|
||||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6>
|
|
||||||
}
|
|
||||||
-}
|
|
||||||
-- expensive: -- vfin < accPron < refl < (gen|dat)Pron < lightNP < neg < heavyNP|PP < vinf|comp
|
|
||||||
case <prep.isPrep, np.w, c> of {
|
|
||||||
<True, _,_> => -- <prons, light, heavy++pp, compl,_,_>
|
|
||||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
|
||||||
<False,WPron, Acc> => -- <ihn ++ sich, light, heavy, comp, _,_>
|
|
||||||
<obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
|
||||||
<False,WPron, _ > => -- <sich ++ ihm|seiner, light, heavy, comp>
|
<False,WPron, _ > => -- <sich ++ ihm|seiner, light, heavy, comp>
|
||||||
<vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
<vpnn.p1 ++ obj, vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||||
<False,WLight,Dat> => -- (assuming v.c2=acc) nonPron: dat < acc|gen
|
<False,WLight,Dat> => -- (assuming v.c2=acc) nonPron: dat < acc|gen
|
||||||
-- <prons, dat ++ np, heavy, comp>
|
-- <prons, dat ++ np, heavy, comp>
|
||||||
<vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
<vpnn.p1, obj ++ vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||||
<False,WHeavy,Dat> => -- <prons, light, dat ++ np, comp>
|
<False,WHeavy,Dat> => -- <prons, light, dat ++ np, comp>
|
||||||
<vpnn.p1, vpnn.p2, obj ! a ++ vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
<vpnn.p1, vpnn.p2, obj ++ vpnn.p3, vpnn.p4> ;
|
||||||
<False,WLight,_ > => -- <prons, np ++ gen|acc, heavy, comp>
|
<False,WLight,_ > => -- <prons, np ++ gen|acc, heavy, comp>
|
||||||
<vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
<vpnn.p1, vpnn.p2 ++ obj, vpnn.p3, vpnn.p4> ;
|
||||||
<False,WHeavy,_ > => -- <prons, light, dat ++ np, comp>
|
<False,WHeavy,_ > => -- <prons, light, dat ++ np, comp>
|
||||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6> }
|
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj, vpnn.p4> }
|
||||||
} ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4)
|
} ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4)
|
||||||
|
|
||||||
insertObjRefl : VPSlash -> VPSlash = \vp -> -- HL 6/2019, to order reflPron < neg < prep+reflPron
|
insertObjRefl : VPSlash -> VPSlash = \vp -> -- HL 6/2019, to order reflPron < neg < prep+reflPron
|
||||||
let prep = vp.c2 ;
|
let prep = vp.c2 ;
|
||||||
b = notB prep.isPrep ;
|
|
||||||
c = case prep.c of { NPC cc => cc ; _ => Acc } ;
|
c = case prep.c of { NPC cc => cc ; _ => Acc } ;
|
||||||
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! c ;
|
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! c ; -- HL: to test ReflVP: reflPronSelf
|
||||||
in vp ** {
|
in vp ** {
|
||||||
nn = \\a =>
|
nn = \\a =>
|
||||||
let vpnn = vp.nn ! a in
|
let vpnn = vp.nn ! a in
|
||||||
case b of {
|
case prep.isPrep of {
|
||||||
True => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
False => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||||
False => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> }
|
True => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4> }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** { -- not used in RGL, so VP.a1 can be skipped
|
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** { -- not used in Ger, so VP.a1 can be skipped
|
||||||
a1 = adv ++ vp.a1 } ; -- cf. AdvVP(Slash),AdVVP(Slash)
|
a1 = adv ++ vp.a1 } ; -- cf. AdvVP(Slash),AdVVP(Slash)
|
||||||
|
|
||||||
insertAdv : Str -> VP -> VP = \adv,vp -> vp ** {
|
insertAdv : Str -> VP -> VP = \adv,vp -> vp ** {
|
||||||
a2 = vp.a2 ++ adv } ;
|
a2 = vp.a2 ++ adv } ;
|
||||||
|
|
||||||
insertExtrapos : Str -> VPSlash -> VPSlash = \ext,vp -> vp ** {
|
insertExtrapos : Str -> VP -> VP = \ext,vp -> vp ** {
|
||||||
ext = vp.ext ++ ext } ;
|
ext = vp.ext ++ ext } ;
|
||||||
|
|
||||||
insertInfExt : Str -> VPSlash -> VPSlash = \infExt,vp -> vp ** {
|
-- HL 3/2022: to do nested infinitival objects in ComplVV, SlashVV, SlashV2V
|
||||||
infExt = vp.infExt ++ infExt } ;
|
-- embed <sich, helfen> into <ihn, lassen> = <ihn sich, helfen lassen>
|
||||||
|
embedInf : (Agr => Str) * Str -> (Agr => Str) * Str -> (Agr => Str) * Str =
|
||||||
|
\f,g -> <\\a => g.p1!a ++ f.p1!a, f.p2 ++ g.p2> ;
|
||||||
|
|
||||||
-- HL: to handle infExt in ComplVV and SlashVV, SlashV2V
|
-- Futur-II: (ich werde) ihn dir ++ haben ++ helfen lassen
|
||||||
insertInfExtraObj : (Agr => Str) -> VPSlash -> VPSlash = \objs,vp -> vp ** {
|
insertInf : {inpl:(Agr => Str)*Str ; extr:(Agr => Str)} -> VP -> VP =
|
||||||
nn = \\a => let vpnn = vp.nn ! a in
|
\inf,vp -> vp ** {inf = {inpl = embedInf inf.inpl vp.inf.inpl ;
|
||||||
<vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, objs ! a ++ vpnn.p5, vpnn.p6>
|
extr = \\agr => vp.inf.extr!agr ++ inf.extr!agr}} ;
|
||||||
} ;
|
|
||||||
insertInfExtraInf : (Agr => Str) -> VPSlash -> VPSlash = \inf,vp -> vp ** {
|
|
||||||
nn = \\a => let vpnn = vp.nn ! a in
|
|
||||||
<vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6 ++ inf ! a>
|
|
||||||
} ;
|
|
||||||
|
|
||||||
insertInf : {s:Str;isAux:Bool;ctrl:Control} -> VPSlash -> VPSlash = \inf,vp -> vp ** {
|
glueInpl : (Agr => Str)*Str -> (Agr => Str) =
|
||||||
inf = {s = inf.s ++ vp.inf.s ; isAux = inf.isAux ; ctrl=inf.ctrl} } ;
|
\inplace -> \\agr => (inplace.p1!agr ++ inplace.p2) ;
|
||||||
|
|
||||||
insertAdj : Str -> Str * Str -> Str -> VPSlash -> VPSlash = \adj,c,ext,vp -> vp ** {
|
-- HL 3/22: extract infzu-complement, leave inf-complement in-place
|
||||||
|
mkInf : Bool -> Anteriority -> Polarity -> VP ->
|
||||||
|
{inpl : (Agr => Str) * Str ; extr : (Agr => Str)} =
|
||||||
|
\isAux,ant,pol,vp ->
|
||||||
|
let
|
||||||
|
vpi = infVP isAux ant pol vp ;
|
||||||
|
topInpl = <vpi.objs, vpi.pred> ;
|
||||||
|
emptyInpl : (Agr => Str) * Str = <\\_ => [], []> ;
|
||||||
|
comma = bindComma
|
||||||
|
in
|
||||||
|
case <isAux,vp.isAux> of {
|
||||||
|
<True,True> -- 1: {s=will, inpl=<(sich, waschen) können>, extr = []}
|
||||||
|
=> {inpl = embedInf vpi.inpl topInpl ;
|
||||||
|
extr = \\agr => vpi.extr!agr} ;
|
||||||
|
<True,False> -- 2: {s=will; inpl=<[], versuchen>, extr = sich zu waschen}
|
||||||
|
=> {inpl = topInpl ;
|
||||||
|
extr = \\agr => (glueInpl vpi.inpl)!agr ++ vpi.extr!agr} ;
|
||||||
|
<False,True> -- 3: {s=wagt; inpl=<[], []>, extr = (sich, waschen) zu wollen}
|
||||||
|
=> {inpl = emptyInpl ;
|
||||||
|
extr = let moved = embedInf vpi.inpl topInpl
|
||||||
|
in \\agr => comma ++ (glueInpl moved)!agr ++ vpi.extr!agr} ;
|
||||||
|
<False,False> -- 4: {s=wagt, inpl=<[], []>, extr = zu versuchen, (sich zu waschen)}
|
||||||
|
=> {inpl = emptyInpl ;
|
||||||
|
extr = \\agr => comma ++ (glueInpl topInpl)!agr ++ vpi.extr!agr}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
insertAdj : Str -> Str * Str -> Str -> VP -> VP = \adj,c,ext,vp -> vp ** {
|
||||||
nn = \\a =>
|
nn = \\a =>
|
||||||
let vpnn = vp.nn ! a in <vpnn.p1, vpnn.p2 ++ c.p1, -- der Frau treu
|
let vpnn = vp.nn ! a in <vpnn.p1, vpnn.p2 ++ c.p1, -- der Frau treu
|
||||||
vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
vpnn.p3, vpnn.p4> ;
|
||||||
adj = vp.adj ++ adj ++ c.p2 ; -- neugierig auf das Buch
|
adj = vp.adj ++ adj ++ c.p2 ; -- neugierig auf das Buch
|
||||||
ext = vp.ext ++ ext} ;
|
ext = vp.ext ++ ext} ;
|
||||||
|
|
||||||
@@ -809,7 +817,8 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
s : Mood => Tense => Anteriority => Polarity => Order => Str
|
s : Mood => Tense => Anteriority => Polarity => Order => Str
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> let vps = useVP vp in {
|
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp ->
|
||||||
|
let vps = useVP vp in {
|
||||||
s = \\m,t,a,b,o =>
|
s = \\m,t,a,b,o =>
|
||||||
let
|
let
|
||||||
ord = case o of {
|
ord = case o of {
|
||||||
@@ -817,55 +826,39 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
_ => False
|
_ => False
|
||||||
} ;
|
} ;
|
||||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||||
|
haben = verb.inf2 ;
|
||||||
neg = negation ! b ;
|
neg = negation ! b ;
|
||||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
||||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
||||||
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||||
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
||||||
-- leave inf-complement of +auxV(2)V in place,
|
infObjs = (vp.inf.inpl.p1)!agr ;
|
||||||
|
infPred = vp.inf.inpl.p2 ;
|
||||||
|
-- leave inf-complement of +auxV(2)V in place,
|
||||||
-- extract infzu-complement of -auxV(2)V: (ComplVV, SlashV2V)
|
-- extract infzu-complement of -auxV(2)V: (ComplVV, SlashV2V)
|
||||||
infExt : Str * Str = case vp.inf.isAux of
|
infCompl : Str = case <t,a,vp.isAux> of {
|
||||||
{ True => <(vp.nn!agr).p6,[]> ; _ => <[],(vp.nn!agr).p6> } ;
|
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||||
extra = infExt.p2 ++ vp.ext ;
|
_ => infObjs ++ infPred } ;
|
||||||
infCompls = -- () tun | ihn (es tun) lassen | ihm [es zu tun] versprechen
|
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||||
(vp.nn ! agr).p5 ++ infExt.p1 ++ vp.inf.s ;
|
<Fut|Cond,Anter,True> => --# notpresent
|
||||||
comma = case orB vp.isAux (case vp.inf.ctrl of { NoC => True ; _ => False }) of {
|
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||||
True => [] ; _ => bindComma} ;
|
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||||
inf : Str =
|
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||||
case <t,a,vp.isAux> of {
|
<_,Anter,True> => --# notpresent
|
||||||
<Fut|Cond,Anter,True> => --# notpresent
|
{inf = verb.inf ++ haben ; --# notpresent
|
||||||
-- haben () tun wollen |
|
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||||
-- ihn haben (es tun) lassen wollen () |
|
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||||
-- ihm haben () versprechen wollen (, es zu tun)
|
_ =>
|
||||||
(vp.nn ! agr).p5 ++ verb.inf2 ++ infExt.p1 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
{inf = verb.inf ++ haben ;
|
||||||
<_, Anter,True> => --# notpresent
|
infComplfin = -- es zu tun ++ versucht/[] +[]+ hat/versuchte
|
||||||
-- tun wollen [] | ihn (es tun) lassen wollen [] |
|
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||||
-- ihm () versprechen wollen [] (, es zu tun)
|
} ;
|
||||||
infCompls ++ verb.inf ++ verb.inf2 ; --# notpresent
|
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||||
<Fut|Cond,Simul,True> => --# notpresent
|
|
||||||
infCompls ++ verb.inf ++ verb.inf2 ; --# notpresent
|
|
||||||
<Fut|Cond,Anter,False> => --# notpresent
|
|
||||||
-- gebeten haben , es zu tun () | gebeten haben , ihn (es tun) zu lassen
|
|
||||||
verb.inf ++ verb.inf2 ++ comma ++ infCompls ; --# notpresent
|
|
||||||
_ => verb.inf2 ++ verb.inf ++ comma ++ infCompls } ;
|
|
||||||
inffin : Str =
|
|
||||||
case <t,a,vp.isAux> of {
|
|
||||||
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
|
|
||||||
=> (vp.nn ! agr).p5 ++ verb.fin --# notpresent
|
|
||||||
++ verb.inf2 ++ infExt.p1 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
|
||||||
<Pres|Past,Anter,True> --# notpresent
|
|
||||||
=> (vp.nn ! agr).p5 ++ infExt.p1 ++ verb.fin --# notpresent
|
|
||||||
++ vp.inf.s ++ verb.inf ++ verb.inf2 ; -- double inf --# notpresent
|
|
||||||
<_, _ ,True>
|
|
||||||
=> infCompls ++ verb.inf ++ verb.inf2 ++ verb.fin ; -- or just auxiliary vp
|
|
||||||
<_, _ ,False>
|
|
||||||
=> verb.inf ++ verb.inf2 ++ verb.fin ++ comma ++ infCompls
|
|
||||||
} ;
|
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
Main => subj ++ verb.fin ++ compl ++ inf ++ extra ;
|
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||||
Inv => verb.fin ++ subj ++ compl ++ inf ++ extra ;
|
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||||
Sub => subj ++ compl ++ inffin ++ extra
|
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -886,34 +879,60 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
es wird nicht besser
|
es wird nicht besser
|
||||||
-}
|
-}
|
||||||
|
|
||||||
infVP : Bool -> VP -> ((Agr => Str) * Str * Str * Str) =
|
infVP = overload {
|
||||||
\isAux, vp -> let vps = useVP vp in
|
infVP : Bool -> VP -> ((Agr => Str) * Str * Str * Str)
|
||||||
|
= infVP_orig ; -- from gf-3.9,
|
||||||
|
infVP : Bool -> Anteriority -> Polarity -> VP
|
||||||
|
-> { objs:(Agr => Str) ; pred:Str; inpl:(Agr=>Str)*Str ; extr:(Agr=>Str) }
|
||||||
|
= infVP_ant ; -- admit infinitive in Anter anteriority and Neg polarity
|
||||||
|
} ;
|
||||||
|
|
||||||
|
infVP_orig : Bool -> VP -> ((Agr => Str) * Str * Str * Str) =
|
||||||
|
\isAux, vp -> let vps = useVP vp ;
|
||||||
|
infExt = vp.inf.extr ! agrP3 Sg -- HL 3/22
|
||||||
|
in
|
||||||
<
|
<
|
||||||
\\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.a2,
|
\\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.a2,
|
||||||
vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos
|
vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos
|
||||||
vp.inf.s,
|
vp.inf.inpl.p2, -- ! HL
|
||||||
vp.infExt ++ vp.ext
|
infExt ++ vp.ext
|
||||||
> ;
|
> ;
|
||||||
|
|
||||||
useInfVP : Bool -> VP -> Str = \isAux,vp ->
|
infVP_ant : Bool -> Anteriority -> Polarity -> VP -- HL 3/22
|
||||||
let vpi = infVP isAux vp in
|
-> { objs:(Agr => Str) ; pred:Str ; inpl:(Agr=>Str)*Str ; extr:(Agr=>Str) } =
|
||||||
vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ++ vpi.p4 ;
|
\isAux, ant, pol, vp -> let vps = useVP vp in
|
||||||
|
{
|
||||||
|
objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
|
||||||
|
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
|
||||||
|
pred = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
|
||||||
|
-- inplace and extracted parts of vp.inf:
|
||||||
|
inpl = vp.inf.inpl ;
|
||||||
|
extr = vp.inf.extr
|
||||||
|
} ;
|
||||||
|
|
||||||
infzuVP : Bool -> Control -> Anteriority -> Polarity -> VP -- HL
|
infVPSlash : Bool -> Anteriority -> Polarity -> VPSlash -- HL 3/22
|
||||||
-> { objs:(Agr => Str) ; pred:{s:Str;isAux:Bool;ctrl:Control} ; inf:Str ; ext:Str } =
|
-> { objs:(Agr => Str) ; pred:Str; inpl:(Agr=>Str)*Str ; extr:(Agr=>Str) } =
|
||||||
\isAux, ctrl, ant, pol, vp -> let vps = useVP vp in
|
\isAux, ant, pol, vp -> let vps = useVP vp in
|
||||||
{ objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
|
{ objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
|
||||||
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
|
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
|
||||||
pred = { s = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
|
pred = vp.inf.inpl.p2 ++ vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
|
||||||
isAux = vp.isAux ; ctrl = ctrl } ;
|
-- inplace and extracted parts of vp.inf:
|
||||||
inf = vp.inf.s ;
|
inpl = <vp.inf.inpl.p1, []> ; -- move the predicate part to pred
|
||||||
ext = vp.ext
|
extr = vp.inf.extr
|
||||||
} ;
|
} ** {c2 = vp.c2 ; objCtrl = vp.objCtrl} ;
|
||||||
|
|
||||||
|
-- for CatGer.linref VP and Verb.embedVP:
|
||||||
|
useInfVP : Bool -> VP -> Str = \isAux,vp ->
|
||||||
|
-- let vpi = infVP isAux vp in
|
||||||
|
-- vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ++ vpi.p4 ;
|
||||||
|
let vpi = infVP isAux Simul Pos vp ; -- HL 3/2022
|
||||||
|
agr : Agr = (Ag Masc Sg P3) ;
|
||||||
|
glue : (Agr => Str)*Str -> Str = \i -> i.p1!agr ++ i.p2
|
||||||
|
in
|
||||||
|
glue (embedInf vpi.inpl <vpi.objs, vpi.pred>) ++ vpi.extr!agr ++ vp.ext ;
|
||||||
|
|
||||||
-- The nominative case is not used as reflexive, but defined here
|
-- The nominative case is not used as reflexive, but defined here
|
||||||
-- so that we can reuse this in personal pronouns.
|
-- so that we can reuse this in personal pronouns.
|
||||||
-- The missing Sg "ihrer" shows that a dependence on gender would
|
|
||||||
-- be needed.
|
|
||||||
|
|
||||||
reflPron : Agr => Case => Str = table {
|
reflPron : Agr => Case => Str = table {
|
||||||
Ag _ Sg P1 => caselist "ich" "mich" "mir" "meiner" ;
|
Ag _ Sg P1 => caselist "ich" "mich" "mir" "meiner" ;
|
||||||
@@ -980,16 +999,14 @@ resource ResGer = ParamX ** open Prelude in {
|
|||||||
<GPl,Gen> => "deren" ;
|
<GPl,Gen> => "deren" ;
|
||||||
_ => artDef ! gn ! c
|
_ => artDef ! gn ! c
|
||||||
} ;
|
} ;
|
||||||
RSentence => "was"
|
RSentence => (caselist "was" "was" "was" "wessen") ! c -- wessen HL 4/2022
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Function that allows the construction of non-nominative subjects.
|
-- Function that allows the construction of non-nominative subjects.
|
||||||
mkSubj : NP -> Preposition -> Str * Agr = \np, subjc ->
|
mkSubj : NP -> Preposition -> Str * Agr = \np, prep ->
|
||||||
let
|
let
|
||||||
sub = subjc ;
|
agr = case prep.c of { NPC Nom => np.a ; _ => Ag Masc Sg P3 } ;
|
||||||
agr = case sub.c of { NPC Nom => np.a ; _ => Ag Masc Sg P3 } ;
|
subj = appPrepNP prep np
|
||||||
subj = appPrepNP sub np
|
|
||||||
in <subj , agr> ;
|
in <subj , agr> ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
PredVP np vp =
|
PredVP np vp =
|
||||||
let subj = mkSubj np vp.subjc
|
let subj = mkSubj np vp.c1
|
||||||
in mkClause subj.p1 subj.p2 vp ;
|
in mkClause subj.p1 subj.p2 vp ;
|
||||||
|
|
||||||
{- applies verb's subject case to subject ;
|
{- applies verb's subject case to subject ;
|
||||||
forces 3rd person sg agreement for any non-nom subjects -->
|
forces 3rd person sg agreement for any non-nom subjects -->
|
||||||
@@ -26,17 +26,17 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
agr = Ag Fem (numImp n) ps.p1 ; --- g does not matter
|
agr = Ag Fem (numImp n) ps.p1 ; --- g does not matter
|
||||||
verb = vps.s ! False ! agr ! VPImperat ps.p3 ;
|
verb = vps.s ! False ! agr ! VPImperat ps.p3 ;
|
||||||
inf = vp.inf.s ++ verb.inf ; -- HL .nn
|
inf = vp.inf.inpl.p2 ++ verb.inf ; -- HL .s/.inpl.p2
|
||||||
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4
|
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4
|
||||||
in
|
in
|
||||||
-- verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
-- verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
||||||
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVP np vp =
|
SlashVP np vp =
|
||||||
let subj = mkSubj np vp.subjc
|
let subj = mkSubj np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
|
||||||
in mkClause subj.p1 subj.p2 vp ** {c2 = vp.c2} ;
|
in mkClause subj.p1 subj.p2 vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a
|
||||||
|
-- cf. tests/german/TestLangGer.gf
|
||||||
AdvSlash slash adv = {
|
AdvSlash slash adv = {
|
||||||
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
|
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
|
||||||
c2 = slash.c2
|
c2 = slash.c2
|
||||||
@@ -75,7 +75,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
|||||||
|
|
||||||
SSubjS a s b = {s = \\o => a.s ! o ++ "," ++ s.s ++ b.s ! Sub} ;
|
SSubjS a s b = {s = \\o => a.s ! o ++ "," ++ s.s ++ b.s ! Sub} ;
|
||||||
|
|
||||||
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "was"
|
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "was"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
concrete StructuralGer of Structural = CatGer **
|
concrete StructuralGer of Structural = CatGer **
|
||||||
|
|
||||||
open MorphoGer, MakeStructuralGer, (X = ConstructX),
|
open MorphoGer, MakeStructuralGer, (X = ConstructX),
|
||||||
(P = ParadigmsGer), IrregGer, Prelude in {
|
(P = ParadigmsGer), IrregGer, Prelude, (R = ResGer) in {
|
||||||
|
|
||||||
flags optimize=all ;
|
flags optimize=all ;
|
||||||
coding=utf8 ;
|
coding=utf8 ;
|
||||||
@@ -10,7 +10,8 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
|
|
||||||
above_Prep = mkPrep "über" P.dative ;
|
above_Prep = mkPrep "über" P.dative ;
|
||||||
after_Prep = mkPrep "nach" P.dative ;
|
after_Prep = mkPrep "nach" P.dative ;
|
||||||
all_Predet = {s = appAdj (regA "all") ; c = noCase ; a = PAgNone} ;
|
-- all_Predet = {s = appAdj (regA "all") ; c = noCase ; a = PAgNone} ;
|
||||||
|
all_Predet = {s = appAdj (regA "all") ; c = noCase ; a = PAg Pl} ; -- HL 5/2022
|
||||||
almost_AdA, almost_AdN = ss "fast" ;
|
almost_AdA, almost_AdN = ss "fast" ;
|
||||||
although_Subj = ss "obwohl" ;
|
although_Subj = ss "obwohl" ;
|
||||||
always_AdV = ss "immer" ;
|
always_AdV = ss "immer" ;
|
||||||
@@ -31,9 +32,9 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
VHaben) ;
|
VHaben) ;
|
||||||
during_Prep = mkPrep "während" P.genitive ; --- no variants in the rgl | P.mkPrep P.accusative "über" ;
|
during_Prep = mkPrep "während" P.genitive ; --- no variants in the rgl | P.mkPrep P.accusative "über" ;
|
||||||
either7or_DConj = sd2 "entweder" "oder" ** {n = Sg} ;
|
either7or_DConj = sd2 "entweder" "oder" ** {n = Sg} ;
|
||||||
everybody_NP = nameNounPhrase {s = caselist "jeder" "jeden" "jedem" "jedes"} ;
|
everybody_NP = nameNounPhrase Masc {s = caselist "jeder" "jeden" "jedem" "jedes"} ;
|
||||||
every_Det = detUnlikeAdj False Sg "jed" ;
|
every_Det = detUnlikeAdj False Sg "jed" ;
|
||||||
everything_NP = nameNounPhrase {s = caselist "alles" "alles" "allem" "alles"} ;
|
everything_NP = nameNounPhrase Neutr {s = caselist "alles" "alles" "allem" "alles"} ;
|
||||||
everywhere_Adv = ss "überall" ;
|
everywhere_Adv = ss "überall" ;
|
||||||
few_Det = detLikeAdj False Pl "wenig" ;
|
few_Det = detLikeAdj False Pl "wenig" ;
|
||||||
---- first_Ord = {s = (regA "erst").s ! Posit} ;
|
---- first_Ord = {s = (regA "erst").s ! Posit} ;
|
||||||
@@ -54,7 +55,15 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
less_CAdv = X.mkCAdv "weniger" "als" ;
|
less_CAdv = X.mkCAdv "weniger" "als" ;
|
||||||
many_Det = detLikeAdj False Pl "viel" ;
|
many_Det = detLikeAdj False Pl "viel" ;
|
||||||
more_CAdv = X.mkCAdv "mehr" "als" ;
|
more_CAdv = X.mkCAdv "mehr" "als" ;
|
||||||
most_Predet = {s = appAdj (regA "meist") ; c = noCase ; a = PAgNone} ;
|
-- most_Predet = {s = appAdj (regA "meist") ; c = noCase ; a = PAgNone} ;
|
||||||
|
most_Predet = { -- HL 5/2022
|
||||||
|
s = \\n,g,c => let gn = R.gennum g n ;
|
||||||
|
k = (R.prepC c).c ;
|
||||||
|
adj = (P.mkA "viel" "mehr" "meiste").s ! Superl
|
||||||
|
in
|
||||||
|
R.usePrepC c (\k -> R.artDef ! gn ! k ++ adj ! (agrAdj g Weak n k)) ;
|
||||||
|
c = {p = [] ; k = PredCase (NPC Gen)} ;
|
||||||
|
a = PAg Pl} ;
|
||||||
much_Det = {s = \\_,_ => "viel" ; sp = \\_,_ => "vieles" ; n = Sg ; a = Weak ; isDef = False} ;
|
much_Det = {s = \\_,_ => "viel" ; sp = \\_,_ => "vieles" ; n = Sg ; a = Weak ; isDef = False} ;
|
||||||
must_VV = auxVV
|
must_VV = auxVV
|
||||||
(mkV
|
(mkV
|
||||||
@@ -75,7 +84,7 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
quite_Adv = ss "ziemlich" ;
|
quite_Adv = ss "ziemlich" ;
|
||||||
she_Pron = mkPronPers "sie" "sie" "ihr" "ihrer" "ihr" Fem Sg P3 ;
|
she_Pron = mkPronPers "sie" "sie" "ihr" "ihrer" "ihr" Fem Sg P3 ;
|
||||||
so_AdA = ss "so" ;
|
so_AdA = ss "so" ;
|
||||||
somebody_NP = nameNounPhrase {s = caselist "jemand" "jemanden" "jemandem" "jemands"} ;
|
somebody_NP = nameNounPhrase Masc {s = caselist "jemand" "jemanden" "jemandem" "jemands"} ;
|
||||||
somePl_Det = detLikeAdj True Pl "einig" ;
|
somePl_Det = detLikeAdj True Pl "einig" ;
|
||||||
someSg_Det = {
|
someSg_Det = {
|
||||||
s,sp = \\g,c =>
|
s,sp = \\g,c =>
|
||||||
@@ -85,12 +94,12 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
hasNum = True ;
|
hasNum = True ;
|
||||||
isDef = False ;
|
isDef = False ;
|
||||||
} ;
|
} ;
|
||||||
something_NP = nameNounPhrase {s = \\_ => "etwas"} ;
|
something_NP = nameNounPhrase Neutr {s = \\_ => "etwas"} ;
|
||||||
somewhere_Adv = ss "irgendwo" ;
|
somewhere_Adv = ss "irgendwo" ;
|
||||||
that_Quant = let
|
that_Quant = let
|
||||||
jener : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "jen").s in
|
jener : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "jen").s in
|
||||||
{s,sp = \\_ => jener ; a,aPl = Weak} ;
|
{s,sp = \\_ => jener ; a,aPl = Weak} ;
|
||||||
---b that_NP = nameNounPhrase {s = caselist "das" "das" "denem" "dessen"} ; ----
|
---b that_NP = nameNounPhrase Neutr {s = caselist "das" "das" "dem" "dessen"} ; ----
|
||||||
there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ;
|
there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ;
|
||||||
there7to_Adv = ss "dahin" ;
|
there7to_Adv = ss "dahin" ;
|
||||||
there7from_Adv = ss ["daher"] ;
|
there7from_Adv = ss ["daher"] ;
|
||||||
@@ -100,7 +109,7 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
this_Quant = let
|
this_Quant = let
|
||||||
dieser : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "dies").s in
|
dieser : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "dies").s in
|
||||||
{s,sp = \\_ => dieser ; a,aPl = Weak} ;
|
{s,sp = \\_ => dieser ; a,aPl = Weak} ;
|
||||||
---b this_NP = nameNounPhrase {s = caselist "dies" "dies" "diesem" "dieses"} ; ----
|
---b this_NP = nameNounPhrase Neutr {s = caselist "dies" "dies" "diesem" "dieses"} ; ----
|
||||||
---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ;
|
---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ;
|
||||||
through_Prep = mkPrep "durch" P.accusative ;
|
through_Prep = mkPrep "durch" P.accusative ;
|
||||||
too_AdA = ss "zu" ;
|
too_AdA = ss "zu" ;
|
||||||
@@ -143,9 +152,9 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
{s,sp = \\_ => keiner ; a = Strong ; aPl = Weak} ; ---- sp
|
{s,sp = \\_ => keiner ; a = Strong ; aPl = Weak} ; ---- sp
|
||||||
if_then_Conj = {s1 = "wenn" ; s2 = "dann" ; n = Sg ; lock_Conj = <>} ;
|
if_then_Conj = {s1 = "wenn" ; s2 = "dann" ; n = Sg ; lock_Conj = <>} ;
|
||||||
nobody_NP =
|
nobody_NP =
|
||||||
nameNounPhrase {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ;
|
nameNounPhrase Masc {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ;
|
||||||
nothing_NP =
|
nothing_NP =
|
||||||
nameNounPhrase {s = \\_ => "nichts"} ; --maybe add: nameNounPhrase {s = \\_ => "garnichts"}
|
nameNounPhrase Neutr {s = \\_ => "nichts"} ; --maybe add: nameNounPhrase {s = \\_ => "garnichts"}
|
||||||
at_least_AdN = ss "wenigstens" ;
|
at_least_AdN = ss "wenigstens" ;
|
||||||
at_most_AdN = ss "höchstens" ;
|
at_most_AdN = ss "höchstens" ;
|
||||||
except_Prep = mkPrep "außer" P.dative ;
|
except_Prep = mkPrep "außer" P.dative ;
|
||||||
@@ -156,4 +165,7 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
|
|
||||||
lin language_title_Utt = ss "Deutsch" ;
|
lin language_title_Utt = ss "Deutsch" ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => PCase => Str =
|
||||||
|
\adj,deg,adjf -> \\n,g,c => R.usePrepC c (\k -> adj.s ! deg ! (agrAdj g adjf n k)) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,37 +15,20 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
|||||||
insertInf vpi.p2 (
|
insertInf vpi.p2 (
|
||||||
insertObjc vpi.p1 vps))) ;
|
insertObjc vpi.p1 vps))) ;
|
||||||
-}
|
-}
|
||||||
-- HL 7/19
|
|
||||||
ComplVV v vp = -- will|wage (es ([]|zu) tun [] | ihn [es tun] ([]|zu) lassen
|
ComplVV v vp = -- HL 3/22: leave inf-complement in-place, extract infzu-complement
|
||||||
let
|
let
|
||||||
vps = predVGen v.isAux v ;
|
vps = predVGen v.isAux v ; -- e.g. will.isAux=True | wagt.isAux=False
|
||||||
vpi = infzuVP v.isAux SubjC Simul Pos vp ;
|
inf = mkInf v.isAux Simul Pos vp
|
||||||
-- { objs: ihm ; pred: []/zu versprechen, objInf: sich/es zu tun }
|
|
||||||
-- (ich) vfin:werde (ihm ([]/zu) versprechen) vinf:(wollen/gewagt haben) (, es zu tun)
|
|
||||||
-- (ich) vfin:werde (ihn (es tun) lassen)/[] vinf:(wollen/gewagt haben) []/(, ihn (es tun) zu lassen)
|
|
||||||
extInfzu = case <vp.isAux,vp.inf.isAux> of {<True,False> => (vp.nn!(Ag Masc Sg P3)).p6 ; _ => []} ;
|
|
||||||
comma = case vp.inf.ctrl of { NoC => [] ; _ => bindComma} ; -- es (zu) tun
|
|
||||||
embeddedInf : Agr => Str =
|
|
||||||
case <vp.isAux,vp.inf.isAux> of { -- vv + vp + [embeddedInf]
|
|
||||||
-- will [es lesen] können | will ihn [es lesen] lassen
|
|
||||||
<True,True> => \\agr => (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ;
|
|
||||||
-- will ihn [euch (extInfzu) bitten] lassen
|
|
||||||
<True,False> => \\agr => (vp.nn!agr).p5 ++ vpi.inf ; -- ++ (vp.nn!agr).p6 => extInfzu
|
|
||||||
-- will es lesen [] | will ihn bitten [, es zu lesen] | will ihn bitten [, sie es lesen zu lassen]
|
|
||||||
<False,True> => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ;
|
|
||||||
-- will ihn bitten [, ihr zu helfen, es zu lesen]
|
|
||||||
<False,False> => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 }
|
|
||||||
in
|
in
|
||||||
insertExtrapos (extInfzu ++ vpi.ext) ( -- vps.ext <- vp's extracted embedded infzu + vp's object-sentence
|
insertExtrapos vp.ext (
|
||||||
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
|
insertInf inf vps) ;
|
||||||
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
|
|
||||||
insertInfExtraInf embeddedInf vps))) ;
|
|
||||||
|
|
||||||
ComplVS v s =
|
ComplVS v s =
|
||||||
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ;
|
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ;
|
||||||
ComplVQ v q =
|
ComplVQ v q =
|
||||||
insertExtrapos (comma ++ q.s ! QIndir) (predV v) ;
|
insertExtrapos (comma ++ q.s ! QIndir) (predV v) ;
|
||||||
ComplVA v ap = insertAdj (v.c2.s ++ ap.s ! APred) ap.c ap.ext (predV v) ; -- changed
|
ComplVA v ap = insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ;
|
||||||
|
|
||||||
SlashV2a v = (predVc v) ;
|
SlashV2a v = (predVc v) ;
|
||||||
|
|
||||||
@@ -53,9 +36,9 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
|||||||
Slash3V3 v np = insertObjNP np v.c3 (predVc v) ;
|
Slash3V3 v np = insertObjNP np v.c3 (predVc v) ;
|
||||||
|
|
||||||
SlashV2S v s =
|
SlashV2S v s =
|
||||||
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predVc v) ;
|
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2; objCtrl = False} ;
|
||||||
SlashV2Q v q =
|
SlashV2Q v q =
|
||||||
insertExtrapos (comma ++ q.s ! QIndir) (predVc v) ;
|
insertExtrapos (comma ++ q.s ! QIndir) (predV v) ** {c2 = v.c2; objCtrl = False} ;
|
||||||
{-
|
{-
|
||||||
SlashV2V v vp =
|
SlashV2V v vp =
|
||||||
let
|
let
|
||||||
@@ -66,28 +49,26 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
|||||||
insertInfExt vpi.p3 (
|
insertInfExt vpi.p3 (
|
||||||
insertInf vpi.p2 (
|
insertInf vpi.p2 (
|
||||||
insertObjc vpi.p1 vps))) ;
|
insertObjc vpi.p1 vps))) ;
|
||||||
|
|
||||||
-}
|
-}
|
||||||
SlashV2V v vp = -- jmdn bitten, (\agr => sich!agr das Buch zu merken) HL 7/19
|
SlashV2V v vp = -- (jmdn) bitten, sich zu waschen | sich waschen lassen HL 7/19
|
||||||
let
|
let
|
||||||
vps = (predVGen v.isAux v) ** { c2 = v.c2 ; objCtrl = case v.ctrl of {ObjC => True ; _ => False}} ;
|
vps = predVGen v.isAux v ; -- e.g. verspricht|bittet.isAux=False | läßt.isAux=True
|
||||||
vpi = infzuVP v.isAux v.ctrl Simul Pos vp ;
|
inf = mkInf v.isAux Simul Pos vp
|
||||||
comma : Str = case <vp.isAux,vp.inf.ctrl> of { <True,_> | <_,NoC> => [] ; _ => bindComma} ;
|
|
||||||
embeddedInf : Agr => Str = case vp.inf.isAux of {
|
|
||||||
True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- ihn es lesen (zu) lassen
|
|
||||||
False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- ihn (zu) bitten , es zu lesen
|
|
||||||
in
|
in
|
||||||
insertExtrapos vpi.ext ( -- vps.ext <- vp's object-sentence ++ extractedInfzu?
|
insertExtrapos vp.ext (
|
||||||
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
|
insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ;
|
||||||
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
|
|
||||||
insertInfExtraInf embeddedInf vps))) ;
|
|
||||||
|
|
||||||
SlashV2A v ap =
|
SlashV2A v ap =
|
||||||
insertAdj (ap.s ! APred) ap.c ap.ext (predVc v) ;
|
insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ;
|
||||||
|
|
||||||
ComplSlash vps np =
|
ComplSlash vps np =
|
||||||
let vp = insertObjNP np vps.c2 vps ;
|
-- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np.
|
||||||
-- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np.
|
-- HL 3/22 better before inserting np, using objCtrl
|
||||||
in case vps.objCtrl of { True => objAgr np vp ; _ => vp } ;
|
let vp = case vps.objCtrl of { True => objAgr np vps ; _ => vps }
|
||||||
|
** { c2 = vps.c2 ; objCtrl = vps.objCtrl } ;
|
||||||
|
in insertObjNP np vps.c2 vp ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
SlashVV v vp =
|
SlashVV v vp =
|
||||||
let
|
let
|
||||||
@@ -95,26 +76,34 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
|||||||
vps = predVGen v.isAux v ** {c2 = vp.c2 } ;
|
vps = predVGen v.isAux v ** {c2 = vp.c2 } ;
|
||||||
in vps **
|
in vps **
|
||||||
insertExtrapos vpi.p3 (
|
insertExtrapos vpi.p3 (
|
||||||
insertInf {s=vpi.p2;isAux=vp.isAux;ctrl=SubjC} ( -- insertInf vpi.p2 (
|
insertInf vpi.p2 (
|
||||||
insertObj vpi.p1 vps)) ;
|
insertObj vpi.p1 vps)) ;
|
||||||
-}
|
-}
|
||||||
SlashVV v vp = -- will|hoffe ((zu) lesen | ihr (zu) geben | (zu) bitten, es zu lesen)
|
|
||||||
|
-- SlashVV v vps is like ComplVV v vp, but infinite vps should not be extracted
|
||||||
|
SlashVV v vp = -- HL 3/2022
|
||||||
let
|
let
|
||||||
vps = (predVGen v.isAux v) ** { c2 = vp.c2 } ;
|
vps = predVGen v.isAux v ; -- e.g. will.isAux=True | wagt.isAux=False
|
||||||
vpi = infzuVP v.isAux SubjC Simul Pos vp ; -- (zu) (lesen | ihr geben | bitten, es zu lesen)
|
vpi = infVPSlash v.isAux Simul Pos vp ; -- differs from infVP !
|
||||||
comma : Str = case <vp.isAux,vp.inf.ctrl> of { <True,_> | <_,NoC> => [] ; _ => bindComma} ;
|
inf : {inpl: (Agr => Str) * Str ; extr : (Agr => Str)} =
|
||||||
embeddedInf : Agr => Str = case vp.inf.isAux of {
|
let
|
||||||
True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- es lesen (zu) lassen
|
topInpl = <vpi.objs, vpi.pred> ;
|
||||||
False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- (zu) bitten, es zu lesen
|
emptyInpl : (Agr => Str) * Str = <\\_ => [], []> ;
|
||||||
|
in
|
||||||
|
case <v.isAux,vp.isAux> of {
|
||||||
|
<False,True> -- wagt lesen zu wollen
|
||||||
|
=> {inpl = emptyInpl ;
|
||||||
|
extr = let moved = (embedInf vpi.inpl topInpl)
|
||||||
|
in \\agr => (glueInpl moved)!agr ++ (vpi.extr!agr)} ;
|
||||||
|
_ => -- wagt zu lesen zu versuchen
|
||||||
|
-- will lesen können | will zu lesen wagen
|
||||||
|
{inpl = embedInf vpi.inpl topInpl ; extr = vpi.extr}
|
||||||
|
} ;
|
||||||
in
|
in
|
||||||
insertExtrapos vpi.ext ( -- vps.ext <- vp's object-sentence ++ extractedInfzu?
|
insertExtrapos vp.ext (
|
||||||
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
|
insertInf inf vps) ** {c2 = vp.c2 ; objCtrl = vp.objCtrl};
|
||||||
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
|
|
||||||
insertInfExtraInf embeddedInf vps))) ;
|
|
||||||
|
|
||||||
-- {- HL 8/19: this slightly modified SlashV2VNP is expensive even with NP.w:Weight
|
{- -- order of embedded objects wrong:
|
||||||
|
|
||||||
-- order of embedded objects wrong:
|
|
||||||
-- Lang> p "the woman that you beg me to listen to" | l
|
-- Lang> p "the woman that you beg me to listen to" | l
|
||||||
-- the woman that you beg me to listen to
|
-- the woman that you beg me to listen to
|
||||||
-- die Frau , der ihr mich zuzuhören bittet
|
-- die Frau , der ihr mich zuzuhören bittet
|
||||||
@@ -123,19 +112,25 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
|||||||
SlashV2VNP v np vp =
|
SlashV2VNP v np vp =
|
||||||
let
|
let
|
||||||
vpi = infVP v.isAux vp ;
|
vpi = infVP v.isAux vp ;
|
||||||
vps = predVGen v.isAux v ** {c2 = vp.c2} ; -- objCtrl = ?
|
vps = predVGen v.isAux v ** {c2 = vp.c2} ;
|
||||||
in vps **
|
in vps **
|
||||||
insertExtrapos vpi.p3 (
|
insertExtrapos vpi.p3 (
|
||||||
insertInf {s=vpi.p2;isAux=v.isAux;ctrl=v.ctrl} ( -- insertInf vpi.p2
|
insertInf vpi.p2 (
|
||||||
insertObj vpi.p1 (
|
insertObj vpi.p1 (
|
||||||
insertObj (\\_ => appPrepNP v.c2 np) vps))) ;
|
insertObj (\\_ => appPrepNP v.c2 np) vps))) ;
|
||||||
|
|
||||||
-- HL: version with infzuVP in tests/german/TestLangGer.gf, too expensive
|
-}
|
||||||
|
-- expensive: + SlashV2VNP 503.884.800 (2880,540), reaches memory limit with SlashVV
|
||||||
|
-- does not work for nested uses: the nn-levels are confused HL 3/22
|
||||||
|
|
||||||
|
SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22
|
||||||
|
insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ;
|
||||||
|
|
||||||
|
|
||||||
UseComp comp =
|
UseComp comp =
|
||||||
insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used
|
insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used
|
||||||
-- adj slot not used here for e.g. "ich bin alt" but same behaviour as NPs?
|
-- SS: adj slot not used here for e.g. "ich bin alt" but same behaviour as NPs?
|
||||||
-- "ich bin nicht alt" "ich bin nicht Doris"
|
-- "ich bin nicht alt" "ich bin nicht Doris"
|
||||||
|
|
||||||
UseCopula = predV sein_V ;
|
UseCopula = predV sein_V ;
|
||||||
|
|
||||||
@@ -162,7 +157,10 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
|||||||
-- (\\k => usePrepC k (\c -> reflPron ! a ! c))) vp ;
|
-- (\\k => usePrepC k (\c -> reflPron ! a ! c))) vp ;
|
||||||
ReflVP vp = insertObjRefl vp ; -- HL, 19/06/2019
|
ReflVP vp = insertObjRefl vp ; -- HL, 19/06/2019
|
||||||
|
|
||||||
PassV2 v = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ;
|
PassV2 v = -- acc object -> nom subject; all others: same PCase
|
||||||
|
let c = case <v.c2.c, v.c2.isPrep> of {
|
||||||
|
<NPC Acc, False> => NPC Nom ; _ => v.c2.c}
|
||||||
|
in insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { c1 = v.c2 ** {c = c} } ;
|
||||||
|
|
||||||
{- HL: The construction VPSlashPrep : VP -> Prep -> VPSlash does not exist
|
{- HL: The construction VPSlashPrep : VP -> Prep -> VPSlash does not exist
|
||||||
in German. In abstract/Verb.gf, the example
|
in German. In abstract/Verb.gf, the example
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in {
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
|
-- : AP -> Adv -> AP ; -- warm by nature
|
||||||
|
AdvAP ap adv = ap ** {
|
||||||
|
s = ap.s ++ adv.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : A -> AP ;
|
-- : A -> AP ;
|
||||||
PositA a = a ** {
|
PositA a = a ** {
|
||||||
compar = [] ;
|
compar = [] ;
|
||||||
@@ -39,6 +44,8 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in {
|
|||||||
-- AdjOrd ord = ord ** {
|
-- AdjOrd ord = ord ** {
|
||||||
-- compar = []
|
-- compar = []
|
||||||
-- } ;
|
-- } ;
|
||||||
|
-- AdjOrd : Ord -> AP =
|
||||||
|
AdjOrd ord = ord ;
|
||||||
|
|
||||||
-- Sentence and question complements defined for all adjectival
|
-- Sentence and question complements defined for all adjectival
|
||||||
-- phrases, although the semantics is only clear for some adjectives.
|
-- phrases, although the semantics is only clear for some adjectives.
|
||||||
@@ -56,7 +63,6 @@ concrete AdjectiveMay of Adjective = CatMay ** open ResMay, Prelude in {
|
|||||||
|
|
||||||
-- It can also be postmodified by an adverb, typically a prepositional phrase.
|
-- It can also be postmodified by an adverb, typically a prepositional phrase.
|
||||||
|
|
||||||
-- : AP -> Adv -> AP ; -- warm by nature
|
|
||||||
-- AdvAP ap adv = ap ** {} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ lin
|
|||||||
-- : Prep -> NP -> Adv ;
|
-- : Prep -> NP -> Adv ;
|
||||||
PrepNP prep np = {s = applyPrep prep np} ;
|
PrepNP prep np = {s = applyPrep prep np} ;
|
||||||
|
|
||||||
|
-- PrepNP to_Prep (UsePron youSg_Pron)
|
||||||
|
|
||||||
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||||
|
|
||||||
--AdAdv : AdA -> Adv -> Adv ; -- very quickly
|
--AdAdv : AdA -> Adv -> Adv ; -- very quickly
|
||||||
|
|||||||
@@ -3,4 +3,6 @@
|
|||||||
concrete AllMay of AllMayAbs =
|
concrete AllMay of AllMayAbs =
|
||||||
LangMay,
|
LangMay,
|
||||||
ExtendMay
|
ExtendMay
|
||||||
** {} ;
|
** open ParadigmsMay in {
|
||||||
|
lin sing_V2 = mkV2 "nyanyi" ;
|
||||||
|
} ;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user