From 890e29f6281bdfaeaf40d6fd5cbc598ac92f4da1 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 28 Jun 2019 14:52:14 +0200 Subject: [PATCH] (Som) Add simple y/n-questions --- src/somali/CatSom.gf | 13 ++++--------- src/somali/LexiconSom.gf | 2 +- src/somali/PhraseSom.gf | 2 +- src/somali/QuestionSom.gf | 4 ++-- src/somali/ResSom.gf | 3 ++- src/somali/SentenceSom.gf | 18 ++++++++++-------- 6 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index ea593b70..da1e65f9 100644 --- a/src/somali/CatSom.gf +++ b/src/somali/CatSom.gf @@ -16,29 +16,24 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in { Cl = ResSom.Clause ; ClSlash = ResSom.ClSlash ; SSlash = ResSom.Sentence ; -- sentence missing NP; e.g. "she has looked at" - Imp = { s : Str } ; -- imperative e.g. "look at this" + Imp = SS ; -- imperative e.g. "look at this" --2 Questions and interrogatives -- Constructed in QuestionSom. - QCl = ResSom.Clause ; + QCl = ResSom.QClause ; IP = ResSom.NounPhrase ; - IComp = { s : Str } ; -- interrogative complement of copula e.g. "where" + IComp = SS ; -- interrogative complement of copula e.g. "where" IDet = ResSom.Determiner ; -- interrogative determiner e.g. "how many" IQuant = ResSom.Quant ; -- interrogative quantifier e.g. "which" - - - --2 Relative clauses and pronouns -- Constructed in RelativeSom. RCl = ResSom.RClause ; - RP = { s : Str } ; - - + RP = SS ; --2 Verb phrases diff --git a/src/somali/LexiconSom.gf b/src/somali/LexiconSom.gf index 1d7e86df..0a1f8b3a 100644 --- a/src/somali/LexiconSom.gf +++ b/src/somali/LexiconSom.gf @@ -52,7 +52,7 @@ lin bread_N = mkN "rooti" ; --masc/fem -- lin brown_A = mkA "" ; -- lin burn_V = mkV "" ; -- lin butter_N = mkN "" ; --- lin buy_V2 = mkV2 "" ; +lin buy_V2 = mkV2 "iibsa" ; ---- -- C diff --git a/src/somali/PhraseSom.gf b/src/somali/PhraseSom.gf index f05afbe7..c0c620b4 100644 --- a/src/somali/PhraseSom.gf +++ b/src/somali/PhraseSom.gf @@ -4,7 +4,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in { PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; UttS s = s ; - -- UttQS qs = qs ; + UttQS qs = qs ; UttImpSg pol imp = let ma = case pol.p of { Pos => [] ; Neg => "ma" } diff --git a/src/somali/QuestionSom.gf b/src/somali/QuestionSom.gf index 5b63dedb..ca28087b 100644 --- a/src/somali/QuestionSom.gf +++ b/src/somali/QuestionSom.gf @@ -1,12 +1,12 @@ concrete QuestionSom of Question = CatSom ** open - ResSom, (VS=VerbSom), (NS=NounSom), (AS=AdverbSom) in { + Prelude, ResSom, (VS=VerbSom), (NS=NounSom), (AS=AdverbSom) in { -- A question can be formed from a clause ('yes-no question') or -- with an interrogative. lin -- : Cl -> QCl ; - -- QuestCl cl = ; + QuestCl cl = {s = cl.s ! True} ; -- : IP -> VP -> QCl ; -- QuestVP ip vp = ; diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index b775cc43..ff01bb46 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -697,7 +697,8 @@ oper } ; -------------------------------------------------------------------------------- -- Sentences etc. - Clause : Type = {s : Tense => Anteriority => Polarity => Str} ; + Clause : Type = {s : Bool {-is question-} => Tense => Anteriority => Polarity => Str} ; + QClause : Type = {s : Tense => Anteriority => Polarity => Str} ; RClause, ClSlash, Sentence : Type = SS ; ---- TODO diff --git a/src/somali/SentenceSom.gf b/src/somali/SentenceSom.gf index c186e873..9308d7ed 100644 --- a/src/somali/SentenceSom.gf +++ b/src/somali/SentenceSom.gf @@ -13,18 +13,19 @@ lin passive => complSlash (insertComp vps np) ; _ => complSlash vps } ; subj = case vps.c2 of {passive => impersNP ; _ => np} ; - in { s = \\t,a,p => + in { s = \\isQ,t,a,p => let predRaw : {fin : Str ; inf : Str} = vf t a p subj.a vp ; pred : {fin : Str ; inf : Str} = case vp.pred of { - NoCopula => {fin,inf = []} ; -- if NoCopula, no overt verb + NoCopula => {fin,inf = []} ; _ => predRaw } ; subjnoun : Str = if_then_Str np.isPron [] (subj.s ! Nom) ; subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ; obj : {p1,p2 : Str} = vp.comp ! subj.a ; stm : Str = - case of { - => "waa" ; + case of { + => "ma" ; + <_,Pos,Copula|NoCopula,Sg3 _|Impers> => "waa" ; -- _ => stmarker ! np.a ! b } -- marker+pronoun contract _ => case of { => "waa" ++ subjpron ; -- to force some string from NP to show in the tree @@ -78,14 +79,15 @@ lin -} -- : Temp -> Pol -> Cl -> S ; - UseCl t p cl = { s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p } ; + UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! False ! t.t ! t.a ! p.p} ; + + -- : Temp -> Pol -> QCl -> QS ; + UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ; + {- -- : Temp -> Pol -> RCl -> RS ; UseRCl t p cl = { s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p } ; - -- : Temp -> Pol -> QCl -> QS ; - UseQCl t p cl = { s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p } ; - -- An adverb can be added to the beginning of a sentence, either with comma ("externally") -- or without: