forked from GitHub/gf-rgl
(Som) Add UseCl, UseComp, CompAP, UttS
This commit is contained in:
@@ -23,7 +23,7 @@ lin
|
|||||||
-- PositAdAAdj a = { } ;
|
-- PositAdAAdj a = { } ;
|
||||||
-- Subordinate clauses can function as adverbs.
|
-- Subordinate clauses can function as adverbs.
|
||||||
|
|
||||||
--: Subj -> S -> Adv ;
|
-- : Subj -> S -> Adv ;
|
||||||
-- SubjS subj s = {} ;
|
-- SubjS subj s = {} ;
|
||||||
|
|
||||||
-- Comparison adverbs also work as numeral adverbs.
|
-- Comparison adverbs also work as numeral adverbs.
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ oper BaseS : S -> S -> ListS = notYet "BaseS" ;
|
|||||||
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
||||||
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
||||||
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
||||||
oper CompAP : AP -> Comp = notYet "CompAP" ;
|
|
||||||
oper CompAdv : Adv -> Comp = notYet "CompAdv" ;
|
oper CompAdv : Adv -> Comp = notYet "CompAdv" ;
|
||||||
oper CompCN : CN -> Comp = notYet "CompCN" ;
|
oper CompCN : CN -> Comp = notYet "CompCN" ;
|
||||||
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
|
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
|
||||||
@@ -152,8 +151,6 @@ oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
|||||||
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
||||||
oper Use3N3 : N3 -> N2 = notYet "Use3N3" ;
|
oper Use3N3 : N3 -> N2 = notYet "Use3N3" ;
|
||||||
oper UseA2 : A2 -> AP = notYet "UseA2" ;
|
oper UseA2 : A2 -> AP = notYet "UseA2" ;
|
||||||
oper UseCl : Temp -> Pol -> Cl -> S = notYet "UseCl" ;
|
|
||||||
oper UseComp : Comp -> VP = notYet "UseComp" ;
|
|
||||||
oper UseComparA : A -> AP = notYet "UseComparA" ;
|
oper UseComparA : A -> AP = notYet "UseComparA" ;
|
||||||
oper UseN2 : N2 -> CN = notYet "UseN2" ;
|
oper UseN2 : N2 -> CN = notYet "UseN2" ;
|
||||||
oper UsePN : PN -> NP = notYet "UsePN" ;
|
oper UsePN : PN -> NP = notYet "UsePN" ;
|
||||||
@@ -169,7 +166,6 @@ oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ;
|
|||||||
oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ;
|
oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ;
|
||||||
oper UttInterj : Interj -> Utt = notYet "UttInterj" ;
|
oper UttInterj : Interj -> Utt = notYet "UttInterj" ;
|
||||||
oper UttQS : QS -> Utt = notYet "UttQS" ;
|
oper UttQS : QS -> Utt = notYet "UttQS" ;
|
||||||
oper UttS : S -> Utt = notYet "UttS" ;
|
|
||||||
oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ;
|
oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ;
|
||||||
oper above_Prep : Prep = notYet "above_Prep" ;
|
oper above_Prep : Prep = notYet "above_Prep" ;
|
||||||
oper active2passive : Cl -> Cl = notYet "active2passive" ;
|
oper active2passive : Cl -> Cl = notYet "active2passive" ;
|
||||||
|
|||||||
@@ -117,18 +117,15 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
OrdNumeral num = num ;
|
OrdNumeral num = num ;
|
||||||
|
|
||||||
-- : A -> Ord ;
|
-- : A -> Ord ;
|
||||||
OrdSuperl a = { s = a.s ! AF Superl ; n = Sg } ; -- why force Sg?
|
OrdSuperl a = { } ; -- why force Sg?
|
||||||
|
|
||||||
-- One can combine a numeral and a superlative.
|
-- One can combine a numeral and a superlative.
|
||||||
|
|
||||||
-- : Numeral -> A -> Ord ; -- third largest
|
-- : Numeral -> A -> Ord ; -- third largest
|
||||||
OrdNumeralSuperl num a = num ** { s = num.s ++ a.s ! AF Superl } ; --TODO: is the word order correct?
|
OrdNumeralSuperl num a = num ** { } ;
|
||||||
|
|
||||||
-- : Quant
|
-- : Quant
|
||||||
DefArt = { s = artDef ;
|
DefArt = { } ;
|
||||||
indep = False ;
|
|
||||||
pref = [] ;
|
|
||||||
isDef = True } ;
|
|
||||||
-- : Quant
|
-- : Quant
|
||||||
IndefArt = { s = artDef ;
|
IndefArt = { s = artDef ;
|
||||||
indep = False ;
|
indep = False ;
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ param
|
|||||||
-- TODO: is this necessary?
|
-- TODO: is this necessary?
|
||||||
param
|
param
|
||||||
CardOrd = NCard | NOrd ;
|
CardOrd = NCard | NOrd ;
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Prepositions
|
-- Prepositions
|
||||||
|
|
||||||
@@ -124,13 +125,17 @@ oper
|
|||||||
param
|
param
|
||||||
VForm =
|
VForm =
|
||||||
VInf
|
VInf
|
||||||
| VPres Agreement Bool
|
| VPres Agreement Polarity
|
||||||
| VNegPast
|
| VNegPast
|
||||||
| VPast Agreement
|
| VPast Agreement
|
||||||
| VFut -- agreement comes from auxiliary
|
| VFut -- agreement comes from auxiliary
|
||||||
| VRel -- "som är/har/…" TODO is this used in other verbs?
|
| VRel -- "som är/har/…" TODO is this used in other verbs?
|
||||||
| VImp Number ; -- TODO negation
|
| VImp Number ; -- TODO negation
|
||||||
|
|
||||||
|
oper
|
||||||
|
if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f ->
|
||||||
|
case p of {Pos => t ; Neg => f } ;
|
||||||
|
|
||||||
-- TODO:
|
-- TODO:
|
||||||
-- tre aspekter (enkel, progressiv, habituell),
|
-- tre aspekter (enkel, progressiv, habituell),
|
||||||
-- fem modus (indikativ, imperativ, konjunktiv, kontiditonalis, optativ)
|
-- fem modus (indikativ, imperativ, konjunktiv, kontiditonalis, optativ)
|
||||||
|
|||||||
@@ -269,6 +269,9 @@ oper
|
|||||||
Verb2 : Type = Verb ** {c2 : Preposition} ;
|
Verb2 : Type = Verb ** {c2 : Preposition} ;
|
||||||
Verb3 : Type = Verb2 ** {c3 : Preposition} ;
|
Verb3 : Type = Verb2 ** {c3 : Preposition} ;
|
||||||
|
|
||||||
|
-- Saeed page 79:
|
||||||
|
-- "… the reference form is the imperative singular form
|
||||||
|
-- since it corresponds to the form of the basic root."
|
||||||
mkVerb : (x1,x2 : Str) -> Verb = \ark,qaat ->
|
mkVerb : (x1,x2 : Str) -> Verb = \ark,qaat ->
|
||||||
let stems : {p1 : Str ; p2 : Str} = case ark of {
|
let stems : {p1 : Str ; p2 : Str} = case ark of {
|
||||||
a + r@#c + k@#c => <ark + "i", a + r + a + voiced k> ;
|
a + r@#c + k@#c => <ark + "i", a + r + a + voiced k> ;
|
||||||
@@ -288,11 +291,11 @@ oper
|
|||||||
_ => "n" } ;
|
_ => "n" } ;
|
||||||
in { s = table {
|
in { s = table {
|
||||||
VPres (Sg1|Sg3 Masc) pol
|
VPres (Sg1|Sg3 Masc) pol
|
||||||
=> qaat + if_then_Str pol "aa" "o" ;
|
=> qaat + if_then_Pol pol "aa" "o" ;
|
||||||
VPres (Sg2|Sg3 Fem) pol
|
VPres (Sg2|Sg3 Fem) pol
|
||||||
=> arag + t + if_then_Str pol "aa" "o" ;
|
=> arag + t + if_then_Pol pol "aa" "o" ;
|
||||||
VPres (Pl1 _) pol
|
VPres (Pl1 _) pol
|
||||||
=> arag + n + if_then_Str pol "aa" "o" ;
|
=> arag + n + if_then_Pol pol "aa" "o" ;
|
||||||
VPres Pl2 pol => arag + t + "aan" ;
|
VPres Pl2 pol => arag + t + "aan" ;
|
||||||
VPres Pl3 pol => qaat + "aan" ;
|
VPres Pl3 pol => qaat + "aan" ;
|
||||||
|
|
||||||
@@ -333,15 +336,15 @@ oper
|
|||||||
|
|
||||||
copula : Verb = {
|
copula : Verb = {
|
||||||
s = table {
|
s = table {
|
||||||
VPres Sg1 pol => if_then_Str pol "ahay" "ihi" ;
|
VPres Sg1 pol => if_then_Pol pol "ahay" "ihi" ;
|
||||||
VPres Sg2 pol => if_then_Str pol "tahay" "ihid" ;
|
VPres Sg2 pol => if_then_Pol pol "tahay" "ihid" ;
|
||||||
VPres (Sg3 Masc) pol => if_then_Str pol "yahay" "aha" ;
|
VPres (Sg3 Masc|Impers) pol => if_then_Pol pol "yahay" "aha" ;
|
||||||
VPres (Sg3 Fem) pol => if_then_Str pol "tahay" "aha" ;
|
VPres (Sg3 Fem) pol => if_then_Pol pol "tahay" "aha" ;
|
||||||
VPres (Pl1 _) pol => if_then_Str pol "nahay" "ihin" ;
|
VPres (Pl1 _) pol => if_then_Pol pol "nahay" "ihin" ;
|
||||||
VPres Pl2 pol => if_then_Str pol "tihiin" "ihidin" ;
|
VPres Pl2 pol => if_then_Pol pol "tihiin" "ihidin" ;
|
||||||
VPres Pl3 pol => if_then_Str pol "yihiin" "aha" ;
|
VPres Pl3 pol => if_then_Pol pol "yihiin" "aha" ;
|
||||||
|
|
||||||
VPast (Sg1|Sg3 Masc)
|
VPast (Sg1|Sg3 Masc|Impers)
|
||||||
=> "ahaa" ;
|
=> "ahaa" ;
|
||||||
VPast (Sg2|Sg3 Fem)
|
VPast (Sg2|Sg3 Fem)
|
||||||
=> "ahayd" ;
|
=> "ahayd" ;
|
||||||
@@ -410,17 +413,34 @@ oper
|
|||||||
prepCombTable ! np.a ! combine vp.c2 noPrep ;
|
prepCombTable ! np.a ! combine vp.c2 noPrep ;
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Sentences etc.
|
-- Sentences etc.
|
||||||
Clause : Type = {s : Bool => Str} ; -- TODO tense + ant
|
Clause : Type = {s : Tense => Anteriority => Polarity => Str} ;
|
||||||
RClause,
|
RClause,
|
||||||
ClSlash,
|
ClSlash,
|
||||||
Sentence : Type = SS ; ---- TODO
|
Sentence : Type = SS ; ---- TODO
|
||||||
|
|
||||||
stmarker : Agreement => Bool => Str = \\a,b =>
|
vf : Tense -> Anteriority -> Polarity -> Agreement -> Verb
|
||||||
let stm = if_then_Str b "w" "m"
|
-> {fin : Str ; inf : Str} = \t,ant,p,agr,vp ->
|
||||||
|
let pastV : Verb -> Str = \v ->
|
||||||
|
case p of { Neg => v.s ! VNegPast ;
|
||||||
|
Pos => v.s ! VPast agr } ;
|
||||||
|
presV : Verb -> Str = \v -> v.s ! VPres agr p ;
|
||||||
|
in case <t,ant> of {
|
||||||
|
<Pres,Simul> => {fin = presV vp ; inf = [] } ;
|
||||||
|
<Pres,Anter> => {fin = presV copula ; inf = vp.s ! VInf } ; ---- just guessing
|
||||||
|
<Past,Simul> => {fin = pastV vp ; inf = [] } ;
|
||||||
|
<Past,Anter> => {fin = pastV copula ; inf = vp.s ! VInf } ; ---- TODO: habitual aspect
|
||||||
|
<_Fut,Simul> => {fin = presV copula ; inf = vp.s ! VFut} ;
|
||||||
|
<_Fut,Anter> => {fin = pastV copula ; inf = vp.s ! VFut}
|
||||||
|
-- <Cond,Simul> => {fin = ? ; inf = ?} ; -- TODO conditional
|
||||||
|
-- <Cond,Anter> => {fin = ? ; inf = ?} -- TODO conditional
|
||||||
|
} ;
|
||||||
|
|
||||||
|
stmarker : Agreement => Polarity => Str = \\a,b =>
|
||||||
|
let stm = if_then_Pol b "w" "m"
|
||||||
in stm + subjpron ! a ;
|
in stm + subjpron ! a ;
|
||||||
|
|
||||||
stmarkerNoContr : Agreement => Bool => Str = \\a,b =>
|
stmarkerNoContr : Agreement => Polarity => Str = \\a,b =>
|
||||||
let stm = if_then_Str b "waa" "ma"
|
let stm = if_then_Pol b "waa" "ma"
|
||||||
in stm ++ subjpron ! a ;
|
in stm ++ subjpron ! a ;
|
||||||
|
|
||||||
subjpron : Agreement => Str = table {
|
subjpron : Agreement => Str = table {
|
||||||
|
|||||||
@@ -8,22 +8,27 @@ lin
|
|||||||
--2 Clauses
|
--2 Clauses
|
||||||
|
|
||||||
-- : NP -> VP -> Cl
|
-- : NP -> VP -> Cl
|
||||||
PredVP np vp = let compl = vp.comp ! np.a in {
|
PredVP np vp = {
|
||||||
s = \\b =>
|
s = \\t,a,p =>
|
||||||
if_then_Str np.isPron [] (np.s ! Nom)
|
let pred : {fin : Str ; inf : Str} = vf t a p np.a vp ;
|
||||||
++ compl.p1
|
subj : Str = if_then_Str np.isPron [] (np.s ! Nom) ;
|
||||||
++ case <b,vp.isPred,np.a> of { --sentence type marker + subj. pronoun
|
obj : {p1,p2 : Str} = vp.comp ! np.a ;
|
||||||
<True,True,Sg3 _> => "waa" ;
|
stm : Str =
|
||||||
|
case <p,vp.isPred,np.a> of {
|
||||||
|
<Pos,True,Sg3 _> => "waa" ;
|
||||||
-- _ => stmarker ! np.a ! b } -- marker+pronoun contract
|
-- _ => stmarker ! np.a ! b } -- marker+pronoun contract
|
||||||
_ => case <np.isPron,b> of {
|
_ => case <np.isPron,p> of {
|
||||||
<True,True> => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree
|
<True,Pos> => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree
|
||||||
<True,False> => "ma" ++ np.s ! Nom ;
|
<True,Neg> => "ma" ++ np.s ! Nom ;
|
||||||
<False> => stmarkerNoContr ! np.a ! b
|
<False> => stmarkerNoContr ! np.a ! p }} ;
|
||||||
}}
|
in subj -- subject if it's a noun
|
||||||
++ vp.adv.s
|
++ obj.p1 -- object if it's a noun
|
||||||
++ compl.p2 -- object pronoun for pronouns, empty for nouns
|
++ stm -- sentence type marker + possible subj. pronoun
|
||||||
++ vp.s ! VPres np.a b -- the verb inflected
|
++ vp.adv.s ---- TODO: can it contract with obj. pronoun?
|
||||||
++ vp.adv.s2
|
++ obj.p2 -- object if it's a pronoun
|
||||||
|
++ pred.fin -- the verb inflected
|
||||||
|
++ pred.inf -- potential participle
|
||||||
|
++ vp.adv.s2 ---- I have no idea /IL
|
||||||
} ;
|
} ;
|
||||||
{-
|
{-
|
||||||
-- : SC -> VP -> Cl ; -- that she goes is good
|
-- : SC -> VP -> Cl ; -- that she goes is good
|
||||||
@@ -63,10 +68,10 @@ lin
|
|||||||
|
|
||||||
--2 Sentences
|
--2 Sentences
|
||||||
|
|
||||||
|
-}
|
||||||
-- : Temp -> Pol -> Cl -> S ;
|
-- : Temp -> Pol -> Cl -> S ;
|
||||||
UseCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p ! Stat } ;
|
UseCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p } ;
|
||||||
|
{-
|
||||||
-- : Temp -> Pol -> RCl -> RS ;
|
-- : Temp -> Pol -> RCl -> RS ;
|
||||||
UseRCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p } ;
|
UseRCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p } ;
|
||||||
|
|
||||||
|
|||||||
@@ -79,23 +79,23 @@ lin
|
|||||||
|
|
||||||
-- : VPSlash -> VP ;
|
-- : VPSlash -> VP ;
|
||||||
ReflVP vps = ;
|
ReflVP vps = ;
|
||||||
|
-}
|
||||||
-- : Comp -> VP ;
|
-- : Comp -> VP ;
|
||||||
UseComp comp =
|
UseComp comp = UseCopula ** comp ** {
|
||||||
insertComp comp.s (copulaVP comp.copula)
|
isPred = True
|
||||||
** {isPred = True} ;
|
} ;
|
||||||
|
{-
|
||||||
-- : V2 -> VP ; -- be loved
|
-- : V2 -> VP ; -- be loved
|
||||||
PassV2 v2 =
|
PassV2 v2 =
|
||||||
|
|
||||||
-- : VP -> Adv -> VP ; -- sleep here
|
-- : VP -> Adv -> VP ; -- sleep here
|
||||||
AdvVP vp adv = ResSom.insertAdv adv vp ;
|
AdvVP vp adv = vp ** {adv = adv} ; ---- TODO: how about combining adverbs?
|
||||||
|
|
||||||
-- : VP -> Adv -> VP ; -- sleep , even though ...
|
-- : VP -> Adv -> VP ; -- sleep , even though ...
|
||||||
ExtAdvVP vp adv = ResSom.insertAdv (postfixSS (SOFT_BIND ++ ",") adv) vp ;
|
ExtAdvVP vp adv = ;
|
||||||
|
|
||||||
-- : AdV -> VP -> VP ; -- always sleep
|
-- : AdV -> VP -> VP ; -- always sleep
|
||||||
AdVVP adv vp = ResSom.insertAdv adv vp ;
|
AdVVP adv vp = vp ** {adv = adv} ;
|
||||||
|
|
||||||
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
|
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
|
||||||
AdvVPSlash vps adv = vps ** { adv = vps.adv ++ adv.s } ;
|
AdvVPSlash vps adv = vps ** { adv = vps.adv ++ adv.s } ;
|
||||||
@@ -110,7 +110,7 @@ lin
|
|||||||
-- x => x }} ;
|
-- x => x }} ;
|
||||||
|
|
||||||
|
|
||||||
{-
|
|
||||||
|
|
||||||
--2 Complements to copula
|
--2 Complements to copula
|
||||||
|
|
||||||
@@ -121,13 +121,11 @@ lin
|
|||||||
-- I am [a house that sleeps here]
|
-- I am [a house that sleeps here]
|
||||||
-- we are [houses that sleep here]
|
-- we are [houses that sleep here]
|
||||||
|
|
||||||
-- Complement : Type = { s : Agreement => {p1,p2 : Str}} ;
|
|
||||||
|
|
||||||
-- : AP -> Comp ;
|
-- : AP -> Comp ;
|
||||||
CompAP ap = {
|
CompAP ap = {
|
||||||
comp = \\a => <[], ap.s ! AF (getNum a) Abs> ;
|
comp = \\a => <[], ap.s ! AF (getNum a) Abs> ;
|
||||||
} ;
|
} ;
|
||||||
|
{-}
|
||||||
-- : CN -> Comp ;
|
-- : CN -> Comp ;
|
||||||
CompCN cn = { } ;
|
CompCN cn = { } ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user