1
0
forked from GitHub/gf-rgl

(Ara) Fixes in prepositions binding to words

This commit is contained in:
Inari Listenmaa
2018-11-29 15:51:57 +01:00
parent a7c471214b
commit f71e504f9c
6 changed files with 31 additions and 21 deletions

View File

@@ -21,7 +21,7 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in {
-- $SuperlA$ belongs to determiner syntax in $Noun$.
--
ComplA2 a np = {
s = \\sp,g,n,st,c => a.s ! APosit g n st c ++ a.c2.s ++ np.s ! a.c2.c ;
s = \\sp,g,n,st,c => a.s ! APosit g n st c ++ a.c2.s ++ bindIf a.c2.binds ++ np.s ! a.c2.c ;
} ;
--
-- ReflA2 a = {

View File

@@ -11,7 +11,7 @@ concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in {
-- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ s.s
-- } ;
PrepNP prep np = {s = prep.s ++ np.s ! prep.c} ;
PrepNP prep np = {s = prep.s ++ bindIf prep.binds ++ np.s ! prep.c} ;
AdAdv ad av = cc2 av ad ;

View File

@@ -49,10 +49,10 @@ lin
DetNP det = emptyNP ** {s = det.s ! NoHum ! Masc} ; ----
PredetNP pred np = np ** {
s = \\c => case pred.isDecl of {
True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi
False => pred.s!c ++ np.s ! c
PredetNP det np = np ** {
s = \\c => case det.isDecl of {
True => det.s ! c ++ bindIf np.a.isPron ++ np.s ! Gen ; -- akvaru l-awlAdi
False => det.s ! c ++ np.s ! c
} ;
a = np.a ** {isPron=False}
} ;
@@ -174,7 +174,7 @@ lin
Use2N3 n3 = n3 ;
Use3N3 n3 = n3 ** {c2 = n3.c3} ;
ComplN2 n2 np = UseN n2 ** {np = \\c => n2.c2.s ++ np.s ! n2.c2.c} ;
ComplN2 n2 np = UseN n2 ** {np = \\c => n2.c2.s ++ bindIf n2.c2.binds ++ np.s ! n2.c2.c} ;
ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ;

View File

@@ -303,8 +303,8 @@ resource ParadigmsAra = open
-- Prepositions are used in many-argument functions for rection.
Preposition = ResAra.Preposition ;
noPrep = {s=[]; c=nom} ;
casePrep c = {s=[]; c=c} ;
noPrep = {s=[]; c=nom; binds=False} ;
casePrep c = {s=[]; c=c; binds=False} ;
Gender = ResAra.Gender ;
masc = ResAra.Masc ;

View File

@@ -47,7 +47,9 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
s = \\t,p,qf =>
let cl : ResAra.Cl = complClSlash cls ; -- dummy conversion to Cl
o = toOrder qf
in cls.c2.s ++ ip.s ! False ! Masc ! Def ! Nom ++ cl.s ! t ! p ! o
in cls.c2.s ++ bindIf cls.c2.binds
++ ip.s ! False ! Masc ! Def ! Nom
++ cl.s ! t ! p ! o
} ;
--IL guessed

View File

@@ -111,7 +111,8 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
NTable = Number => State => Case => Str;
emptyNTable : NTable = \\n,s,c => [] ;
Preposition : Type = {s : Str ; c : Case} ;
Preposition : Type = {s : Str ; c : Case ; binds : Bool} ;
Noun : Type = {
s,s2 : NTable ;
g : Gender ;
@@ -122,17 +123,22 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
Noun3 : Type = Noun2 ** {c3 : Preposition} ;
mkPreposition = overload {
mkPreposition : Str -> Case -> Preposition = \s,c -> {s=s;c=c} ;
mkPreposition : Str -> Preposition = \s -> {s=s;c=Gen} ;
mkPreposition : Str -> Case -> Preposition = \s,c -> {s=s; c=c; binds=False} ;
mkPreposition : Str -> Preposition = \s -> {s=s; c=Gen; binds=False} ;
} ;
mkPrefix = overload {
mkPrefix : Str -> Preposition = \s -> {s=s; c=Gen; binds=True} ;
mkPrefix : Str -> Case -> Preposition = \s,c -> {s=s; c=c; binds=True}
} ;
noPrep : Preposition = mkPreposition [] Nom ;
liPrep : Preposition = mkPreposition (
liPrep : Preposition = mkPrefix (
pre { #pronSuffAndOther => "لِ" ;
#pronSuff => "لَ" ;
_ => "لِ"
} ++ BIND) Dat ;
biPrep : Preposition = mkPreposition ("بِ"++BIND) ;
}) Dat ;
biPrep : Preposition = mkPrefix "بِ" ;
pronSuff : pattern Str = #("كَ"|"كِ"|"كُمَا"|"كُمْ"|"كُنَّ"|"هُ"|"ها"|"هُمَا"|"هُمْ"|"هُنَّ") ;
pronSuffAndOther : pattern Str = #( "كَم" ) ; -- TODO list words that begin like pron.suff. but aren't
@@ -1537,7 +1543,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
-- very unsure about this /IL
sc : Preposition = case o of {
Subord => {s=[]; c=Acc} ;
Subord => {s=[]; c=Acc; binds=False} ;
_ => case np.a.isPron of {
True => noPrep ; -- to prevent weird stuff with VVs, might be overly specific
_ => vp.sc }
@@ -1643,10 +1649,12 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
a = np.a}
} ;
bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ;
bindIfPron : NP -> {c2:Preposition; isPred:Bool} -> Str = \np,vp ->
let bind = case <vp.isPred,np.a.isPron> of {
<False,True> => BIND ;
_ => [] }
let bind = case vp.isPred of {
False => bindIf (orB np.a.isPron vp.c2.binds) ;
True => [] }
in vp.c2.s ++ bind ++ np.s ! vp.c2.c ;
insertPred : Comp -> VP -> VP = \p,vp -> vp **