1
0
forked from GitHub/gf-rgl

Merge pull request #289 from inariksit/somali

Somali
This commit is contained in:
Inari Listenmaa
2019-09-14 09:02:23 +02:00
committed by GitHub
7 changed files with 162 additions and 93 deletions

View File

@@ -23,10 +23,11 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in {
-- Constructed in QuestionSom. -- Constructed in QuestionSom.
QCl = ResSom.QClause ; QCl = ResSom.QClause ;
IP = ResSom.NounPhrase ** {contractSTM : Bool} ; IComp = ResSom.Complement ; -- 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" IDet = ResSom.Determiner ; -- interrogative determiner e.g. "how many"
IQuant = ResSom.Quant ; -- interrogative quantifier e.g. "which" IQuant = ResSom.Quant ; -- interrogative quantifier e.g. "which"
IP = ResSom.NounPhrase ** {contractSTM : Bool} ; -- like NP but may contract with STM
IAdv = ResSom.IAdv ;
--2 Subord clauses and pronouns --2 Subord clauses and pronouns
@@ -116,8 +117,7 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in {
N3 = ResSom.Noun3 ; N3 = ResSom.Noun3 ;
PN = ResSom.PNoun ; PN = ResSom.PNoun ;
Adv, Adv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb.
IAdv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb.
linref linref
-- Cl = linCl ; -- Cl = linCl ;

View File

@@ -5,6 +5,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
UttS s = {s = s.s ! False} ; UttS s = {s = s.s ! False} ;
UttQS qs = qs ; UttQS qs = qs ;
UttIAdv iadv = iadv ;
UttImpSg pol imp = UttImpSg pol imp =
let ma = case pol.p of { Pos => [] ; Neg => "ma" } let ma = case pol.p of { Pos => [] ; Neg => "ma" }
@@ -15,8 +16,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
UttIP ip = {s = ip.s ! Abs} ; UttIP ip = {s = ip.s ! Abs} ;
UttNP np = {s = np.s ! Abs} ; UttNP np = {s = np.s ! Abs} ;
UttVP vp = {s = infVP vp} ; UttVP vp = {s = infVP vp} ;
UttAdv, UttAdv adv = {s = linAdv adv} ;
UttIAdv = \adv -> {s = linAdv adv} ;
UttCN n = {s = linCN n} ; UttCN n = {s = linCN n} ;
UttCard n = {s = n.s ! Mid} ; UttCard n = {s = n.s ! Mid} ;
UttAP ap = { s = ap.s ! AF Sg Abs } ; UttAP ap = { s = ap.s ! AF Sg Abs } ;

View File

@@ -1,5 +1,5 @@
concrete QuestionSom of Question = CatSom ** open concrete QuestionSom of Question = CatSom ** open
Prelude, ResSom, ParadigmsSom, (VS=VerbSom), (NS=NounSom), (AS=AdverbSom) in { Prelude, ResSom, ParadigmsSom, (VS=VerbSom), (NS=NounSom), (SS=StructuralSom) in {
-- A question can be formed from a clause ('yes-no question') or -- A question can be formed from a clause ('yes-no question') or
-- with an interrogative. -- with an interrogative.
@@ -10,21 +10,24 @@ concrete QuestionSom of Question = CatSom ** open
-- : IP -> VP -> QCl ; -- : IP -> VP -> QCl ;
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
let clRaw : ClSlash = predVP ip vp ; let cls : ClSlash = predVP ip vp ;
cl : ClSlash = clRaw ** { cl : ClSlash = cls ** {
stm = \\clt,p => case <clt,p> of { stm = modSTM "baa" cls.stm
<_,Pos> => "baa" ; } ;
_ => clRaw.stm ! clt ! p }
}
in cl2qcl (notB ip.contractSTM) cl ; in cl2qcl (notB ip.contractSTM) cl ;
-- : IP -> ClSlash -> QCl ; -- whom does John love -- : IP -> ClSlash -> QCl ; -- whom does John love
QuestSlash ip cls = QuestSlash ip cls =
let clsIPFocus = cls ** { let clsIPFocus = cls ** {
subj = cls.subj ** {noun = ip.s ! Nom} ; -- place IP first in the sentence, keep old subject pronoun. subj = cls.subj ** { -- keep old subject pronoun,
obj2 = cls.obj2 ** {s = cls.subj.noun ++ cls.obj2.s} -- move old subject noun before object. noun = ip.s ! Nom -- and place IP first.
} ; } ;
in cl2qcl (notB ip.contractSTM) clsIPFocus ; obj2 = cls.obj2 ** { -- move old subject noun before object.
s = cls.subj.noun ++ cls.obj2.s
} ;
stm = modSTM "baa" cls.stm
} ;
in cl2qclslash (notB ip.contractSTM) clsIPFocus ;
-- : IAdv -> Cl -> QCl ; -- why does John walk -- : IAdv -> Cl -> QCl ; -- why does John walk
@@ -34,15 +37,28 @@ concrete QuestionSom of Question = CatSom ** open
cl : ClSlash = clRaw ** { cl : ClSlash = clRaw ** {
stm = \\clt,p => case <clt,p> of { stm = \\clt,p => case <clt,p> of {
-- IAdv is focused with baa, and subject comes after -- IAdv is focused with baa, and subject comes after
<_,Pos> => "baa" ++ sbj.pron ++ sbj.noun; <_,Pos> => case iadv.contractSTM of {
True => [] ; _ => "baa"}
++ sbj.pron ++ sbj.noun ;
-- TODO how do negative questions work -- TODO how do negative questions work
_ => clRaw.stm ! Question ! p ++ sbj.pron ++ sbj.noun } ; -- Information questions are not commonly used in negative forms. When they occur they have the same forms as negative declaratives with focus (7.4.1). There is however a strong tendency to use positive forms, for example by subordinating the clause under a verb with an inherently negative meaning:
-- Maxaad u tegi weydey?
-- what+FOC+you for go:INF failed
-- 'Why didn't you go?' (lit. 'Why did you fail to go?')
_ => case iadv.contractSTM of {
True => [] ; _ => clRaw.stm ! Question ! p}
++ sbj.pron ++ sbj.noun } ;
subj = sbj ** {noun, pron = []} -- to force subject after baa subj = sbj ** {noun, pron = []} -- to force subject after baa
} ; } ;
in cl2qcl True cl ; -- TODO: add contractSTM field to IAdv as well in cl2qcl True cl ; -- True because we handle STM placement in cl.stm
-- : IComp -> NP -> QCl ; -- where is John? -- : IComp -> NP -> QCl ; -- where is John?
-- QuestIComp icomp np = ; QuestIComp icomp np =
let cls = predVP np (VS.UseComp icomp) ;
-- cl = cls ** { -- TODO: neg. questions
-- stm : ClType=>Polarity=>Str = \\_,_ => "waa"
-- }
in cl2sentence False cls ; -- copula is dropped and STM is waa
-- Interrogative pronouns can be formed with interrogative -- Interrogative pronouns can be formed with interrogative
-- determiners, with or without a noun. -- determiners, with or without a noun.
@@ -64,9 +80,7 @@ concrete QuestionSom of Question = CatSom ** open
-- Interrogative adverbs can be formed prepositionally. -- Interrogative adverbs can be formed prepositionally.
-- : Prep -> IP -> IAdv ; -- with whom -- : Prep -> IP -> IAdv ; -- with whom
PrepIP prep ip = PrepIP prep ip = SS.prepIP prep (ip.s ! Abs) False ;
let ipAbs : Str = ip.s ! Abs
in prepNP (mkPrep prep ipAbs [] []) emptyNP ;
-- They can be modified with other adverbs. -- They can be modified with other adverbs.
@@ -77,10 +91,15 @@ concrete QuestionSom of Question = CatSom ** open
-- pronouns. -- pronouns.
-- : IAdv -> IComp ; -- : IAdv -> IComp ;
--CompIAdv iadv = iadv ; -- where (is it) CompIAdv iadv = { -- where (is it)
comp = \\_ => <[], iadv.s> ;
stm = Waa NoCopula ;
} ;
-- : IP -> IComp ; -- : IP -> IComp ;
--CompIP ip = { s = ip.s ! Abs } ; -- who (is it) CompIP ip = { -- who (is it)
comp = \\_ => <[], ip.s ! Abs> ;
stm = Waa NoCopula ;
} ;
{- {-
-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$. -- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$.

View File

@@ -697,6 +697,11 @@ oper
np : NPLite ; -- NP from PrepNP can be promoted into a core argument. np : NPLite ; -- NP from PrepNP can be promoted into a core argument.
} ; } ;
IAdv : Type = Adverb ** {
contractSTM : Bool ;
s : Str -- alone, in one-word question, e.g. Waayo? 'Why?'
} ;
prepNP : Prep -> NounPhrase -> Adverb = \prep,np -> prep ** { prepNP : Prep -> NounPhrase -> Adverb = \prep,np -> prep ** {
np = case prep.isPoss of { np = case prep.isPoss of {
True => nplite emptyNP ; True => nplite emptyNP ;
@@ -872,15 +877,7 @@ oper
_ => predRaw -- Any other verb _ => predRaw -- Any other verb
} ; } ;
stm = \\cltyp,pol => stm = mkStm vp.stm ;
case <cltyp,pol> of {
<Statement,Pos> => showSTM vp.stm ;
<Statement,Neg> => "ma" ;
<Question,Pos> => "ma" ;
<Question,Neg> => "sow" ;
<Subord,Pos> => [] ;
<Subord,Neg> => "aan"
} ;
comp = vp.comp ! subj.a ; comp = vp.comp ! subj.a ;
vComp = vp.vComp ** { vComp = vp.vComp ** {
subcl = vp.vComp.subcl ! subj.a subcl = vp.vComp.subcl ! subj.a
@@ -939,6 +936,12 @@ oper
isRel : Bool = False ; isRel : Bool = False ;
in mkClause Question isRel hasSubjPron ; in mkClause Question isRel hasSubjPron ;
-- Question clauses: subject pronoun is included
cl2qclslash : Bool -> ClSlash -> Clause =
let hasSubjPron : Bool = True ;
isRel : Bool = False ;
in mkClause Question isRel hasSubjPron ;
-- Sentence: include subject pronoun and STM. -- Sentence: include subject pronoun and STM.
-- When subordinate, include "in". -- When subordinate, include "in".
cl2sentence : Bool -> ClSlash -> Clause = \isSubord,cls -> { cl2sentence : Bool -> ClSlash -> Clause = \isSubord,cls -> {
@@ -1051,28 +1054,25 @@ oper
infVP : VerbPhrase -> Str = linVP VInf Statement ; infVP : VerbPhrase -> Str = linVP VInf Statement ;
waaContr : Agreement => Polarity => Str = \\a,b => STMarker : Type = ClType => Polarity => Str ;
let stm = if_then_Pol b "w" "m"
in stm + subjpron ! a ;
waaNoContr : Agreement => Polarity => {p1,p2 : Str} = \\a,p => mkStm : STM -> STMarker = \stm ->
case p of { \\cltyp,pol =>
Pos => {p1 = "waa" ; p2 = subjpron ! a} ; case <cltyp,pol> of {
Neg => {p1 = "ma" ; p2 = []} } ; <Statement,Pos> => showSTM stm ;
<Statement,Neg> => "ma" ;
waxaNoContr : Agreement => Polarity => {p1,p2 : Str} = \\a,p => <Question,Pos> => "ma" ;
case p of { <Question,Neg> => "sow" ;
Pos => {p1 = "waxa" ; p2 = subjpron ! a} ; <Subord,Pos> => [] ;
Neg => {p1 = "ma" ; p2 = []} } ; -- TODO: find out how to properly negate waxa clauses! <Subord,Neg> => "aan"
} ;
subjpron : Agreement => Str = table {
Sg1|Pl1 Excl => "aan" ;
Pl1 Incl => "aynu" ;
Sg2|Pl2 => "aad" ;
Sg3 Masc => "uu" ;
Impers => [] ;
_ => "ay" } ;
modSTM : Str -> STMarker -> STMarker = \str,stm ->
\\cltyp,pol =>
case <cltyp,pol> of {
<_,Pos> => str ;
_ => stm ! cltyp ! pol
} ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- linrefs -- linrefs

View File

@@ -16,14 +16,14 @@ lin as_CAdv = { s = "" ; p = [] } ;
lin less_CAdv = { s = "" ; p = [] } ; lin less_CAdv = { s = "" ; p = [] } ;
lin more_CAdv = { s = "" ; p = [] } ; lin more_CAdv = { s = "" ; p = [] } ;
-} -}
lin how_IAdv = prepNP (mkPrep (mkPrep u) "sidee" [] []) emptyNP ; lin how_IAdv = mkIAdv u "sidee" False ;
{-
lin how8much_IAdv = ss "" ;
lin when_IAdv = ss "" ;
lin where_IAdv = ss "" ;
lin why_IAdv = ss "" ;
lin always_AdV = ss "" ; -- lin how8much_IAdv = ss "" ;
-- lin when_IAdv = ss "" ;
lin where_IAdv = mkIAdv noPrep "xaggee" False ;
lin why_IAdv = let mx = mkIAdv u "maxaa" True in mx ** {s = "waayo"} ;
{-lin always_AdV = ss "" ;
lin everywhere_Adv = ss "" ; lin everywhere_Adv = ss "" ;
lin here7from_Adv = ss "" ; lin here7from_Adv = ss "" ;
@@ -148,19 +148,11 @@ lin with_Prep = mkPrep la ;
we_Pron = pronTable ! Pl1 Incl ; we_Pron = pronTable ! Pl1 Incl ;
youPl_Pron = pronTable ! Pl2 ; youPl_Pron = pronTable ! Pl2 ;
they_Pron = pronTable ! Pl3 ; they_Pron = pronTable ! Pl3 ;
{-
lin whatPl_IP = ;
lin whatSg_IP = ;
lin whoPl_IP = ;
-} --lin whatPl_IP = ;
lin whatSg_IP = mkIP "maxay" "maxaa" True ;
lin whoSg_IP = emptyNP ** { --lin whoPl_IP = ;
s = table { lin whoSg_IP = mkIP "ayo" "yaa" True ;
Nom => "yaa" ; -- together with STM
Abs => "ayo" } ; -- alone, no STM (used in UttIP)
contractSTM = True ;
} ;
------- -------
-- Subj -- Subj
@@ -195,4 +187,20 @@ lin want_VV = mkVV (mkV "rabid" "rab" "rab") subjunctive ;
{- {-
lin please_Voc = ss "" ; lin please_Voc = ss "" ;
-} -}
oper
mkIAdv : Preposition -> Str -> Bool -> ResSom.IAdv = \pr ->
let pr' : Prep = ParadigmsSom.mkPrep pr ;
in prepIP pr' ;
mkIP : (maxay, maxaa : Str) -> Bool -> IP = \maxay,maxaa,b -> emptyNP ** {
s = table {
Nom => maxaa ; -- together with STM
Abs => maxay } ; -- alone, no STM (used in UttIP and IComp)
contractSTM = b ;
} ;
prepIP : Prep -> Str -> Bool -> ResSom.IAdv = \pr,str,b ->
let adv : Adverb = prepNP (mkPrep pr str [] []) emptyNP ;
in adv ** {contractSTM = b ; s = linAdv adv} ;
} }

View File

@@ -79,21 +79,3 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UseP
--LangEng: he , that sees the men , is this --LangEng: he , that sees the men , is this
LangSom: isagu oo niman BIND ka arkaa waa kan LangSom: isagu oo niman BIND ka arkaa waa kan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UsePron he_Pron) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN man_N)))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumSg))))))) NoVoc Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UsePron he_Pron) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN man_N)))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumSg))))))) NoVoc
-- Question clauses
-- to whom did mother give the meat
LangSom: yaa siisey hooyo hilib BIND ka
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestSlash whoSg_IP (SlashVP (MassNP (UseN2 mother_N2)) (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))))) NoVoc
-- LangEng: who wants to go
LangSom: yaa rabaa in uu tago
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP whoSg_IP (ComplVV want_VV (UseV go_V))))) NoVoc
-- LangEng: which cat teaches him
LangSom: bisad BIND dee baa ku bartaa
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN cat_N)) (ComplSlash (SlashV2a teach_V2) (UsePron he_Pron))))) NoVoc
-- LangEng: how does your mother paint the house black
LangSom: sidee baa ay hooya BIND daa madow u rinjiyeysaa guri BIND ga
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how_IAdv (PredVP (DetCN (DetQuant (PossPron youSg_Pron) NumSg) (UseN2 mother_N2)) (ComplSlash (SlashV2A paint_V2A (PositA black_A)) (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))) NoVoc

