From 9da4ea3f5cf6f0b5bcbc67fae57c3b26f96fca90 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 26 Nov 2018 17:03:09 +0100 Subject: [PATCH] (Ara) Add word order as a parameter to Subj --- src/arabic/AdverbAra.gf | 2 +- src/arabic/CatAra.gf | 2 +- src/arabic/ParadigmsAra.gf | 10 ++++++++++ src/arabic/StructuralAra.gf | 7 +++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/arabic/AdverbAra.gf b/src/arabic/AdverbAra.gf index d10d2ac44..c02aa5939 100644 --- a/src/arabic/AdverbAra.gf +++ b/src/arabic/AdverbAra.gf @@ -16,7 +16,7 @@ concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in { AdAdv ad av = cc2 av ad ; -- : Subj -> S -> Adv ; -- when she sleeps - SubjS subj s = {s = subj.s ++ s.s ! Subord} ; + SubjS subj s = {s = subj.s ++ s.s ! subj.o} ; -- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing diff --git a/src/arabic/CatAra.gf b/src/arabic/CatAra.gf index 1902bfac7..6cb7ccdb3 100644 --- a/src/arabic/CatAra.gf +++ b/src/arabic/CatAra.gf @@ -72,7 +72,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { Conj = {s : Str ; n : ResAra.Number} ; -- DConj = {s1,s2 : Str ; n : ResAra.Number} ; --- Subj = {s : Str} ; + Subj = {s : Str ; o : Order} ; Prep = ResAra.Preposition ; -- Open lexical classes, e.g. Lexicon diff --git a/src/arabic/ParadigmsAra.gf b/src/arabic/ParadigmsAra.gf index fc196e912..f3fdb6efe 100644 --- a/src/arabic/ParadigmsAra.gf +++ b/src/arabic/ParadigmsAra.gf @@ -172,6 +172,11 @@ resource ParadigmsAra = open mkInterj : Str -> Interj ; + mkSubj : overload { + mkSubj : Str -> Subj ; -- Default order Subord (=noun first and in accusative) + mkSubj : Str -> Order -> Subj -- Specify word order + } ; + --2 Prepositions -- -- A preposition as used for rection in the lexicon, as well as to @@ -659,6 +664,11 @@ resource ParadigmsAra = open mkAdA x = lin AdA (ss x) ; mkInterj x = lin Interj (ss x) ; + mkSubj = overload { + mkSubj : Str -> Subj = \s -> lin Subj {s = s ; o = Subord} ; + mkSubj : Str -> Order -> Subj = \s,o -> lin Subj {s = s ; o = o} ; + } ; + dirV2 v = prepV2 v (casePrep acc) ; mkV3 = overload { diff --git a/src/arabic/StructuralAra.gf b/src/arabic/StructuralAra.gf index 7ae7afd31..f4abefa28 100644 --- a/src/arabic/StructuralAra.gf +++ b/src/arabic/StructuralAra.gf @@ -62,8 +62,7 @@ concrete StructuralAra of Structural = CatAra ** -- isAux = True -- } ; no_Utt = {s = \\_ => "لا"} ; - on_Prep = mkPrep "عَلى" ; ---- DEPREC one_Quant = mkQuantNum "واحِد" Sg Indef ; + on_Prep = mkPrep "عَلَى" ; only_Predet = mkPredet "فَقَط" False; -- or_Conj = ss "ْر" ** {n = Sg} ; -- otherwise_PConj = ss "ْتهروِسي" ; @@ -79,7 +78,7 @@ concrete StructuralAra of Structural = CatAra ** something_NP = regNP "شَيْء" Sg ; -- somewhere_Adv = ss "سْموهري" ; that_Quant = mkQuant3 "ذَلِكَ" "تِلكَ" "أُلٱِكَ" Def; - that_Subj = ss "أنَّ" ; + that_Subj = mkSubj "أنَّ" ; ----b that_NP = indeclNP "ذَلِكَ" Sg ; there_Adv = ss "هُناك" ; -- there7to_Adv = ss "تهري" ; @@ -100,7 +99,7 @@ concrete StructuralAra of Structural = CatAra ** whatPl_IP = mkIP "ما" "ماذا" Pl ; whatSg_IP = mkIP "ما" "ماذا" Sg ; when_IAdv = ss "مَتَى" ; --- when_Subj = ss "وهن" ; + when_Subj = mkSubj "عِنْدَمَا" Verbal ; where_IAdv = ss "أَينَ" ; which_IQuant = { s = \\s,c => case of {