1
0
forked from GitHub/gf-rgl

(Ara) whitespace + other small cleanup here and there

This commit is contained in:
Inari Listenmaa
2018-12-31 18:01:33 +02:00
parent 10f5e126ab
commit a6948288b7
15 changed files with 55 additions and 64 deletions

View File

@@ -40,7 +40,7 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
UseA2 = PositA ;
UseComparA a = {
s = \\h,g,n,d,c => a.s ! AComp d c
s = \\h,g,n,d,c => a.s ! AComp d c
};
-- : Ord -> AP ; -- warmest

View File

@@ -26,7 +26,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
QCl = ResAra.QCl ; -- {s : Tense => Polarity => QForm => Str} ;
IDet = ResAra.IDet ; -- {s : Gender => State => Case => Str ; n : Number} ;
IP = ResAra.IP ; -- {s : (isPred : Bool) => State => Case => Str ; n : Number} ;
IComp = ResAra.IComp ; --
IComp = ResAra.IComp ; --
IQuant = {s : State => Case => Str} ;
-- Relative

View File

@@ -1,4 +1,4 @@
concrete ConjunctionAra of Conjunction =
concrete ConjunctionAra of Conjunction =
CatAra ** open ResAra, Coordination, Prelude in {
lincat
@@ -28,7 +28,7 @@ lin
empty = []
} ;
ConjNP conj ss = conjunctDistrTable Case conj ss ** {
a = let gn = pgn2gn ss.a.pgn in
a = let gn = pgn2gn ss.a.pgn in
{pgn = Per3 gn.g (conjNumber conj.n gn.n) ; isPron = False} ;
empty = []
} ;
@@ -53,30 +53,25 @@ oper
-- move to predef?
ListTable5 : PType -> PType -> PType -> PType -> PType -> Type = \P,Q,R,T,S ->
{s1,s2 : P => Q => R => T => S => Str} ;
ListTable5 : PType -> PType -> PType -> PType -> PType -> Type = \P,Q,R,T,S ->
{s1,s2 : P => Q => R => T => S => Str} ;
twoTable5 : (P,Q,R,T,S : PType) -> (_,_ : {s : P => Q => R => T => S => Str}) ->
ListTable5 P Q R T S =
twoTable5 : (P,Q,R,T,S : PType) -> (_,_ : {s : P => Q => R => T => S => Str}) ->
ListTable5 P Q R T S =
\_,_,_,_,_,x,y ->
{s1 = x.s ; s2 = y.s} ;
{s1 = x.s ; s2 = y.s} ;
consrTable5 :
(P,Q,R,T,S : PType) -> Str -> {s : P => Q => R => T => S => Str} ->
consrTable5 :
(P,Q,R,T,S : PType) -> Str -> {s : P => Q => R => T => S => Str} ->
ListTable5 P Q R T S -> ListTable5 P Q R T S =
\P,Q,R,T,S,c,x,xs ->
{s1 = \\p,q,r,t,s => xs.s1 ! p ! q ! r ! t ! s ++ c ++ xs.s2 ! p ! q ! r ! t ! s ;
{s1 = \\p,q,r,t,s => xs.s1 ! p ! q ! r ! t ! s ++ c ++ xs.s2 ! p ! q ! r ! t ! s ;
s2 = x.s
} ;
} ;
conjunctTable5 :
(P,Q,R,T,S : PType) -> Conjunction -> ListTable5 P Q R T S -> {s : P => Q => R => T => S => Str} =
\P,Q,R,T,S,or,xs ->
{s = \\p,q,r,t,s => xs.s1 ! p ! q ! r ! t ! s ++ or.s ++ xs.s2 ! p ! q ! r ! t ! s} ;
conjunctDistrTable5 :
(P,Q,R,T,S : PType) -> ConjunctionDistr -> ListTable5 P Q R T S ->
{s : P => Q => R => T => S => Str} =
conjunctDistrTable5 :
(P,Q,R,T,S : PType) -> ConjunctionDistr -> ListTable5 P Q R T S ->
{s : P => Q => R => T => S => Str} =
\P,Q,R,T,S,or,xs ->
{s = \\p,q,r,t,s => or.s1++ xs.s1 ! p ! q ! r ! t ! s ++ or.s2 ++ xs.s2 ! p ! q ! r ! t ! s} ;
}

View File

@@ -47,11 +47,11 @@ lin
intMonthday = symb ;
-- : Card -> CN -> A -> AP
n_units_AP card cn a =
n_units_AP card cn a =
let ap = mkAP a in ap ** {
s = \\s,g,n,d,c =>
ap.s ! s ! g ! n ! d ! c
++ (mkAdv R.biPrep (mkNP amount_N)).s
s = \\s,g,n,d,c =>
ap.s ! s ! g ! n ! d ! c
++ (mkAdv R.biPrep (mkNP amount_N)).s
++ (mkNP card cn).s ! R.Bare ---- ? /IL
} ;

View File