View File

@@ -0,0 +1,60 @@
-- Question clauses
-- LangEng: who wants to go
-- subject pronoun not included, because who is a subject. STM merged to pron.
LangSom: yaa rabaa in uu tago
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP whoSg_IP (ComplVV want_VV (UseV go_V))))) NoVoc
-- to whom did mother give the meat
-- subject pronoun 'ay' included, because whom is an object. STM merged.
LangSom: yaa ay siisey hooyo hilib BIND ka
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestSlash whoSg_IP (SlashVP (MassNP (UseN2 mother_N2)) (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))))) NoVoc
-- LangEng: which cat teaches him
-- subject pronoun not included, STM not merged.
LangSom: bisad BIND dee baa ku bartaa
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN cat_N)) (ComplSlash (SlashV2a teach_V2) (UsePron he_Pron))))) NoVoc
-- LangEng: which woman did you see
-- subject pronoun included, STM not merged.
LangSom: naag BIND tee baa aad aragtay
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestSlash (IdetCN (IdetQuant which_IQuant NumSg) (UseN woman_N)) (SlashVP (UsePron youSg_Pron) (SlashV2a see_V2))))) NoVoc
-- LangEng: where did you go
-- subject pronoun included, because IAdv xaggee 'where' is fronted and aad 'you' is subject. STM not merged.
LangSom: xaggee baa aad tagtay
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv where_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))))) NoVoc
-- LangEng: why did you go
-- subject pronoun included, STM merged.
LangSom: maxaa aad u tagtay
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv why_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))))) NoVoc
-- Negative question -- TODO not implemented yet properly. Saeed p. 203
-- LangEng: why didn't you go
LangSom: maxaa aad u tagi weydey
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PNeg (QuestIAdv why_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))))) NoVoc
-- IComp
-- LangEng: who is the man
-- Saeed p. 212 Ninkii ay raaceen waa ayo? man-the they accompanied DM who
-- 'The man they travelled with is who?'
LangSom: nin BIND ku waa ayo
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestIComp (CompIP whoSg_IP) (DetCN (DetQuant DefArt NumSg) (UseN man_N))))) NoVoc
--- Longer example, unsure about word order -- TODO check
-- LangEng: how does your mother paint the house black
LangSom: sidee baa ay hooya BIND daa madow u rinjiyeysaa guri BIND ga
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how_IAdv (PredVP (DetCN (DetQuant (PossPron youSg_Pron) NumSg) (UseN2 mother_N2)) (ComplSlash (SlashV2A paint_V2A (PositA black_A)) (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))) NoVoc
-- Some examples from Nilsson, adjusted to the GF lexicon
-- Maxaa ay u samaysay sidaas? Varför gjorde hon så?
--LangEng: why did she eat the meat
LangSom: maxaa ay u cuntay hilib BIND ka
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv why_IAdv (PredVP (UsePron she_Pron) (ComplSlash (SlashV2a eat_V2) (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))))) NoVoc
-- Maxaa ay ahaa dharka cusub ee Faadumo loo iibiyay? Vad/Vilka var de nya kläder som man köpt åt Fadumo? TODO why is there subject pronoun here?
--LangEng: what was the meat that was eaten
LangSom: TODO
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestVP whatSg_IP (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN meat_N) (UseRCl (TTAnt TPast ASimul) PPos (RelVP IdRP (PassV2 eat_V2)))))))))) NoVoc