summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2009-03-28 20:22:07 +0000
committeraarne <aarne@cs.chalmers.se>2009-03-28 20:22:07 +0000
commita94143ee92565dadb1caaf1042f303878059c200 (patch)
treedb11b1bbfe4c18afd71f8444436dd5535e989b20
parent71bb4eda8a34e39a3ef853e40f8be93494f975f4 (diff)
BronzeageAra compiles again, via minimal Syntax
-rw-r--r--examples/bronzeage/BronzeageAra.gf8
-rw-r--r--examples/bronzeage/SwadeshAra.gf8
-rw-r--r--next-lib/src/api/Constructors.gf2
-rw-r--r--next-lib/src/arabic/AdjectiveAra.gf14
-rw-r--r--next-lib/src/arabic/CatAra.gf2
-rw-r--r--next-lib/src/arabic/NounAra.gf7
-rw-r--r--next-lib/src/arabic/PhraseAra.gf13
-rw-r--r--next-lib/src/arabic/QuestionAra.gf73
-rw-r--r--next-lib/src/arabic/VerbAra.gf3
9 files changed, 99 insertions, 31 deletions
diff --git a/examples/bronzeage/BronzeageAra.gf b/examples/bronzeage/BronzeageAra.gf
new file mode 100644
index 000000000..4fa5c795d
--- /dev/null
+++ b/examples/bronzeage/BronzeageAra.gf
@@ -0,0 +1,8 @@
+--# -path=.:minimal:present
+
+concrete BronzeageAra of Bronzeage = SwadeshAra **
+ BronzeageI
+ with
+ (Syntax = SyntaxAra) ** open ResAra,ParamX in {
+}
+
diff --git a/examples/bronzeage/SwadeshAra.gf b/examples/bronzeage/SwadeshAra.gf
index cfe54d1b2..666e41b35 100644
--- a/examples/bronzeage/SwadeshAra.gf
+++ b/examples/bronzeage/SwadeshAra.gf
@@ -1,5 +1,5 @@
---# -path=.:present:prelude
-
-concrete SwadeshAra of Swadesh = CatAra ** SwadeshI with
- (Lang = LangAra) ;
+--# -path=.:present
+concrete SwadeshAra of Swadesh = SwadeshI with
+ (Lexicon = LexiconAra),
+ (Syntax = SyntaxAra) ;
diff --git a/next-lib/src/api/Constructors.gf b/next-lib/src/api/Constructors.gf
index c9e227ccf..fef8620f2 100644
--- a/next-lib/src/api/Constructors.gf
+++ b/next-lib/src/api/Constructors.gf
@@ -1657,7 +1657,7 @@ incomplete resource Constructors = open Grammar in {
DetPl : Quant -> Num -> Ord -> Det = DetQuantOrd ; --# notminimal
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 ;
that_NP : NP = DetNP (DetQuant that_Quant sgNum) ; --# notminimal
diff --git a/next-lib/src/arabic/AdjectiveAra.gf b/next-lib/src/arabic/AdjectiveAra.gf
index f324d95d3..a2ca6dcee 100644
--- a/next-lib/src/arabic/AdjectiveAra.gf
+++ b/next-lib/src/arabic/AdjectiveAra.gf
@@ -12,9 +12,10 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
}
}
};
--- ComparA a np = {
--- s = \\_ => a.s ! AAdj Compar ++ "مِنْ" ++ np.s ! Gen ;
--- } ;
+---- guessed by AR
+ ComparA a np = {
+ s = \\sp,g,n,st,c => a.s ! AComp st c ++ "مِنْ" ++ np.s ! Gen ;
+ } ;
--
-- $SuperlA$ belongs to determiner syntax in $Noun$.
--
@@ -33,10 +34,9 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
-- isPre = False
-- } ;
--
--- AdAP ada ap = {
--- s = \\a => ada.s ++ ap.s ! a ;
--- isPre = ap.isPre
--- } ;
+ AdAP ada ap = {
+ s = \\sp,g,n,st,c => ada.s ++ ap.s ! sp ! g ! n ! st ! c
+ } ;
--
-- UseA2 a = a ;
--
diff --git a/next-lib/src/arabic/CatAra.gf b/next-lib/src/arabic/CatAra.gf
index dd1790a94..88557540d 100644
--- a/next-lib/src/arabic/CatAra.gf
+++ b/next-lib/src/arabic/CatAra.gf
@@ -25,7 +25,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
QCl = {s : ResAra.Tense => Polarity => QForm => Str} ;
IP = {s : Str ; n : ResAra.Number} ;
-- IAdv = {s : Str} ;
--- IDet = {s : Str ; n : ResAra.Number} ;
+ IDet = {s : Case => Str ; n : ResAra.Number} ; ---- AR add Case
--
---- Relative
--
diff --git a/next-lib/src/arabic/NounAra.gf b/next-lib/src/arabic/NounAra.gf
index d96e71970..350d7b4db 100644
--- a/next-lib/src/arabic/NounAra.gf
+++ b/next-lib/src/arabic/NounAra.gf
@@ -128,7 +128,9 @@ lin
s = numeral.s ! NCard ;
n = numeral.n
};
-
+
+ NumCard n = n ;
+
AdNum adn num = {
s = \\g,d,c => adn.s ++ num.s ! g ! d ! c ;
n = num.n } ;
@@ -164,6 +166,9 @@ lin
isNum,isPron = False
} ;
+ MassNP cn = ---- AR
+ {s = cn.s ! Sg ! Indef ; a = {pgn = Per3 cn.g Sg ; isPron = False}} ;
+
-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef;
-- isNum = False; isPron = False} ;
diff --git a/next-lib/src/arabic/PhraseAra.gf b/next-lib/src/arabic/PhraseAra.gf
index 6910d59f5..2604ac4cb 100644
--- a/next-lib/src/arabic/PhraseAra.gf
+++ b/next-lib/src/arabic/PhraseAra.gf
@@ -6,16 +6,19 @@ concrete PhraseAra of Phrase = CatAra ** open
lin
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ! Masc ++ voc.s} ;--FIXME
--- UttS s = s ;
--- UttQS qs = {s = qs.s ! QDir} ;
+ UttS s = {s = \\g => s.s} ; ---- OK? AR
+
+ 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} ;
-- 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 ;
--- UttNP np = {s = np.s ! Acc} ;
+ UttNP np = {s = \\_ => np.s ! Nom} ;
-- UttVP vp = {s = infVP False vp (agrP3 Sg)} ;
--- UttAdv adv = adv ;
+ UttAdv adv = {s = \\_ => adv.s} ;
--
NoPConj = {s = []} ;
-- PConjConj conj = conj ;
diff --git a/next-lib/src/arabic/QuestionAra.gf b/next-lib/src/arabic/QuestionAra.gf
index 651a72cfd..0a02db4af 100644
--- a/next-lib/src/arabic/QuestionAra.gf
+++ b/next-lib/src/arabic/QuestionAra.gf
@@ -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 ;
@@ -13,11 +13,53 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
};
---
--- QuestVP qp vp =
--- let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp
--- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
---
+-- AR copied from PredVP
+ QuestVP qp vp =
+ { s =\\t,p,_ =>
+ 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 = {
-- s = \\t,a,p =>
-- 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 =>
-- let
-- cls = cl.s ! t ! a ! p ;
@@ -47,9 +92,15 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX in {
-- n = ip.n
-- } ;
--
--- IDetCN idet num ord cn = {
--- s = \\c => idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n ! c ;
--- n = idet.n
--- } ;
+
+---- AR guesses
+ 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
+ } ;
--
}
diff --git a/next-lib/src/arabic/VerbAra.gf b/next-lib/src/arabic/VerbAra.gf
index 95e386d35..06ea487cd 100644
--- a/next-lib/src/arabic/VerbAra.gf
+++ b/next-lib/src/arabic/VerbAra.gf
@@ -6,6 +6,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in {
UseV = predV ;
SlashV2a v = predV v ** {c2 = v.c2};
+ Slash3V3 v np = insertObj np (predV v) ** {c2 = v.c2};
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
CompNP np = {s = \\_,c => np.s ! c};
--- CompAdv a = {s = \\_ => a.s} ;
+ CompAdv a = {s = \\_,_ => a.s} ;
--
--
}