forked from GitHub/gf-core
BronzeageAra compiles again, via minimal Syntax
This commit is contained in:
8
examples/bronzeage/BronzeageAra.gf
Normal file
8
examples/bronzeage/BronzeageAra.gf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
--# -path=.:minimal:present
|
||||||
|
|
||||||
|
concrete BronzeageAra of Bronzeage = SwadeshAra **
|
||||||
|
BronzeageI
|
||||||
|
with
|
||||||
|
(Syntax = SyntaxAra) ** open ResAra,ParamX in {
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
--# -path=.:present:prelude
|
--# -path=.:present
|
||||||
|
|
||||||
concrete SwadeshAra of Swadesh = CatAra ** SwadeshI with
|
|
||||||
(Lang = LangAra) ;
|
|
||||||
|
|
||||||
|
concrete SwadeshAra of Swadesh = SwadeshI with
|
||||||
|
(Lexicon = LexiconAra),
|
||||||
|
(Syntax = SyntaxAra) ;
|
||||||
|
|||||||
@@ -1657,7 +1657,7 @@ incomplete resource Constructors = open Grammar in {
|
|||||||
DetPl : Quant -> Num -> Ord -> Det = DetQuantOrd ; --# notminimal
|
DetPl : Quant -> Num -> Ord -> Det = DetQuantOrd ; --# notminimal
|
||||||
|
|
||||||
ComplV2 : V2 -> NP -> VP = \v,np -> ComplSlash (SlashV2a v) np ;
|
ComplV2 : V2 -> NP -> VP = \v,np -> ComplSlash (SlashV2a v) np ;
|
||||||
ComplV2A : V2A -> NP -> AP -> VP = \v,np,ap -> ComplSlash (SlashV2A v ap) np ;
|
ComplV2A : V2A -> NP -> AP -> VP = \v,np,ap -> ComplSlash (SlashV2A v ap) np ; --# notminimal
|
||||||
ComplV3 : V3 -> NP -> NP -> VP = \v,o,d -> ComplSlash (Slash3V3 v o) d ;
|
ComplV3 : V3 -> NP -> NP -> VP = \v,o,d -> ComplSlash (Slash3V3 v o) d ;
|
||||||
|
|
||||||
that_NP : NP = DetNP (DetQuant that_Quant sgNum) ; --# notminimal
|
that_NP : NP = DetNP (DetQuant that_Quant sgNum) ; --# notminimal
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
-- ComparA a np = {
|
---- guessed by AR
|
||||||
-- s = \\_ => a.s ! AAdj Compar ++ "مِنْ" ++ np.s ! Gen ;
|
ComparA a np = {
|
||||||
-- } ;
|
s = \\sp,g,n,st,c => a.s ! AComp st c ++ "مِنْ" ++ np.s ! Gen ;
|
||||||
|
} ;
|
||||||
--
|
--
|
||||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
--
|
--
|
||||||
@@ -33,10 +34,9 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
|
|||||||
-- isPre = False
|
-- isPre = False
|
||||||
-- } ;
|
-- } ;
|
||||||
--
|
--
|
||||||
-- AdAP ada ap = {
|
AdAP ada ap = {
|
||||||
-- s = \\a => ada.s ++ ap.s ! a ;
|
s = \\sp,g,n,st,c => ada.s ++ ap.s ! sp ! g ! n ! st ! c
|
||||||
-- isPre = ap.isPre
|
} ;
|
||||||
-- } ;
|
|
||||||
--
|
--
|
||||||
-- UseA2 a = a ;
|
-- UseA2 a = a ;
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
|||||||
QCl = {s : ResAra.Tense => Polarity => QForm => Str} ;
|
QCl = {s : ResAra.Tense => Polarity => QForm => Str} ;
|
||||||
IP = {s : Str ; n : ResAra.Number} ;
|
IP = {s : Str ; n : ResAra.Number} ;
|
||||||
-- IAdv = {s : Str} ;
|
-- IAdv = {s : Str} ;
|
||||||
-- IDet = {s : Str ; n : ResAra.Number} ;
|
IDet = {s : Case => Str ; n : ResAra.Number} ; ---- AR add Case
|
||||||
--
|
--
|
||||||
---- Relative
|
---- Relative
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -129,6 +129,8 @@ lin
|
|||||||
n = numeral.n
|
n = numeral.n
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NumCard n = n ;
|
||||||
|
|
||||||
AdNum adn num = {
|
AdNum adn num = {
|
||||||
s = \\g,d,c => adn.s ++ num.s ! g ! d ! c ;
|
s = \\g,d,c => adn.s ++ num.s ! g ! d ! c ;
|
||||||
n = num.n } ;
|
n = num.n } ;
|
||||||
@@ -164,6 +166,9 @@ lin
|
|||||||
isNum,isPron = False
|
isNum,isPron = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
MassNP cn = ---- AR
|
||||||
|
{s = cn.s ! Sg ! Indef ; a = {pgn = Per3 cn.g Sg ; isPron = False}} ;
|
||||||
|
|
||||||
-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
|
-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
|
||||||
-- isNum = False; isPron = False} ;
|
-- isNum = False; isPron = False} ;
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,19 @@ concrete PhraseAra of Phrase = CatAra ** open
|
|||||||
lin
|
lin
|
||||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ! Masc ++ voc.s} ;--FIXME
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ! Masc ++ voc.s} ;--FIXME
|
||||||
|
|
||||||
-- UttS s = s ;
|
UttS s = {s = \\g => s.s} ; ---- OK? AR
|
||||||
-- UttQS qs = {s = qs.s ! QDir} ;
|
|
||||||
|
UttIAdv s = {s = \\g => s.s} ; ---- OK? AR
|
||||||
|
|
||||||
|
UttQS qs = {s = \\g => qs.s ! QDir} ;
|
||||||
UttImpSg pol imp = {s = \\g => imp.s ! pol.p ! g ! ResAra.Sg} ;
|
UttImpSg pol imp = {s = \\g => imp.s ! pol.p ! g ! ResAra.Sg} ;
|
||||||
-- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
-- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
||||||
--
|
--
|
||||||
-- UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
UttIP ip = {s = \\_ => ip.s} ; ---- AR
|
||||||
-- UttIAdv iadv = iadv ;
|
-- UttIAdv iadv = iadv ;
|
||||||
-- UttNP np = {s = np.s ! Acc} ;
|
UttNP np = {s = \\_ => np.s ! Nom} ;
|
||||||
-- UttVP vp = {s = infVP False vp (agrP3 Sg)} ;
|
-- UttVP vp = {s = infVP False vp (agrP3 Sg)} ;
|
||||||
-- UttAdv adv = adv ;
|
UttAdv adv = {s = \\_ => adv.s} ;
|
||||||
--
|
--
|
||||||
NoPConj = {s = []} ;
|
NoPConj = {s = []} ;
|
||||||
-- PConjConj conj = conj ;
|
-- PConjConj conj = conj ;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
|
concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
@@ -13,11 +13,53 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
--
|
-- AR copied from PredVP
|
||||||
-- QuestVP qp vp =
|
QuestVP qp vp =
|
||||||
-- let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp
|
{ s =\\t,p,_ =>
|
||||||
-- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
|
let {
|
||||||
--
|
---- o = Verbal ; ---- AR
|
||||||
|
np = {s = table Case {_ => qp.s} ; a ={pgn = Per3 Masc qp.n ; isPron = False}} ;
|
||||||
|
pgn = np.a.pgn ;
|
||||||
|
gn = pgn2gn pgn;
|
||||||
|
kataba = vp.s ! pgn ! VPPerf ;
|
||||||
|
yaktubu = vp.s ! pgn ! VPImpf Ind ;
|
||||||
|
yaktuba = vp.s ! pgn ! VPImpf Cnj ;
|
||||||
|
yaktub = vp.s ! pgn ! VPImpf Jus ;
|
||||||
|
vStr : ResAra.Tense -> Polarity -> Str =
|
||||||
|
\tn,pl -> case<vp.isPred,tn,pl> of {
|
||||||
|
<False, ResAra.Pres, Pos> => yaktubu ;
|
||||||
|
<False, ResAra.Pres, Neg> => "لَا" ++ yaktubu ;
|
||||||
|
<True, ResAra.Pres, Pos> => "" ; --no verb "to be" in present
|
||||||
|
<True, ResAra.Pres, Neg> => "لَيسَ" ;--same here, just add negation particle
|
||||||
|
<_, ResAra.Past, Pos> => kataba ;
|
||||||
|
<_, ResAra.Past, Neg> => "لَمْ" ++ yaktub ;
|
||||||
|
<_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ;
|
||||||
|
<_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba
|
||||||
|
};
|
||||||
|
pred : ResAra.Tense -> Polarity -> Str =
|
||||||
|
\tn,pl -> case <vp.isPred,tn,pl> of {
|
||||||
|
<True, ResAra.Pres, Pos> => vp.pred.s ! gn ! Nom; --xabar marfooc
|
||||||
|
_ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob
|
||||||
|
} ;
|
||||||
|
|
||||||
|
} in
|
||||||
|
--- case o of {
|
||||||
|
---- _ =>
|
||||||
|
case <False, np.a.isPron> of {
|
||||||
|
---- AR workaround 18/12/2008 case <vp.obj.a.isPron, np.a.isPron> of {
|
||||||
|
-- ya2kuluhu
|
||||||
|
<False,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p);
|
||||||
|
-- ya2kuluhu al-waladu, yakuluhu al-2awlaadu
|
||||||
|
<False,False> => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p);
|
||||||
|
<True,False> => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p);
|
||||||
|
<True,True> => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
|
||||||
|
};
|
||||||
|
---- Nominal =>
|
||||||
|
---- np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p)
|
||||||
|
}
|
||||||
|
; ---- };
|
||||||
|
|
||||||
|
|
||||||
-- QuestSlash ip slash = {
|
-- QuestSlash ip slash = {
|
||||||
-- s = \\t,a,p =>
|
-- s = \\t,a,p =>
|
||||||
-- let
|
-- let
|
||||||
@@ -29,7 +71,10 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
|
|||||||
-- }
|
-- }
|
||||||
-- } ;
|
-- } ;
|
||||||
--
|
--
|
||||||
-- QuestIAdv iadv cl = {
|
|
||||||
|
---- AR guessed
|
||||||
|
QuestIAdv iadv cl = {s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! Verbal} ;
|
||||||
|
|
||||||
-- s = \\t,a,p =>
|
-- s = \\t,a,p =>
|
||||||
-- let
|
-- let
|
||||||
-- cls = cl.s ! t ! a ! p ;
|
-- cls = cl.s ! t ! a ! p ;
|
||||||
@@ -47,9 +92,15 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
|
|||||||
-- n = ip.n
|
-- n = ip.n
|
||||||
-- } ;
|
-- } ;
|
||||||
--
|
--
|
||||||
-- IDetCN idet num ord cn = {
|
|
||||||
-- s = \\c => idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n ! c ;
|
---- AR guesses
|
||||||
-- n = idet.n
|
IdetCN idet cn = {
|
||||||
-- } ;
|
s = idet.s ! Nom ++ cn.s ! idet.n ! Indef ! Nom ;
|
||||||
|
n = idet.n
|
||||||
|
} ;
|
||||||
|
IdetQuant idet num = {
|
||||||
|
s = \\c => idet.s ++ num.s ! Masc ! Indef ! c;
|
||||||
|
n = ResAra.Sg ---- size of Num
|
||||||
|
} ;
|
||||||
--
|
--
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
|
|||||||
UseV = predV ;
|
UseV = predV ;
|
||||||
|
|
||||||
SlashV2a v = predV v ** {c2 = v.c2};
|
SlashV2a v = predV v ** {c2 = v.c2};
|
||||||
|
Slash3V3 v np = insertObj np (predV v) ** {c2 = v.c2};
|
||||||
|
|
||||||
ComplSlash vp np = insertObj np vp ;
|
ComplSlash vp np = insertObj np vp ;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
|
|||||||
--
|
--
|
||||||
CompAP ap = {s = \\agr,c => ap.s ! Hum ! agr.g ! agr.n ! Indef ! c} ; --FIXME
|
CompAP ap = {s = \\agr,c => ap.s ! Hum ! agr.g ! agr.n ! Indef ! c} ; --FIXME
|
||||||
CompNP np = {s = \\_,c => np.s ! c};
|
CompNP np = {s = \\_,c => np.s ! c};
|
||||||
-- CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_,_ => a.s} ;
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user