@@ -36,15 +36,15 @@ concrete ExtendAra of Extend =
-- : Temp -> Pol -> VP -> VPS ; -- hasn't slept
MkVPS t p vp = {
s = \\pgn => let vps =
wordOrderNoSubj
wordOrderNoSubj
Nominal -- Nominal (=SVO) generalises best for ConjVPS.
vp.obj.a.isPron
vp.obj.a.isPron
(vStr vp pgn t.t p.p Nominal)
(case <vp.isPred,vp.obj.a.isPron> of {
<False,True> => BIND ++ vp.obj.s ;
_ => vp.obj.s })
(pred vp pgn t.t p.p)
vp.s2
(pred vp pgn t.t p.p)
vp.s2
in vps.before ++ vps.after -- word order is SVO, so this is safe for just this case.
} ;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common:../api:../prelude
concrete LangAra of Lang =
concrete LangAra of Lang =
GrammarAra,
LexiconAra,
ConstructionAra
@@ -9,5 +9,3 @@ concrete LangAra of Lang =
flags startcat = Phr ; unlexer = text ; lexer = text ; coding = utf8 ;
}

View File

@@ -27,7 +27,7 @@ lin
let c' = case c of {Dat => Gen ; x => x} in
case cnB4det det of {
False => determiner c'
++ noun c'
++ noun c'
++ adj c'
++ cn.np ! c' ;
True => noun (cas c) -- deal with possessive suffix + dative hack
@@ -205,10 +205,10 @@ lin
PossNP cn np = cn ** {
s = \\n,d,c => cn.s ! n ! case d of {Poss=>d ; _=>Const} ! c ;
s2 = \\n,d,c => cn.s2 ! n ! case d of {Poss=>d ; _=>Const} ! Gen ;
np = \\c => cn.np ! c
np = \\c => cn.np ! c
++ case is1sg np.a of {
True => "لَدَي" ++ np.empty ;
False =>
False =>
case np.a.isPron of {
True => "لَدَي" ++ BIND ++ np.s ! Gen ;
False => np.s ! Gen }

View File

@@ -27,7 +27,7 @@ lincat
lin n5 = num3_10 "خَمس" "خامِس";
lin n6 = num3_10 "سِتّ" "سادِس";
lin n7 = num3_10 "سَبع" "سابِع";
lin n8 = num3_10 "ثَمانِي" "ثامِن";
lin n8 = num3_10 "ثَمَانِي" "ثامِن";
lin n9 = num3_10 "تِسع" "تاسِع";
lin pot01 = mkNum "واحِد" "أَوَّل" "أُولى" ** { n = One } ;

View File

@@ -42,8 +42,8 @@ oper
l@(""|"ل"|"ال") + ("أ"|"أَ") + #hamza + tail => l + "آ" + tail;
l@(""|"ال") + #hamza + v@("َ"|"ُ") + tail => l + "أ" + v + tail;
l@(""|"ال") + #hamza + v@("ِ") + tail => l + "إ" + v + tail;
head + v1@#vstar
+ #hamza + v2@(#vow|"ْ") + tail =>
head + v1@#vstar
+ #hamza + v2@(#vow|"ْ") + tail =>
case v2 of { "ْ" => head + v1 + bHmz v1 v2 + tail ; -- unsure about this /IL
_ => head + v1 + bHmz v1 v2 + v2 + tail } ;
head + v1@#vstar -- the same but it ends in vowel

View File

@@ -283,10 +283,10 @@ resource ParadigmsAra = open
-- questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
-- mkVS = overload {
-- mkVS : V -> VS ;
-- mkVS : V -> Str -> VS
-- } ;
mkVS : overload {
mkVS : V -> VS ;
mkVS : V -> Str -> VS
} ;
mkV2S : V -> Str -> V2S ;
mkVV = overload {
mkVV : V -> VV = regVV ;

View File

@@ -20,8 +20,6 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
cl = PredVP np vp ;
in { s = \\t,p,qf => cl.s ! t ! p ! toOrder qf } ;
---- AR guessed
QuestIAdv iadv cl = {s = \\t,p,qf => iadv.s ++ cl.s ! t ! p ! toOrder qf} ;
@@ -34,7 +32,7 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
in QuestVP ip vp ;
-- : IP -> IComp ;
CompIP ip = ip ** {
CompIP ip = ip ** {
s = \\gn => ip.s ! True -- True=IP will be a subject of predicative sentence
! gn.g -- IComp agrees in gender with eventual head
! Def ! Nom ; -- IP will be a subject
@@ -44,11 +42,11 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
-- QCl = {s : Tense => Polarity => QForm => Str} ;
QuestSlash ip cls = { ----IL just guessing
s = \\t,p,qf =>
s = \\t,p,qf =>
let cl : ResAra.Cl = complClSlash cls ; -- dummy conversion to Cl
o = toOrder qf
in cls.c2.s ++ bindIf cls.c2.binds
++ ip.s ! False ! Masc ! Def ! Nom
in cls.c2.s ++ bindIf cls.c2.binds
++ ip.s ! False ! Masc ! Def ! Nom
++ cl.s ! t ! p ! o
} ;
@@ -66,14 +64,14 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
AdvIAdv iadv adv = {s = iadv.s ++ adv.s} ;
-- : IDet -> IP
IdetIP idet = idet ** {
IdetIP idet = idet ** {
s = \\isPred => idet.s ;
a = { pgn = agrP3 NoHum Masc idet.n ; isPron = False }
} ;
-- : IDet -> CN -> IP
IdetCN idet cn = {
s = \\isPred,g,s,c
s = \\isPred,g,s,c
=> idet.s ! cn.g ! s ! c ++
cn2str cn idet.n idet.d Gen ;
a = { pgn = agrP3 NoHum cn.g idet.n ; isPron = False }

View File

@@ -1,4 +1,4 @@
concrete RelativeAra of Relative = CatAra **
concrete RelativeAra of Relative = CatAra **
open ResAra in {
flags coding=utf8;
@@ -10,8 +10,8 @@ concrete RelativeAra of Relative = CatAra **
-- : RP -> VP -> RCl ; -- who loves John
RelVP rp vp = {
s = \\t,p,agr,c =>
let
s = \\t,p,agr,c =>
let
npS : Case => Str = \\_ => rp.s ! agr2ragr agr c ;
np : ResAra.NP = agrNP agr ** {s = npS} ;
cl = predVP np vp ;
@@ -19,9 +19,9 @@ concrete RelativeAra of Relative = CatAra **
cl.s ! t ! p ! Nominal
} ;
-- : RP -> ClSlash -> RCl ; -- whom John loves
-- : RP -> ClSlash -> RCl ; -- whom John loves
RelSlash rp cls = cls ** {
s = \\t,p,agr,c =>
s = \\t,p,agr,c =>
let --empty : Agr -> NP = emptyNP ;
obj : ResAra.NP = pgn2pron agr.pgn ; -- head is repeated as a clitic object pronoun
cl : ResAra.Cl = complClSlash obj cls ;
@@ -45,6 +45,6 @@ concrete RelativeAra of Relative = CatAra **
RDl Fem Bare => "اَللَّتَيْن" ;
RDl Fem Nom => "اَللَّتَانِ" ;
RDl Fem _ => "اَللَّتَيْنِ"
}
}
} ;
}

View File

@@ -20,7 +20,7 @@ concrete SentenceAra of Sentence = CatAra ** open
case p of {
Pos => vp.s ! Per2 g n ! VPImp ;
Neg => "لَا" ++ vp.s ! Per2 g n ! VPImpf Jus
} ++ vp.obj.s ++ vp.pred.s ! {g=g;n=n} ! Acc ++ vp.s2
} ++ vp.obj.s ++ vp.pred.s ! {g=g;n=n} ! Acc ++ vp.s2
};
--

View File

@@ -43,7 +43,7 @@ concrete StructuralAra of Structural = CatAra **
how_IAdv = ss "كَيفَ" ;
how8many_IDet = {
s = \\g,s,c => "كَمْ عَدَد" + caseTbl ! c ;
n = Pl ; d = Def
n = Pl ; d = Def
} ; -- IL
how8much_IAdv = ss "كَمْ" ;
if_Subj = mkSubj "إِذَا" Verbal ;

View File

@@ -38,7 +38,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
Slash2V3 v np = insertObj np (slashV2 v) ** {c2 = v.c3 ; agrObj = \\_ => []};
Slash3V3 v np =
let vp = slashV2 v ** {c2 =
let vp = slashV2 v ** {c2 =
v.c2 ** {
s = case np.a.isPron of {
True => case v.c2.binds of {
@@ -48,7 +48,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
}
}
in vp ** {
c2 = v.c3 ;
c2 = v.c3 ;
agrObj = \\_ => bindIfPron np vp -- will be emptied when insertObj is called /IL
} ;
@@ -66,7 +66,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
-- : VS -> S -> VP ; -- say that she runs
ComplVS vs s = predV vs ** { -- IL
obj = emptyObj ** {s = vs.s2 ++ s.s ! vs.o}
obj = emptyObj ** {s = vs.s2 ++ s.s ! vs.o}
} ;
-- : VQ -> QS -> VP ; -- wonder who runs
@@ -83,7 +83,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
UseComp xabar =
case xabar.isNP of {
False => kaan xabar ;
True => predV copula ** {obj = xabar.obj ; isPred=True}
True => predV copula ** {obj = xabar.obj ; isPred=True}
} ;
UseCopula = predV copula ;
@@ -112,8 +112,8 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in {
CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ;
obj = emptyObj ; isNP = False} ;
CompNP np = {s = \\_,_ => [] ;
obj = {s = np.s ! Nom ; a = agrLite np.a} ;
CompNP np = {s = \\_,_ => [] ;
obj = {s = np.s ! Nom ; a = agrLite np.a} ;
isNP = True} ;
--
--