1
0
forked from GitHub/gf-rgl

Merge branch 'latin'

This commit is contained in:
Herbert Lange
2019-11-22 12:03:47 +01:00
19 changed files with 448 additions and 273 deletions

View File

@@ -8,12 +8,12 @@ concrete AdjectiveLat of Adjective = CatLat ** open ResLat, Prelude in {
-- ComparA : A -> NP -> AP ; -- warmer than I
ComparA a np = {
s = \\ag => a.s ! Compar ! ag ++ "quam" ++ (combineNounPhrase np) ! PronNonDrop ! Nom ;
s = \\ag => a.s ! Compar ! ag ++ "quam" ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom ;
} ;
-- ComplA2 : A2 -> NP -> AP ; -- married to her
ComplA2 a np = {
s = \\ag => a.s ! Posit ! ag ++ a.c.s ++ (combineNounPhrase np) ! PronNonDrop ! a.c.c ;
s = \\ag => a.s ! Posit ! ag ++ a.c.s ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! a.c.c ;
} ;
-- ReflA2 : A2 -> AP -- married to myself
@@ -31,7 +31,7 @@ concrete AdjectiveLat of Adjective = CatLat ** open ResLat, Prelude in {
-- CAdvAP : CAdv -> AP -> NP -> AP ; -- as cool as John
CAdvAP cadv ap np =
{ s = \\ag => cadv.s ++ ap.s ! ag ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! Nom } ;
{ s = \\ag => cadv.s ++ ap.s ! ag ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom } ;
-- The superlative use is covered in $Ord$.

View File

@@ -8,16 +8,16 @@ concrete AdverbLat of Adverb = CatLat ** open ResLat, Prelude, ParadigmsLat in
-- PrepNP : Prep -> NP -> Adv ; -- in the house
PrepNP prep np =
mkAdv (prep.s ++ (combineNounPhrase np) ! PronNonDrop ! prep.c ) ;
mkAdv (prep.s ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! prep.c ) ;
-- ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more warmly than John
ComparAdvAdj cadv a np =
mkAdv (cadv.s ++ a.adv.s ! Compar ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! Nom) ;
mkAdv (cadv.s ++ a.adv.s ! Compar ++ cadv.p ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom) ;
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
ComparAdvAdjS cadv a s =
mkAdv (cadv.s ++ a.adv.s ! Compar ++ cadv.p ++ combineSentence s ! SPreS ! PreV ! CPreV ! SOV ) ;
mkAdv (cadv.s ++ a.adv.s ! Compar ++ cadv.p ++ defaultSentence s ! SOV ) ;
-- AdAdv : AdA -> Adv -> Adv ; -- very quickly
AdAdv ada adv = mkAdv (ada.s ++ (adv.s ! Posit) ) ;
@@ -29,7 +29,7 @@ concrete AdverbLat of Adverb = CatLat ** open ResLat, Prelude, ParadigmsLat in
-- Subordinate clauses can function as adverbs.
-- SubjS : Subj -> S -> Adv ; -- when she sleeps
SubjS subj s = mkAdv (subj.s ++ combineSentence s ! SPreS ! PreV ! CPreV ! SOV ) ;
SubjS subj s = mkAdv (subj.s ++ defaultSentence s ! SOV ) ;
-- AdnCAdv : CAdv -> AdN ; -- less (than five)
AdnCAdv cadv = {s = cadv.s ++ cadv.p} ;

View File

@@ -8,6 +8,7 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
--
S = Sentence ;
QS = {s : QForm => Str} ;
RS = { s : Gender => Number => Str } ; -- Sentence ;
-- RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
-- SSlash = {s : Str ; c2 : Str} ;
--
@@ -28,11 +29,11 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
--
---- Relative
--
-- RCl = {
RCl = { s : Gender => Number => Clause };
-- s : ResLat.Tense => Anteriority => CPolarity => Agr => Str ;
-- c : Case
-- } ;
-- RP = {s : RCase => Str ; a : RAgr} ;
RP = {s : Agr => Str } ;
--
---- Verb
--
@@ -87,9 +88,9 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
A2 = Adjective ** { c : Prep} ;
linref
NP = \np -> combineNounPhrase np ! PronNonDrop ! Nom ;
NP = \np -> combineNounPhrase np ! PronNonDrop ! APreN ! DPostN ! Nom ;
VP = \vp -> vp.adv ++ vp.inf ! VInfActPres ++ vp.obj ++ vp.compl ! Ag Masc Sg Nom ;
S = \s -> combineSentence s ! SPreO ! PreO ! CPreV ! SOV ;
S = \s -> defaultSentence s ! SOV ;
V, VS, VQ, VA, VV = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ;
V2, V2A, V2Q, V2S = \v -> v.act ! (VAct VSim (VPres VInd) Sg P1) ;
Pron = \p -> p.pers.s ! PronNonDrop ! PronNonRefl ! Nom ;

View File

@@ -11,14 +11,16 @@ concrete ConjunctionLat of Conjunction =
ConjS conj ss = {
-- s = \\apos => coord conj.c { init = (ss.s ! conj.c).init ! SPreS ! apos ! CPreV ! SOV ;
-- last = (ss.s ! conj.c).last ! SPreS ! apos ! CPreV ! SOV} ;
s = \\apos => conj.s1 ++ (ss.s ! conj.c).init ! SPreS ! apos ! CPreV ! SOV ++ conj.s2 ++
(ss.s ! conj.c).last ! SPreS ! apos ! CPreV ! SOV ++ conj.s3 ;
s = \\apos => conj.s1 ++ (ss.s ! conj.c).init ! SAPreS ! apos ! DPreN ! VReg ! CPreV ! SOV ++ conj.s2 ++
(ss.s ! conj.c).last ! SAPreS ! apos ! DPreN ! VReg ! CPreV ! SOV ++ conj.s3 ;
o = \\_ => [] ;
v = \\_,_ => [] ;
v = \\_ => [] ;
neg = \\_ => [] ;
compl = [] ;
p = ss.p ;
sadv = [] ;
t = ss.t
t = ss.t ;
det = { s, sp = \\_ => [] } ;
} ;
-- ConjAdv : Conj -> ListAdv -> Adv ; -- here or there
@@ -34,14 +36,13 @@ concrete ConjunctionLat of Conjunction =
-- } ;
-- c => (conjunctDistrTable Case conj (nps.l ! Et)).s
-- } ;
s = \\pd,ca => conj.s1 ++ (nps.s ! conj.c).init ! pd ! ca ++ conj.s2 ++ (nps.s ! conj.c).last ! pd ! ca ++ conj.s3 ;
s = \\pd,ca => conj.s1 ++ (nps.s ! conj.c).init ! pd ! APreN ! DPreN ! ca ++ conj.s2 ++ (nps.s ! conj.c).last ! pd ! APreN ! DPreN ! ca ++ conj.s3;
n = case conj.c of { Et => Pl ; _ => nps.n } ;
g = nps.g ;
p = nps.p ;
adv = nps.adv ;
preap = nps.preap ;
postap = nps.postap ;
det = nps.det
adv = "" ;
preap , postap = { s = \\_ => "" };
det = { s , sp = \\_ => ""} ;
} ;
-- ConjAP : Conj -> ListAP -> AP ;
@@ -62,6 +63,10 @@ concrete ConjunctionLat of Conjunction =
-- } ;
---}
--
-- ConjRS : Conj -> ListRS -> RS
ConjRS conj rss = { s = \\g,n => conj.s1 ++ (rss.s ! conj.c).init ! g ! n ++ conj.s2 ++ (rss.s ! conj.c).last ! g ! n++ conj.s3 };
---- These fun's are generated from the list cat's.
--
@@ -77,7 +82,7 @@ concrete ConjunctionLat of Conjunction =
-- ConsS x xs = { l = \\_ => consrSS bindComma (ss (x.s ! PreS)) (xs.l ! Comma) };
ConsS s ss = {
s = \\co =>
{ init = \\s,a,c,o => coord co { init = (ss.s ! co).init ! s ! a ! c ! o ; last = (ss.s ! co).last ! s ! a ! c ! o } ;
{ init = \\s,a,d,v,c,o => coord co { init = (ss.s ! co).init ! s ! a ! d ! v ! c ! o ; last = (ss.s ! co).last ! s ! a ! d ! v ! c ! o } ;
last = combineSentence s } ;
p = s.p ;
t = s.t
@@ -99,29 +104,21 @@ concrete ConjunctionLat of Conjunction =
-- -- BaseNP : NP -> NP -> ListNP ; -- John, Mary
BaseNP x y = {
-- s = \\c => twoTable Case x y ;
s = \\c => { init = x.s ; last = y.s } ;
g = Masc ; -- Just guessing (but maybe sexist bullshit)
s = \\c => { init = combineNounPhrase x ; last = combineNounPhrase y } ;
g = Neutr ; -- Trying to avoid trouble by choosing a gender
n = matchNumber x.n y.n ;
p = P3 ;
adv = x.adv ++ y.adv ;
preap = lin AP { s = \\a => x.preap.s ! a ++ y.preap.s ! a } ;
postap = lin AP { s = \\a => x.postap.s ! a ++ y.postap.s ! a } ;
isBase = True ;
det = lin Det { s = \\g,c => x.det.s ! g ! c ++ y.det.s ! g ! c ; sp = \\g,c => x.det.sp ! g ! c ++ y.det.sp ! g ! c ; n = matchNumber x.det.n y.det.n } ;
} ;
-- -- ConsNP : NP -> ListNP -> ListNP ; -- John, Mary, Bill
ConsNP x xs = {
-- s = \\_ => consrTable Case bindComma x ( xs.s ! Comma );
s = \\co => { init = \\pd,ca => coord co { init = (xs.s ! co).init ! pd ! ca ; last = (xs.s ! co).last ! pd ! ca} ; last = x.s } ;
s = \\co => { init = \\pd,ap,dp,ca => coord co { init = (xs.s ! co).init ! pd ! ap ! dp ! ca ; last = (xs.s ! co).last ! pd ! ap ! dp ! ca} ; last = combineNounPhrase x } ;
n = matchNumber x.n xs.n ;
g = xs.g ;
p = xs.p ;
adv = x.adv ++ xs.adv ;
preap = lin AP { s = \\a => x.preap.s ! a ++ xs.preap.s ! a } ;
postap = lin AP { s = \\a => x.postap.s ! a ++ xs.postap.s ! a } ;
isBase = False ;
det = lin Det { s = \\g,c => x.det.s ! g ! c ++ xs.det.s ! g ! c ; sp = \\g,c => x.det.sp ! g ! c ++ xs.det.sp ! g ! c ; n = matchNumber x.det.n xs.det.n } ; -- try to combine the determiners, probably not what we want
} ;
-- -- BaseAP : AP -> AP -> ListAP
@@ -130,13 +127,21 @@ concrete ConjunctionLat of Conjunction =
-- -- ConsAP : AP -> ListAP -> ListAP
-- ConsAP x xs =
-- { l = \\_ => consrTable Agr and_Conj.s2 x (xs.l ! Comma ) } ;
-- BaseRS : RS -> RS -> ListRS ;
BaseRS rs1 rs2 = { s = \\co => { init = rs1.s ; last = rs2.s }} ;
-- ConsRS : RS -> List RS -> ListRS ;
ConsRS rs rss = { s = \\co => { init = rs.s ; last = \\g,n => coord co { init = (rss.s ! co).init ! g ! n ; last = (rss.s ! co).last ! g ! n } } } ;
--
lincat
[S] = { s : Coordinator => {init,last : SAdvPos => AdvPos => ComplPos => Order => Str} ; p : Pol ; t : Tense } ; -- TO FIX
[S] = { s : Coordinator => {init,last : SAdvPos => AdvPos => DetPos => VPos => ComplPos => Order => Str} ; p : Pol ; t : Tense } ; -- TO FIX
[Adv] = { s: Coordinator => {init,last : Str}} ;
[NP] = { s : Coordinator => {init,last : PronDropForm => Case => Str} ; g : Gender ; n : Number ; p : Person ; adv : Str ; preap : AP ; postap : AP ; isBase : Bool ; det : Det } ;
[NP] = { s : Coordinator => {init,last : PronDropForm => AdvPos => DetPos => Case => Str} ; g : Gender ; n : Number ; p : Person ; isBase : Bool } ;
[AP] = {s : Coordinator => {init,last : Agr => Str } } ;
[RS] = { s : Coordinator => { init, last : Gender => Number => Str }} ;
oper
-- Generates a new number value given two number values.
-- Pl if any of the two is Pl

View File

@@ -17,6 +17,7 @@ concrete ExtendLat of Extend = CatLat ** open ResLat in {
lin
-- GenNP : NP -> Quant ; -- this man's
GenNP np = { s = \\_ => combineNounPhrase np ! PronNonDrop ! APostN ! DPreN ! Gen ; sp = \\_ => ""} ;
-- GenIP : IP -> IQuant ; -- whose
-- GenRP : Num -> CN -> RP ; -- whose car
@@ -96,6 +97,9 @@ concrete ExtendLat of Extend = CatLat ** open ResLat in {
-- -- this is a generalization of Verb.PassV2 and should replace it in the future.
-- PassVPSlash : VPSlash -> VP ; -- be forced to sleep
PassVPSlash vp = vp ** {
s = \\a => case a of { VAct _ t n p => vp.pass ! VPass t n p } ;
} ;
-- -- the form with an agent may result in a different linearization
-- -- from an adverbial modification by an agent phrase.
@@ -149,6 +153,16 @@ concrete ExtendLat of Extend = CatLat ** open ResLat in {
-- AdjAsCN : AP -> CN ; -- a green one ; en grön (Swe)
-- AdjAsNP : AP -> NP ; -- green (is good)
AdjAsNP ap = {
s = \\_,c => ap.s ! (Ag Neutr Sg c) ;
adv = "" ;
det = { s, sp = \\_ => "" } ;
g = Neutr ;
n = Sg ;
p = P3 ;
postap = { s = \\_ => "" } ;
preap = { s = \\_ => "" } ;
} ;
-- -- infinitive complement for IAdv

View File

@@ -1,9 +1,10 @@
concrete ExtraLat of ExtraLatAbs =
CatLat, ConjunctionLat **
open ResLat, ParadigmsLat, Coordination, Prelude in {
lincat CS = Str ;
open ResLat, ParadigmsLat, RelativeLat, NounLat, Prelude in {
lincat CS = SAdvPos => AdvPos => DetPos => VPos => ComplPos => Order => Str ;
TestRS = { s : Gender => Number => SAdvPos => AdvPos => DetPos => VPos => ComplPos => Order => Str } ;
lin
useS s = combineSentence s ! SPreO ! PreO ! CPreV ! SOV ;
useS s = combineSentence s ;
-- PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space
-- PastPartAP vp = { s = vp.part ! VPassPerf } ;
@@ -50,4 +51,83 @@ concrete ExtraLat of ExtraLatAbs =
Abl_Prep = mkPrep "" Abl ;
inAbl_Prep = mkPrep "in" Abl ;
onAbl_Prep = mkPrep "in" Abl ; -- L...
-- UttS_SVO : S -> Utt
UttS_SVO s = { s = defaultSentence s ! SVO };
-- UttS_VInS : S -> Utt
UttS_VInS s = { s = combineSentence s ! SAPreS ! APreV ! DPostN ! VInS ! CPostV ! SVO } ;
TestRCl t p cl = {
s = \\g,n => combineSentence (combineClause (cl.s ! g ! n) (lin Tense t) t.a (lin Pol p) VQFalse) ;
} ;
-- UseRCl_OSV : Temp -> Pol -> RCl -> RS ;
UseRCl_OSV t p cl = {
s = \\g,n => combineSentence (combineClause (cl.s ! g ! n) (lin Tense t) t.a (lin Pol p) VQFalse) ! SAPreO ! APreV ! DPreN ! VReg ! CPostV ! OSV ;
} ;
-- UseRCl_OVS : Temp -> Pol -> RCl -> RS ;
UseRCl_OVS t p cl = {
s = \\g,n => combineSentence (combineClause (cl.s ! g ! n) (lin Tense t) t.a (lin Pol p) VQFalse) ! SAPreO ! APreV ! DPreN ! VReg ! CPostV ! OVS ; -- SAPreO APreV DPreN VReg CPostV OVS
} ;
-- UseRCl_SOV : Temp -> Pol -> RCl -> RS ;
UseRCl_SOV t p cl = {
s = \\g,n => combineSentence (combineClause (cl.s ! g ! n) (lin Tense t) t.a (lin Pol p) VQFalse) ! SAPreS ! APreV ! DPreN ! VReg ! CPostV ! SOV ;
} ;
-- UseRCl_SVO : Temp -> Pol -> RCl -> RS ;
UseRCl_SVO t p cl = {
s = \\g,n => combineSentence (combineClause (cl.s ! g ! n) (lin Tense t) t.a (lin Pol p) VQFalse) ! SAPreS ! APreV ! DPreN ! VReg ! CPostV ! SVO ;
} ;
-- PrepNP_DPostN : Prep -> NP -> Adv ; -- in the house
PrepNP_DPostN prep np =
mkAdv (prep.s ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPostN ! prep.c ) ;
-- ApposCN_DPostN : CN -> NP -> CN
ApposCN_DPostN cn np =
cn **
{
s = \\n,c => cn.s ! n ! c ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPostN ! c ;
} ; -- massable = cn.massable } ;
-- CompNP_DPostN : NP -> Comp ; -- (be) the man
CompNP np = {s = \\_ =>
(combineNounPhrase np) ! PronNonDrop ! DPostN ! Nom
} ;
-- DetNP_Fem : Det -> NP ; -- these five
DetNP_Fem det = {
s = \\_ => det.s ! Fem ;
g = Fem ;
n = det.n ;
p = P3 ;
adv = "" ;
preap, postap = { s = \\_ => "" } ;
det = { s,sp = \\_ => "" ; n = det.n } ;
} ;
-- AdjAsNP_Fem : AP -> NP ; -- green (is good)
AdjAsNP_Fem ap = {
s = \\_,c => ap.s ! (Ag Fem Sg c) ;
adv = "" ;
det = { s, sp = \\_ => "" } ;
g = Fem ;
n = Sg ;
p = P3 ;
postap = { s = \\_ => "" } ;
preap = { s = \\_ => "" } ;
} ;
-- PredVP_VP_Ellipsis : NP -> VP -> Cl
PredVP_VP_Ellipsis np =
mkClause np emptyVP ;
-- SlashVP_VP_Ellipsis : NP -> VPSlash -> ClSlash ; -- (whom) he sees
SlashVP_VP_Ellipsis np =
mkClause np emptyVP ;
-- FunRP_RP_Ellipsis : Prep -> NP -> RP ;
FunRP_RP_Ellipsis p np = FunRP p np (lin RP { s = \\_ => "" }) ;
RelNP_NP_Ellipsis rs = RelNP emptyNP rs ;
comma_Conj = mkConj "" "," "" Pl Comma ;
}

View File

@@ -1,7 +1,8 @@
abstract ExtraLatAbs =
Extra, Conjunction
Conjunction
** {
cat CS ;
TestRS ;
fun
useS : S -> CS ;
-- do not drop pronouns
@@ -29,4 +30,27 @@ abstract ExtraLatAbs =
-- Preposition with alternate case
inAbl_Prep : Prep ;
onAbl_Prep : Prep ;
-- Add other word orders
UttS_SVO : S -> Utt ;
UttS_VInS : S -> Utt ;
TestRCl : Temp -> Pol -> RCl -> TestRS ;
UseRCl_OSV : Temp -> Pol -> RCl -> RS ;
UseRCl_OVS : Temp -> Pol -> RCl -> RS ;
UseRCl_SOV : Temp -> Pol -> RCl -> RS ;
UseRCl_SVO : Temp -> Pol -> RCl -> RS ;
PrepNP_DPostN : Prep -> NP -> Adv ;
ApposCN_DPostN : CN -> NP -> CN ;
-- More genders
DetNP_Fem : Det -> NP ;
AdjAsNP_Fem : AP -> NP ;
-- Ellipsis
PredVP_VP_Ellipsis : NP -> Cl ;
SlashVP_VP_Ellipsis : NP -> ClSlash ;
FunRP_RP_Ellipsis : Prep -> NP -> RP ;
RelNP_NP_Ellipsis : RS -> NP ;
comma_Conj : Conj ;
}

View File

@@ -8,7 +8,7 @@ concrete GrammarLat of Grammar =
NumeralLat,
SentenceLat,
QuestionLat,
-- RelativeLat,
RelativeLat,
ConjunctionLat,
PhraseLat,
TextX-[Adv],

View File

@@ -2,142 +2,78 @@ resource MissingLat = open GrammarLat, Prelude in {
-- temporary definitions to enable the compilation of RGL API
oper AdNum : AdN -> Card -> Card = notYet "AdNum" ;
oper AddAdvQVP : QVP -> IAdv -> QVP = notYet "AddAdvQVP" ;
oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ;
oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ;
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ;
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ;
oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ;
oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ;
oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ;
oper BaseDAP : DAP -> DAP -> ListDAP = notYet "BaseDAP" ;
oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ;
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
oper CompIP : IP -> IComp = notYet "CompIP" ;
oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ;
oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ;
oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ;
oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ;
oper ConjAP : Conj -> ListAP -> AP = notYet "ConjAP" ;
oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ;
oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ;
oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ;
oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ;
oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ;
oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ;
-- Error: No type found for ConjNPque
oper ConsAP : AP -> ListAP -> ListAP = notYet "ConsAP" ;
oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ;
oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ;
oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ;
oper ConsDAP : DAP -> ListDAP -> ListDAP = notYet "ConsDAP" ;
oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ;
oper DetDAP : Det -> DAP = notYet "DetDAP" ;
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
oper EmbedS : S -> SC = notYet "EmbedS" ;
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
oper ExtAdvS : Adv -> S -> S = notYet "ExtAdvS" ;
oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ;
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
oper IdetIP : IDet -> IP = notYet "IdetIP" ;
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
oper IdRP : RP = notYet "IdRP" ;
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
oper NumDigits : Digits -> Card = notYet "NumDigits" ;
oper NumNumeral : Numeral -> Card = notYet "NumNumeral" ;
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ;
oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ;
oper PossPron : Pron -> Quant = notYet "PossPron" ;
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
oper PartNP : CN -> NP -> CN = notYet "PartNP" ;
oper PossNP : CN -> NP -> CN = notYet "PossNP" ;
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
oper QuestCl : Cl -> QCl = notYet "QuestCl" ;
oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ;
oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ;
oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ;
oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ;
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
oper RelCl : Cl -> RCl = notYet "RelCl" ;
oper RelCN : CN -> RS -> CN = notYet "RelCN" ;
oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ;
oper RelVP : RP -> VP -> RCl = notYet "RelVP" ;
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ;
oper UseRCl : Temp -> Pol -> RCl -> RS = notYet "UseRCl" ;
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
oper AddAdvQVP : QVP -> IAdv -> QVP = notYet "AddAdvQVP" ;
oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ;
oper AdNum : AdN -> Card -> Card = notYet "AdNum" ;
oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ;
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ;
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ;
oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ;
oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ;
oper BaseDAP : DAP -> DAP -> ListDAP = notYet "BaseDAP" ;
oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ;
oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ;
oper CompIP : IP -> IComp = notYet "CompIP" ;
oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ;
oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ;
oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ;
oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ;
oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ;
oper ConjAP : Conj -> ListAP -> AP = notYet "ConjAP" ;
oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ;
oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ;
oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ;
oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ;
oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ;
oper ConsAP : AP -> ListAP -> ListAP = notYet "ConsAP" ;
oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ;
oper ConsDAP : DAP -> ListDAP -> ListDAP = notYet "ConsDAP" ;
oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ;
oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ;
oper CountNP : Det -> NP -> NP = notYet "CountNP" ;
oper DetDAP : Det -> DAP = notYet "DetDAP" ;
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
oper EmbedS : S -> SC = notYet "EmbedS" ;
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
oper ExtAdvS : Adv -> S -> S = notYet "ExtAdvS" ;
oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ;
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
oper IdetIP : IDet -> IP = notYet "IdetIP" ;
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
oper NumDigits : Digits -> Card = notYet "NumDigits" ;
oper NumNumeral : Numeral -> Card = notYet "NumNumeral" ;
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ;
oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ;
oper PartNP : CN -> NP -> CN = notYet "PartNP" ;
oper PossNP : CN -> NP -> CN = notYet "PossNP" ;
oper PossPron : Pron -> Quant = notYet "PossPron" ;
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
oper QuestCl : Cl -> QCl = notYet "QuestCl" ;
oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ;
oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ;
oper QuestQVP : IP -> QVP -> QCl = notYet "QuestQVP" ;
oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ;
oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ;
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
oper RelCN : CN -> RS -> CN = notYet "RelCN" ;
oper RelCl : Cl -> RCl = notYet "RelCl" ;
oper RelS : S -> RS -> S = notYet "RelS" ;
oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ;
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ;
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
oper Use3N3 : N3 -> N2 = notYet "Use3N3" ;
oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ;
oper UseRCl : Temp -> Pol -> RCl -> RS = notYet "UseRCl" ;
-- Error: No type found for UsePronNonDrop
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ;

View File

@@ -11,7 +11,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
adv = cn.adv ;
preap = cn.preap ;
postap = cn.postap ;
det = det
det = { s = det.s ! cn.g ; sp = det.sp ! cn.g } ;
} ;
-- UsePN : PN -> NP ; -- John
@@ -22,7 +22,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
p = P3 ;
adv = "" ;
preap, postap = { s = \\_ => "" } ;
det = { s,sp = \\_,_ => "" ; n = Sg }
det = { s,sp = \\_ => "" ; n = Sg }
} ;
-- UsePron : Pron -> NP ; -- he
@@ -33,13 +33,13 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
s = \\pd,c => p.pers.s ! pd ! PronNonRefl ! c;
adv = "" ;
preap, postap = { s = \\_ => "" } ;
det = { s,sp = \\_,_ => "" ; n = p.pers.n } ;
det = { s,sp = \\_ => "" ; n = p.pers.n } ;
} ;
-- PredetNP : Predet -> NP -> NP ; -- only the man
PredetNP predet np =
np ** {
det = np.det ** { s = \\g,c => predet.s ++ np.det.s ! g ! c }
det = { s = \\c => predet.s ++ np.det.s ! c ; sp = np.det.sp }
} ;
-- PPartNP : NP -> V2 -> NP ; -- the man seen
@@ -64,7 +64,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
ExtAdvNP = AdvNP ;
-- RelNP : NP -> RS -> NP ; -- Paris, which is here
RelNP np rs = np ** { adv = rs.s ++ np.adv } ;
RelNP np rs = np ** { adv = bindComma ++ rs.s ! np.g ! np.n ++ np.adv } ;
-- DetNP : Det -> NP ; -- these five
DetNP det = {
@@ -74,7 +74,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
p = P3 ;
adv = "" ;
preap, postap = { s = \\_ => "" } ;
det = { s,sp = \\_,_ => "" ; n = det.n } ;
det = { s,sp = \\_ => "" ; n = det.n } ;
} ;
--
-- DetQuantOrd quant num ord = {
@@ -91,7 +91,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
-- PossPron p = {
PossPron p = { s = \\a => p.poss.s ! PronNonRefl ! a ; sp = \\_ => "" } ;
-- s = \\_,_ => p.s ! Gen ;
-- sp = \\_,_ => p.sp
-- } ;
@@ -130,7 +130,7 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
-- s = case cn.massable of { True => cn.s ! Sg ; False => \\_ => nonExist } ;
n = Sg ;
p = P3 ;
det = { s,sp = \\_,_ => "" ; n = Sg } ;
det = { s,sp = \\_ => "" ; n = Sg } ;
};
UseN n = -- N -> CN
@@ -177,11 +177,11 @@ concrete NounLat of Noun = CatLat ** open ResLat, Prelude, ConjunctionLat in {
ApposCN cn np =
cn **
{
s = \\n,c => cn.s ! n ! c ++ (combineNounPhrase np) ! PronNonDrop ! c ;
s = \\n,c => cn.s ! n ! c ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! c ;
} ; -- massable = cn.massable } ;
-- CountNP : Det -> NP -> NP ; -- three of them, some of the boys
CountNP det np = np ** {
det = det ** { s = \\g,c => det.s ! g ! c++ np.det.s ! g ! c } ;
det = { s = \\c => det.s ! np.g ! c ++ np.det.s ! c ; sp = \\c => det.sp ! np.g ! c ++ np.det.sp ! c } ;
};
}

View File

@@ -3,7 +3,7 @@ concrete PhraseLat of Phrase = CatLat ** open Prelude, ResLat in {
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
--
-- UttS : S -> Utt
UttS s = { s = combineSentence s ! SPreS ! PreS ! CPreV ! SOV };
UttS s = { s = defaultSentence s ! SOV };
-- UttQS : QS -> Utt
UttQS qs = {s = qs.s ! QDir } ;
@@ -18,7 +18,7 @@ concrete PhraseLat of Phrase = CatLat ** open Prelude, ResLat in {
-- UttIAdv : IAdv -> Utt
UttIAdv iadv = iadv ;
-- UttNP : NP -> Utt
UttNP np = {s = np.adv ++ (combineNounPhrase np) ! PronNonDrop ! Nom} ;
UttNP np = {s = np.adv ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom} ;
-- UttVP : VP -> Utt
UttVP vp = ss (vp.inf ! VInfActPres) ;
@@ -36,6 +36,6 @@ concrete PhraseLat of Phrase = CatLat ** open Prelude, ResLat in {
PConjConj conj = {s = conj.s2} ; ---
--
NoVoc = {s = []} ;
VocNP np = {s = "," ++ (combineNounPhrase np) ! PronNonDrop ! ResLat.Voc} ; ---- what is the compiler error here? AR 1/2/2014 -- answer: clash with the type name Voc 3/2
VocNP np = {s = bindComma ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! ResLat.Voc} ; ---- what is the compiler error here? AR 1/2/2014 -- answer: clash with the type name Voc 3/2
--
}

View File

@@ -5,7 +5,7 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
lin
-- QuestCl : Cl -> QCl ; -- does John walk
QuestCl cl = cl ** {
v = \\t,a,_,ap,cp => cl.v ! t ! a ! VQTrue ! ap ! cp ;
v = \\t,a,_,ap => cl.v ! t ! a ! VQTrue ! ap ;
q = ""
} ;
@@ -17,7 +17,9 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
neg = \\_,_ => "" ;
o = \\_ => vp.obj ;
q = ip.s ! Nom ;
v = \\t,a,_,ap,cp => vp.s ! VAct (anteriorityToVAnter a) (tenseToVTense t) ip.n P3 ! VQFalse
v = \\t,a,_,ap => vp.s ! VAct (anteriorityToVAnter a) (tenseToVTense t) ip.n P3 ! VQFalse ;
compl = vp.compl ! Ag Masc ip.n Nom ; -- default gender masculine
det = { s, sp = \\_ => [] ; n = ip.n } ;
} ;
-- let qcl = mkQuestion { s = ip.s ! Nom } ( mkClause emptyNP vp )
-- in {s = \\t,a,b,qd => qcl.s ! t ! a ! b ! qd} ;
@@ -37,9 +39,11 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
s = \\_ => "" ;
adv = "" ;
neg = \\_,_ => "" ;
o = \\_ => combineNounPhrase np ! PronNonDrop ! Nom ; -- Should probably not go into the object field
o = \\_ => combineNounPhrase np ! PronNonDrop ! APostN ! DPreN ! Nom ; -- Should probably not go into the object field
q = icomp.s ;
v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ;
v = \\t,a,_,ap => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ;
det = { s , sp = \\_=> [] ; n = Sg } ; -- default number singilar
compl = "" ;
} ;
--
--

View File

@@ -2,14 +2,14 @@ concrete RelativeLat of Relative = CatLat ** open ResLat in {
--
-- flags optimize=all_subs ;
--
-- lin
lin
--
-- RelCl cl = {
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
-- c = Nom
-- } ;
--
-- RelVP rp vp = {
RelVP rp vp = { s = \\g,n => mkClause (emptyNP ** { s = \\_,c => rp.s ! (Ag g n c) ; g = g ; n = n } ) vp };
-- s = \\t,ant,b,ag =>
-- let
-- agr = case rp.a of {
@@ -26,18 +26,42 @@ concrete RelativeLat of Relative = CatLat ** open ResLat in {
---- relative are defined in $ExtraLat.gf$ ("that we are looking at",
---- "we are looking at").
--
-- RelSlash rp slash = {
-- RelSlash : RP -> ClSlash -> RCl ;
RelSlash rp slash = { s = \\g,n => slash ** { adv = rp.s ! Ag g n Gen } } ; -- abuse adverbs again
-- s = \\t,a,p,agr =>
-- slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ;
-- c = Acc
-- } ;
--
-- FunRP p np rp = {
FunRP p np rp = {
s = \\a => case a of { Ag g n c => rp.s ! a ++ p.s ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Acc };
-- s = \\c => (combineNounPhrase np) ! PronNonDrop ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
-- a = RAg np.a
-- } ;
} ;
--
-- IdRP =
IdRP = {
s = table {
Ag Masc Sg (Nom | Voc) => "qui" ;
Ag Fem Sg (Nom | Voc) => "quae" ;
Ag Neutr Sg (Nom | Voc) => "quod" ;
Ag _ Sg Gen => "cuius" ;
Ag _ Sg Dat => "cui" ;
Ag Masc Sg Acc => "quem" ;
Ag Fem Sg Acc => "quam" ;
Ag Neutr Sg Acc => "quod" ;
Ag (Masc | Neutr) Sg Abl => "quo" ;
Ag Fem Sg Abl => "qua" ;
Ag Masc Pl (Nom | Voc) => "qui" ;
Ag (Fem | Neutr) Pl (Nom | Voc) => "quae" ;
Ag (Masc | Neutr) Pl Gen => "quorum" ;
Ag Fem Pl Gen => "quarum" ;
Ag _ Pl Dat => "quibus" ;
Ag Masc Pl Acc => "quos" ;
Ag Fem Pl Acc => "quas" ;
Ag Neutr Pl Acc => "quae" ;
Ag _ Pl Abl => "cui"
}
}
;
-- let varr : Str -> Str = \x -> variants {x ; "that"} --- for bwc
-- in {
-- s = table {

View File

@@ -22,13 +22,22 @@ param
adv : Str ;
preap : {s : Agr => Str } ;
postap : {s : Agr => Str } ;
det : Determiner
det : { s, sp : Case => Str } ;
} ;
param
-- Parameters to determine word order
-- top level order, e.g. subject verb object
Order = SVO | VSO | VOS | OSV | OVS | SOV ;
AdvPos = PreS | PreV | PreO | PreNeg | InV | InS ; -- | InO
-- determiner position in a noun phrase, e.g. before or after noun
DetPos = DPreN | DPostN ;
-- verb position, eithe regular or interleaved in the subject
VPos = VReg | VInS ;
-- (verb-modifying) adverb position
AdvPos = APreS | APreV | APreO | APreNeg | AInV | AInS | APreN | APostN ; -- | InO
-- verb complement position in relation to verb
ComplPos = CPreV | CPostV ;
SAdvPos = SPreS | SPreV | SPreO | SPreNeg ;
-- sentence adverb position
SAdvPos = SAPreS | SAPreV | SAPreO | SAPreNeg ;
param
Agr = Ag Gender Number Case ; -- Agreement for NP et al.
oper
@@ -141,15 +150,20 @@ param
p = P3;
adv = "" ;
preap, postap = { s = \\_ => "" } ;
det = { s = \\_,_ => "" ; sp = \\_,_ => "" ; n = n} ;
det = { s,sp = \\_ => "" ; n = n} ;
} ;
dummyNP : Str -> NounPhrase = \s -> regNP s s s s s s Masc Sg ;
emptyNP : NounPhrase = { s = \\_,_ => ""; g = Masc; n = Sg; p = P1 ; adv = "" ; preap, postap = { s = \\_ => "" } ; det = { s = \\_,_ => "" ; sp = \\_,_ => "" ; n = Sg } ;};
emptyNP : NounPhrase = { s = \\_,_ => ""; g = Masc; n = Sg; p = P3 ; adv = "" ; preap, postap = { s = \\_ => "" } ; det = { s , sp = \\_ => "" ; n = Sg } ;};
combineNounPhrase : NounPhrase -> PronDropForm => Case => Str = \np ->
\\pd,c => np.det.s ! np.g ! c ++ np.adv ++ np.preap.s ! (Ag np.g np.n c) ++ np.s ! pd ! c ++ np.postap.s ! (Ag np.g np.n c) ++ np.det.sp ! np.g ! c ;
combineNounPhrase : NounPhrase -> PronDropForm => AdvPos => DetPos => Case => Str = \np ->
let detpren : DetPos -> { s , sp : Case => Str} = \dp -> case dp of { DPreN => np.det ; _ => { s, sp = \\_ => [] } } ;
detpostn : DetPos -> { s , sp : Case => Str} = \dp -> case dp of { DPostN => np.det ; _ => { s, sp = \\_ => [] } } ;
apren : AdvPos -> Str = \ap -> case ap of { APreN => np.adv ; _ => [] } ;
apostn : AdvPos -> Str = \ap -> case ap of { APostN => np.adv ; _ => [] } ;
in
\\pd,ap,dp,c => apren ap ++ (detpren dp).s ! c ++ np.preap.s ! (Ag np.g np.n c) ++ np.s ! pd ! c ++ np.postap.s ! (Ag np.g np.n c) ++ (detpren dp).sp ! c ++ (detpostn dp).s ! c ++ apostn ap ;
-- also used for adjectives and so on
-- adjectives
@@ -264,6 +278,7 @@ param
oper
VerbPhrase : Type = {
s : VActForm => VQForm => Str ;
pass : VPassForm => VQForm => Str ;
part : VPartForm => Agr => Str ;
inf : VInfForm => Str ;
imp : VImpForm => Str ;
@@ -274,6 +289,17 @@ param
ObjectVerbPhrase : Type = VerbPhrase ** {c : Preposition} ;
emptyVP : VerbPhrase = {
s = \\_,_ => "" ;
pass = \\_,_ => "" ;
part = \\_,_ => "" ;
inf = \\_ => "" ;
imp = \\_ => "" ;
obj = "";
compl = \\_ => "" ;
adv = ""
} ;
Verb : Type = {
act : VActForm => Str ;
pass : VPassForm => Str ;
@@ -1236,6 +1262,7 @@ oper
predV : Verb -> VerbPhrase = \v -> {
s = \\a,q => v.act ! a ++ case q of { VQTrue => Prelude.BIND ++ "ne"; VQFalse => "" };
pass = \\p,q => v.pass ! p ++ case q of { VQTrue => Prelude.BIND ++ "ne"; VQFalse => "" };
part = v.part;
imp = v.imp ;
inf = v.inf ;
@@ -1254,20 +1281,22 @@ oper
insertObj : NounPhrase -> Preposition -> VerbPhrase -> VerbPhrase = \np,prep,vp -> {
s = vp.s ;
pass = vp.pass ;
part = vp.part ;
imp = vp.imp ;
inf = vp.inf ;
obj = np.det.s ! np.g ! prep.c ++ np.preap.s ! (Ag np.g np.n prep.c) ++ (appPrep prep (np.s ! PronNonDrop)) ++ np.postap.s ! (Ag np.g np.n prep.c) ++ np.det.sp ! np.g ! prep.c ++ vp.obj ;
obj = np.det.s ! prep.c ++ np.preap.s ! (Ag np.g np.n prep.c) ++ (appPrep prep (np.s ! PronNonDrop)) ++ np.postap.s ! (Ag np.g np.n prep.c) ++ np.det.sp ! prep.c ++ vp.obj ;
compl = vp.compl ;
adv = vp.adv ++ np.adv
} ;
insertObjc: NounPhrase -> VPSlash -> VPSlash = \np,vp -> {
s = vp.s ;
pass = vp.pass ;
part = vp.part ;
imp = vp.imp ;
inf = vp.inf ;
obj = np.det.s ! np.g ! vp.c.c ++ np.preap.s ! (Ag np.g np.n vp.c.c) ++ (appPrep vp.c (np.s ! PronNonDrop)) ++ np.postap.s ! (Ag np.g np.n vp.c.c) ++ np.det.sp ! np.g ! vp.c.c ++ vp.obj ;
obj = np.det.s ! vp.c.c ++ np.preap.s ! (Ag np.g np.n vp.c.c) ++ (appPrep vp.c (np.s ! PronNonDrop)) ++ np.postap.s ! (Ag np.g np.n vp.c.c) ++ np.det.sp ! vp.c.c ++ vp.obj ;
compl = vp.compl ;
c = vp.c ;
adv = vp.adv ++ np.adv
@@ -1275,6 +1304,7 @@ oper
insertAdj : (Agr => Str) -> VerbPhrase -> VerbPhrase = \adj,vp -> {
s = vp.s ;
pass = vp.pass ;
part = vp.part ;
imp = vp.imp ;
inf = vp.inf ;
@@ -1285,6 +1315,7 @@ oper
insertAdv : Adverb -> VerbPhrase -> VerbPhrase = \a,vp -> {
s = vp.s ;
pass = vp.pass ;
part = vp.part ;
imp = vp.imp ;
inf = vp.inf ;
@@ -1297,13 +1328,22 @@ oper
Sentence =
{
s,o,neg : AdvPos => Str ; -- Subject, verbphrase, object and negation particle plus potential adverb
v : AdvPos => ComplPos => Str ;
v : AdvPos => Str ;
t : C.Tense ; -- tense marker
p : C.Pol ; -- polarity marker
sadv : Str -- sentence adverb¡
sadv : Str ; -- sentence adverb¡
det : { s , sp : Case => Str } ;
compl : Str -- verb complement
} ;
Clause = {s,o : AdvPos => Str ; v : Tense => Anteriority => VQForm => AdvPos => ComplPos => Str ; neg : Polarity => AdvPos => Str ; adv : Str } ;
Clause =
{s : AdvPos => Str ;
o : AdvPos => Str ;
v : Tense => Anteriority => VQForm => AdvPos => Str ;
det : { s , sp : Case => Str } ;
compl : Str ;
neg : Polarity => AdvPos => Str ;
adv : Str } ;
QClause = {s : C.Tense => Anteriority => C.Pol => QForm => Str} ;
mkClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
@@ -1314,39 +1354,35 @@ oper
compl = vp.compl ! Ag np.g np.n Nom ;
-- helper functions to either place the adverb in the designated position
-- or an empty string instead
pres : AdvPos -> Str = \ap -> case ap of { PreS => adv ; _ => [] } ;
prev : AdvPos -> Str = \ap -> case ap of { PreV => adv ; _ => [] } ;
preo : AdvPos -> Str = \ap -> case ap of { PreO => adv ; _ => [] } ;
preneg : AdvPos -> Str = \ap -> case ap of { PreNeg => adv ; _ => [] } ;
ins : AdvPos -> Str = \ap -> case ap of { InS => adv ; _ => [] } ;
inv : AdvPos -> Str = \ap -> case ap of { InV => adv ; _ => [] } ;
cprev : ComplPos -> Str = \cp -> case cp of { CPreV => compl ; _ => [] } ;
cpostv : ComplPos -> Str = \cp -> case cp of { CPostV => compl ; _ => [] }
pres : AdvPos -> Str = \ap -> case ap of { APreS => adv ; _ => [] } ;
prev : AdvPos -> Str = \ap -> case ap of { APreV => adv ; _ => [] } ;
preo : AdvPos -> Str = \ap -> case ap of { APreO => adv ; _ => [] } ;
preneg : AdvPos -> Str = \ap -> case ap of { APreNeg => adv ; _ => [] } ;
ins : AdvPos -> Str = \ap -> case ap of { AInS => adv ; _ => [] } ;
inv : AdvPos -> Str = \ap -> case ap of { AInV => adv ; _ => [] } ;
in
{
-- subject part of the clause:
-- advpos is the adverb position in the clause
s = \\advpos =>
pres advpos ++ -- adverbs can be placed in the beginning of the clause
np.det.s ! np.g ! Nom ++ -- the determiner, if any
np.preap.s ! (Ag np.g np.n Nom) ++ -- adjectives which come before the subject noun, agreeing with it
ins advpos ++ -- adverbs can be placed within the subject noun phrase
np.s ! PronDrop ! Nom ++ -- the noun of the subject noun phrase in nominative
np.postap .s ! (Ag np.g np.n Nom) ++ -- adjectives which come after the subject noun, agreeing with it
np.det.sp ! np.g ! Nom ; -- second part of split determiners
np.postap .s ! (Ag np.g np.n Nom) ; -- adjectives which come after the subject noun, agreeing with it
-- verb part of the clause:
-- tense and anter(ority) for the verb tense
-- vqf is the VQForm parameter which defines if the ordinary verbform or the quistion form with suffix "-ne" will be used
-- advposis the adverb position in the clause
-- comppos is the position of the verb complement
v = \\tense,anter,vqf,advpos,complpos =>
v = \\tense,anter,vqf,advpos =>
prev advpos ++ -- adverbs can be placed in the before the verb phrase
cprev complpos ++ -- verb phrase complement, e.g. predicative expression, agreeing with the subject, can go before the verb
inv advpos ++ -- adverbs can be placed within the verb phrase
-- verb form with conversion between different forms of tense and aspect
vp.s ! VAct ( anteriorityToVAnter anter ) ( tenseToVTense tense ) np.n np.p ! vqf ++
cpostv complpos ; -- complement can also go after the verb
vp.s ! VAct ( anteriorityToVAnter anter ) ( tenseToVTense tense ) np.n np.p ! vqf ; -- ++
det = np.det ;
-- verb complement
compl = compl ;
-- object part of the clause
o = \\advpos => preo advpos ++ vp.obj ;
-- optional negation particle, adverbs can be placed before the negation
@@ -1355,41 +1391,79 @@ oper
} ;
combineClause : Clause -> C.Tense -> Anteriority -> C.Pol -> VQForm -> Sentence = \cl,tense,anter,pol,vqf ->
{ s = cl.s ;
o = cl.o ;
v = cl.v ! tense.t ! anter ! vqf ;
cl **
{
v = \\advpos => cl.v ! tense.t ! anter ! vqf ! advpos ;
neg = cl.neg ! pol.p ;
sadv = "" ;
sadv = cl.adv ;
t = tense ;
p = pol
p = pol ;
} ;
combineSentence : Sentence -> ( SAdvPos => AdvPos => ComplPos => Order => Str ) = \s ->
combineSentence : Sentence -> ( SAdvPos => AdvPos => DetPos => VPos => ComplPos => Order => Str ) = \s ->
let
pres : SAdvPos -> Str = \ap -> case ap of { SPreS => s.sadv ; _ => [] } ;
prev : SAdvPos -> Str = \ap -> case ap of { SPreV => s.sadv ; _ => [] } ;
preo : SAdvPos -> Str = \ap -> case ap of { SPreO => s.sadv ; _ => [] } ;
preneg : SAdvPos -> Str = \ap -> case ap of { SPreNeg => s.sadv ; _ => [] }
advpres : SAdvPos -> Str = \ap -> case ap of { SAPreS => s.sadv ; _ => [] } ;
advprev : SAdvPos -> Str = \ap -> case ap of { SAPreV => s.sadv ; _ => [] } ;
advpreo : SAdvPos -> Str = \ap -> case ap of { SAPreO => s.sadv ; _ => [] } ;
advpreneg : SAdvPos -> Str = \ap -> case ap of { SAPreNeg => s.sadv ; _ => [] } ;
detpren : DetPos -> { s, sp : Case => Str } = \dp -> case dp of { DPreN => s.det; _ => { s,sp = \\_ => [] } } ;
detpostn : DetPos -> { s, sp : Case => Str } = \dp -> case dp of { DPostN => s.det ; _ => { s , sp = \\_ => [] } } ;
verbins : VPos -> ResLat.AdvPos => Str = \vp -> case vp of { VInS => s.v ; _ => \\_ => [] } ;
verbreg : VPos -> ResLat.AdvPos => Str = \vp -> case vp of { VReg => s.v ; _ => \\_ => [] } ;
complprev : ComplPos -> Str = \cp -> case cp of { CPreV => s.compl ; _ => [] } ;
complpostv : ComplPos -> Str = \cp -> case cp of { CPostV => s.compl ; _ => [] }
in
-- sap is the position of the sentence adverbial
-- ap is the position of the adverb
-- cp is the position of the verb complement
\\sap,ap,cp,order => case order of {
SVO => s.t.s ++ s.p.s ++ pres sap ++ s.s ! ap ++ preneg sap ++ s.neg ! ap ++ prev sap ++ s.v ! ap ! cp ++ preo sap ++ s.o ! ap;
VSO => s.t.s ++ s.p.s ++ preneg sap ++ s.neg ! ap ++ prev sap ++ s.v ! ap ! cp ++ pres sap ++ s.s ! ap ++ preo sap ++ s.o ! ap;
VOS => s.t.s ++ s.p.s ++ preneg sap ++ s.neg ! ap ++ prev sap ++ s.v ! ap ! cp ++ preo sap ++ s.o ! ap ++ pres sap ++ s.s ! ap ;
OSV => s.t.s ++ s.p.s ++ preo sap ++ s.o ! ap ++ pres sap ++ s.s ! ap ++ preneg sap ++ s.neg ! ap ++ prev sap ++ s.v ! ap ! cp;
OVS => s.t.s ++ s.p.s ++ preo sap ++ s.o ! ap ++ preneg sap ++ s.neg ! ap ++ prev sap ++ s.v ! ap ! cp ++ pres sap ++ s.s ! ap ;
SOV => s.t.s ++ s.p.s ++ pres sap ++ s.s ! ap ++ preo sap ++ s.o ! ap ++ preneg sap ++ s.neg ! ap ++ prev sap ++ s.v ! ap ! cp
-- sadvpos is the position of the sentence adverbial
-- advpos is the position of the adverb
-- detpos is the position of the determiner (relative to the noun)
-- vpos is the position of the main verb (either regular or interleaved)
-- complosp is the position of the verb complement
\\sadvpos,advpos,detpos,verbpos,complpos,order => case order of {
SVO =>
s.t.s ++ s.p.s ++
advpres sadvpos ++ (detpren detpos).s ! Nom ++ s.s ! advpos ++ (verbins verbpos) ! advpos ++ (detpostn detpos).s ! Nom ++ (detpren detpos).sp ! Nom ++
advpreneg sadvpos ++ s.neg ! advpos ++
advprev sadvpos ++ (complprev complpos) ++ (verbreg verbpos) ! advpos ++ (complpostv complpos) ++
advpreo sadvpos ++ s.o ! advpos;
VSO =>
s.t.s ++ s.p.s ++
advpreneg sadvpos ++ s.neg ! advpos ++
advprev sadvpos ++ (complprev complpos) ++ (verbreg verbpos) ! advpos ++ (complpostv complpos) ++
advpres sadvpos ++ (detpren detpos).s ! Nom ++ s.s ! advpos ++ (verbins verbpos) ! advpos ++ (detpostn detpos).s ! Nom ++ (detpren detpos).sp ! Nom ++
advpreo sadvpos ++ s.o ! advpos;
VOS =>
s.t.s ++ s.p.s ++
advpreneg sadvpos ++ s.neg ! advpos ++
advprev sadvpos ++ (complprev complpos) ++ (verbreg verbpos) ! advpos ++ (complpostv complpos) ++
advpreo sadvpos ++ s.o ! advpos ++
advpres sadvpos ++ (detpren detpos).s ! Nom ++ s.s ! advpos ++ (verbins verbpos) ! advpos ++ (detpostn detpos).s ! Nom ++ (detpren detpos).sp ! Nom ;
OSV =>
s.t.s ++ s.p.s ++
advpreo sadvpos ++ s.o ! advpos ++
advpres sadvpos ++ (detpren detpos).s ! Nom ++ s.s ! advpos ++ (verbins verbpos) ! advpos ++ (detpostn detpos).s ! Nom ++ (detpren detpos).sp ! Nom++
advpreneg sadvpos ++ s.neg ! advpos ++
advprev sadvpos ++ (complprev complpos) ++ (verbreg verbpos) ! advpos ++ (complpostv complpos) ;
OVS =>
s.t.s ++ s.p.s ++
advpreo sadvpos ++ s.o ! advpos ++
advpreneg sadvpos ++ s.neg ! advpos ++
advprev sadvpos ++ (complprev complpos) ++ (verbreg verbpos) ! advpos ++ (complpostv complpos) ++
advpres sadvpos ++ (detpren detpos).s ! Nom ++ s.s ! advpos ++ (verbins verbpos) ! advpos ++ (detpostn detpos).s ! Nom ++ (detpren detpos).sp ! Nom ;
SOV =>
s.t.s ++ s.p.s ++
advpres sadvpos ++ (detpren detpos).s ! Nom ++ s.s ! advpos ++ (verbins verbpos) ! advpos ++ (detpostn detpos).s ! Nom ++ (detpren detpos).sp ! Nom ++
advpreo sadvpos ++ s.o ! advpos ++
advpreneg sadvpos ++ s.neg ! advpos ++
advprev sadvpos ++ (complprev complpos) ++ (verbreg verbpos) ! advpos ++ (complpostv complpos)
} ;
defaultSentence : Sentence -> Order => Str = \s -> combineSentence s ! SAPreS ! APreV ! DPreN ! VReg ! CPreV ;
-- questions
mkQuestion : SS -> Clause -> QClause = \ss,cl -> {
s = \\tense,anter,pol,form => case form of {
QDir => ss.s ++ (combineSentence (combineClause cl tense anter pol VQFalse)) ! SPreS ! PreS ! CPreV ! OVS ;
QIndir => ss.s ++ (combineSentence (combineClause cl tense anter pol VQFalse)) ! SPreO ! PreO ! CPreV ! OSV
QDir => ss.s ++ (defaultSentence (combineClause cl tense anter pol VQFalse)) ! OVS ;
QIndir => ss.s ++ (combineSentence (combineClause cl tense anter pol VQFalse)) ! SAPreO ! APreO ! DPreN ! VReg ! CPreV ! OSV
}
};

View File

@@ -52,29 +52,31 @@ concrete SentenceLat of Sentence = CatLat ** open Prelude, ResLat in {
{
s = let qs = combineClause cl t t.a p VQTrue in
\\q => case q of {
QDir => cl.q ++ combineSentence qs ! SPreS ! PreV ! CPostV ! SVO ; -- t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV ++ cl.o ! PreV ;
QIndir => cl.q ++ combineSentence qs ! SPreS ! PreV ! CPostV ! SOV -- t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.o ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV
QDir => cl.q ++ defaultSentence qs ! SVO ; -- t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV ++ cl.o ! PreV ;
QIndir => cl.q ++ defaultSentence qs ! SOV -- t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.o ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV
}
} ;
-- UseRCl t p cl = {
-- UseRCl : Temp -> Pol -> RCl -> RS ;
UseRCl t p cl = {
s = \\g,n => defaultSentence (combineClause (cl.s ! g ! n) (lin Tense t) t.a (lin Pol p) VQFalse) ! SOV ;
-- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ;
-- c = cl.c
-- } ;
} ;
-- UseSlash t p cl = {
-- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ;
-- c2 = cl.c2
-- } ;
--
-- AdvS : Adv -> S -> S
AdvS adv s = { s = s.s ; o = s.o ; v = s.v ; neg = s.neg ; t = s.t ; p = s.p ; sadv = adv.s ! Posit ++ s.sadv } ;
AdvS adv s = -- { s = s.s ; o = s.o ; v = s.v ; neg = s.neg ; t = s.t ; p = s.p ; sadv = adv.s ! Posit ++ s.sadv } ;
s ** { sadv = adv.s ! Posit ++ s.sadv } ;
-- This covers subjunctive clauses, but they can also be added to the end.
-- SSubjS : S -> Subj -> S -> S ; -- I go home if she comes
-- TO FIX
-- SSubjS s1 subj s2 = { s = \\_ => subj.s ++ s2.s ! PreS ++ s1.s ! PreS ; sadv = lin Adv (mkAdverb []) } ;
-- RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ;
-- RelS s r = {s = s.s ! APreV ++ "," ++ r.s } ;
--
-- oper
-- ctr = contrNeg True ; -- contracted negations

View File

@@ -3,49 +3,56 @@
concrete SymbolLat of Symbol = CatLat ** open Prelude, ResLat, ParadigmsLat, TenseX in {
lin
-- SymbPN : Symb -> PN ;
SymbPN i = {s = \\c => i.s ; g = Neutr ; n = Sg } ; --- c
-- IntPN : Int -> PN ;
IntPN i = {s = \\c => i.s ; g = Neutr ; n = Sg } ; --- c
-- FloatPN : Float -> PN ;
FloatPN i = {s = \\c => i.s ; g = Neutr ; n = Sg } ; --- c
-- NumPN : Num -> PN ;
NumPN i = {s = \\c => i.s ! Neutr ! c; g = Neutr ; n = Pl } ; --- c
-- CNIntNP : CN -> Int -> NP ;
CNIntNP cn i = {
s = \\_,c => (cn.s ! Sg ! Nom ++ i.s) ;
g = cn.g ;
n = Sg ;
adv = [] ;
det = { s = \\_,_ => [] ; n = Sg ; sp = \\_,_ => [] } ;
det = { s , sp = \\_ => [] ; n = Sg } ;
p = P3 ;
postap = { s = \\_ => [] } ;
preap = { s = \\_ => [] } ;
preap , postap = { s = \\_ => [] } ;
} ;
--CNSymbNP : CN -> Symb -> NP ;
CNSymbNP det cn xs = {
s = \\_,c => (cn.s ! Sg ! Nom ++ xs.s ) ;
g = cn.g ;
n = det.n ;
adv = [] ;
det = det ;
det = { s = det.s ! cn.g ; sp = det.sp ! cn.g } ;
p = P3 ;
postap = { s = \\_ => [] } ;
preap = { s = \\_ => [] } ;
preap , postap = { s = \\_ => [] } ;
} ;
-- s = \\c => det.s ++ cn.s ! det.n ! c ++ xs.s ;
-- a = agrgP3 det.n cn.g
-- } ;
-- } ;
-- CNNumNP : CN -> Num -> NP ;
CNNumNP cn i = {
s = \\_,c => (cn.s ! Sg ! Nom ++ i.s ! cn.g ! Nom ) ;
g = cn.g ;
n = Sg ;
adv = [] ;
det = { s = \\_,_ => [] ; n = Sg ; sp = \\_,_ => [] } ;
det = { s , sp = \\_ => [] ; n = Sg };
p = P3 ;
postap = { s = \\_ => [] } ;
preap = { s = \\_ => [] } ;
preap , postap = { s = \\_ => [] } ;
} ;
--
-- SymbS : Symb -> S ;
SymbS sy = { s = \\_ => sy.s ; o , neg = \\_ => "" ; p = PPos ; sadv = "" ; t = TPres ; v = \\_ => "" ; compl = "" ; det = { s , sp = \\_ => [] ; n = Sg } } ;
SymbS sy = { s = \\_ => sy.s ; neg = \\_ => "" ; o = \\_ => "" ; p = PPos ; sadv = "" ; t = TPres ; v = \\_,_ => "" } ;
--
-- SymbNum : Symb -> Num
SymbNum sy = {s = \\_,_ => sy.s ; n = Pl } ;
-- SymbOrd : Symb -> Ord
SymbOrd sy = { s = \\g,n,c => sy.s } ; -- does not inflect properly
lincat

View File

@@ -19,15 +19,17 @@ concrete VerbLat of Verb = CatLat ** open (S=StructuralLat),ResLat,IrregLat,Extr
-- ComplVS : VS -> S -> VP ; -- say that she runs
ComplVS vs s = -- insertObj ( dummyNP (S.that_Subj.s ++ s.s ! PreS)) Nom_Prep (predV v) ;
vs ** {
s = \\af,qf => vs.act ! af ;
compl = \\ag => combineSentence s ! SPreS ! PreV ! CPostV ! SOV ; -- s.s ! QIndir ;
s = \\a,q => vs.act ! a ++ case q of { VQTrue => Prelude.BIND ++ "ne"; VQFalse => "" };
pass = \\p,q => vs.pass ! p ++ case q of { VQTrue => Prelude.BIND ++ "ne"; VQFalse => "" };
compl = \\ag => defaultSentence s ! SOV ; -- s.s ! QIndir ;
adv = [] ;
obj = []
} ;
-- ComplVQ : VQ -> QS -> VP ; -- wonder who runs
ComplVQ vq qs = -- insertObj (dummyNP (q.s ! QIndir)) Nom_Prep (predV v) ;
vq ** {
s = \\af,qf => vq.act ! af ;
s = \\a,q => vq.act ! a ++ case q of { VQTrue => Prelude.BIND ++ "ne"; VQFalse => "" };
pass = \\p,q => vq.pass ! p ++ case q of { VQTrue => Prelude.BIND ++ "ne"; VQFalse => "" };
compl = \\ag => qs.s ! QIndir ;
adv = [] ;
obj = []
@@ -115,7 +117,7 @@ concrete VerbLat of Verb = CatLat ** open (S=StructuralLat),ResLat,IrregLat,Extr
-- CompNP : NP -> Comp ; -- (be) the man
CompNP np = {s = \\_ =>
(combineNounPhrase np) ! PronNonDrop ! Nom
(combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Nom ;
} ;
-- CompAdv : Adv -> Comp ; -- (be) here

View File

@@ -1,10 +1,11 @@
import PGF
import System.Environment
import Data.List
import Data.Maybe
main =
do
args <- getArgs -- first one should be pgf file and second one should be the file containing the errors/warnings about missing things
pgf <- PGF.readPGF (args !! 0) -- "tmp/Lang.pgf"
ms <- readFile (args !! 1) {- "tmp/MissingLat.tmp" -} >>= return . map (last . words) . lines
let ts = [PGF.showType [] t | m <- ms, Just t <- [PGF.functionType pgf (PGF.mkCId m)]]
putStrLn $ unlines ["oper " ++ f ++ " : " ++ t ++ " = notYet \"" ++ f ++ "\" ;" | (f,t) <- zip ms ts]
ms <- readFile (args !! 1) {- "tmp/MissingLat.tmp" -} >>= return . nub . sort . map (last . words) . lines
let ts = [maybe ("-- Error: No type found for " ++ m) (\t -> "oper " ++ m ++ " : " ++ PGF.showType [] t ++ " = notYet \"" ++ m ++ "\" ;") $ PGF.functionType pgf (PGF.mkCId m) | m <- ms ]
putStrLn $ unlines ts -- ["oper " ++ f ++ " : " ++ t ++ " = notYet \"" ++ f ++ "\" ;" | (f,t) <- zip ms ts]

View File

@@ -2,6 +2,7 @@
echo "Create tmp dir"
mkdir tmp/
echo "Remove old file"
rm -Rfv tmp/*
echo "resource MissingLat = {} " > MissingLat.gf
echo "Look for missing functions"
# gf -src -i .. -batch TryLat.gf 2>&1 | grep "Warning: no linearization of" | sort -u > tmp/MissingLat.tmp