1
0
forked from GitHub/gf-rgl

Merge pull request #292 from inariksit/somali

Somali
This commit is contained in:
Inari Listenmaa
2019-09-25 18:45:45 +02:00
committed by GitHub
11 changed files with 178 additions and 73 deletions

View File

@@ -16,7 +16,7 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in {
Cl = ResSom.ClSlash ;
ClSlash = ResSom.ClSlash ;
SSlash = ResSom.Sentence ; -- sentence missing NP; e.g. "she has looked at"
Imp = SS ; -- imperative e.g. "look at this"
Imp = {s : Number => Polarity => Str} ; -- imperative e.g. "look at this"
--2 Questions and interrogatives

View File

@@ -253,7 +253,7 @@ lin name_N = mkN "magac" ;
-- lin oil_N = mkN "" ;
-- lin old_A = mkA "" ;
-- lin open_V2 = mkV2 "" ;
lin paint_V2A = mkV2 "rinjiyee" ;
lin paint_V2A = mkV2A "rinjiyee" ;
-- lin paper_N = mkN "" ;
-- lin paris_PN = mkPN "Paris" ;
-- lin peace_N = mkN "" ;

View File

@@ -32,7 +32,6 @@ oper
u : Preposition ;
noPrep : Preposition ;
-- TODO: add subjunctive too!
VVForm : Type ; -- Argument to give to mkVV
infinitive : VVForm ; -- Takes its complement in infinitive
subjunctive : VVForm ; -- Takes its complement as a clause in subjunctive
@@ -46,7 +45,6 @@ oper
mkN : (shimbir : Str) -> (fem : Gender) -> N ; -- Unpredictable gender
-- mkN : (nin, niman : Str) -> N ; -- Monosyllable word with unpredictable plural
mkN : (maalin,maalmo : Str) -> Gender -> N ; -- Consonant cluster in stem
--mkN : N -> Gender -> N ; -- Otherwise predictable but not gender (TODO does this even happen?)
} ;
mkN2 : overload {
@@ -97,18 +95,22 @@ oper
mkVV : V -> VVForm -> VV ; -- VV out of an existing V
} ;
-- TODO: actual constructors
-- mkVA : Str -> VA = \s -> lin VA (mkVerb s) ;
--
-- mkV2A : Str -> V2A = \s -> lin V2A (mkVerb s) ;
-- mkVQ : Str -> VQ = \s -> lin VQ (mkVerb s) ;
-- mkVS : Str -> VS = \s -> lin VS (mkVerb s) ;
--
-- mkV2V : Str -> V2V = \s -> lin V2V (mkVerb s) ;
-- mkV2S : Str -> V2S = \s -> lin V2S (mkVerb s) ;
-- mkV2Q : Str -> V2Q = \s -> lin V2Q (mkVerb s) ;
-- mkV3 : Str -> V3 = \s -> lin V3 (mkVerb s) ;
mkVA : Str -> VA
= \s -> lin VA (regV s) ;
mkVQ : Str -> VQ
= \s -> lin VQ (regV s) ;
mkVS : Str -> VS
= \s -> lin VS (regV s) ;
mkV2A : Str -> V2A
= \s -> lin V2A (regV s ** {c2 = noPrep}) ;
mkV2V : Str -> V2V
= \s -> lin V2V (regV s ** {c2 = noPrep}) ;
mkV2S : Str -> V2S
= \s -> lin V2S (regV s ** {c2 = noPrep}) ;
mkV2Q : Str -> V2Q
= \s -> lin V2Q (regV s ** {c2 = noPrep}) ;
-----

View File

@@ -223,7 +223,7 @@ param
Preposition = U | Ku | Ka | La | NoPrep ;
PrepCombination = Ugu | Uga | Ula | Kaga | Kula | Kala
| Passive | Lagu | Laga | Loo | Lala -- TODO all combinations with impersonal la
| Passive | Loo | Lagu | Laga | Lala -- TODO all combinations with impersonal la: Loogu, Looga, Loola, Lagaga, Lagula, Lagala
| Single Preposition ;
oper
@@ -336,6 +336,6 @@ oper
param
ClType = Statement | Question | Subord ;
ClType = Statement | PolarQuestion | WhQuestion | Subord ;
}

View File

@@ -8,9 +8,11 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
UttIAdv iadv = iadv ;
UttImpSg pol imp =
let ma = case pol.p of { Pos => [] ; Neg => "ma" }
in { s = ma ++ imp.s } ;
UttImpPl = UttImpSg ;
let ha = case pol.p of {Pos => [] ; Neg => "ha"}
in {s = ha ++ imp.s ! Sg ! pol.p} ;
UttImpPl pol imp =
let ha = case pol.p of {Pos => [] ; Neg => "ha"}
in {s = ha ++ imp.s ! Pl ! pol.p} ;
UttImpPol = UttImpSg ;
UttIP ip = {s = ip.s ! Abs} ;

View File

@@ -6,30 +6,31 @@ concrete QuestionSom of Question = CatSom ** open
lin
-- : Cl -> QCl ;
QuestCl = cl2qcl True;
QuestCl = cl2qcl PolarQuestion True;
-- : IP -> VP -> QCl ;
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
let cls : ClSlash = predVP ip vp ;
baan : Str = case ip.contractSTM of {True => "aan" ; _ => "baa aan"} ;
cl : ClSlash = cls ** {
stm = modSTM "baa" cls.stm
stm = modSTM "baa" baan cls.stm
} ;
in cl2qcl (notB ip.contractSTM) cl ;
in cl2qcl PolarQuestion (notB ip.contractSTM) cl ;
-- : IP -> ClSlash -> QCl ; -- whom does John love
QuestSlash ip cls =
let clsIPFocus = cls ** {
let baan : Str = case ip.contractSTM of {True => "aan" ; _ => "baa aan"} ;
clsIPFocus = cls ** {
subj = cls.subj ** { -- keep old subject pronoun,
noun = ip.s ! Nom -- and place IP first.
} ;
obj2 = cls.obj2 ** { -- move old subject noun before object.
s = cls.subj.noun ++ cls.obj2.s
} ;
stm = modSTM "baa" cls.stm
stm = modSTM "baa" baan cls.stm
} ;
in cl2qclslash (notB ip.contractSTM) clsIPFocus ;
-- : IAdv -> Cl -> QCl ; -- why does John walk
QuestIAdv iadv cls =
let clRaw : ClSlash = insertIAdv iadv cls ;
@@ -40,17 +41,12 @@ concrete QuestionSom of Question = CatSom ** open
<_,Pos> => case iadv.contractSTM of {
True => [] ; _ => "baa"}
++ sbj.pron ++ sbj.noun ;
-- TODO how do negative questions work
-- 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}
True => [] ; _ => clRaw.stm ! WhQuestion ! p}
++ sbj.pron ++ sbj.noun } ;
subj = sbj ** {noun, pron = []} -- to force subject after baa
} ;
in cl2qcl True cl ; -- True because we handle STM placement in cl.stm
in cl2qcl WhQuestion True cl ; -- True because we handle STM placement in cl.stm
-- : IComp -> NP -> QCl ; -- where is John?
QuestIComp icomp np =

View File

@@ -404,12 +404,6 @@ oper
Passive => "laydin" ; Loo => "laydiin" ; Lala => "laydinla" ;
Lagu => "laydinku" ; Laga => "laydinka" ;
Single p => (prepTable ! p).s ! Pl2_Prep } ;
-- Impers_Prep => -- TODO: put these later into other tables
-- table { Ugu => "loogu" ; Uga => "looga" ;
-- Ula => "loola" ; Kaga => "lagaga" ;
-- Kula => "lagula" ; Kala => "lagala" ;
-- Passive => "la" ;
-- Lagu => "lagu" ; Laga => "laga" ; } ;
Reflexive_Prep => -- TODO check every form
table { Ugu => "isugu" ; Uga => "isuga" ; Ula => "isula" ;
Kaga => "iskaga" ; Kula => "iskula" ; Kala => "iskala" ;
@@ -682,6 +676,23 @@ oper
x => hold_V.s ! x }
} ;
fail_V : Verb =
let waa_V : Verb = cSug "waay" in waa_V ** {
s = table {
VPres _ Sg2_Sg3Fem _
=> "waayday" ;
VPast _ Sg1_Sg3Masc
=> "waayey" ;
VPast _ Sg2_Sg3Fem
=> "weydey" ;
VPast _ Pl1_ => "weyney" ;
VPast _ Pl2_ => "weydeen" ;
VPast _ Pl3_ => "waayeen" ;
VInf => "waayi" ;
x => waa_V.s ! x -- TODO actual forms
}
} ;
------------------
-- Adv
@@ -877,7 +888,7 @@ oper
_ => predRaw -- Any other verb
} ;
stm = mkStm vp.stm ;
stm = mkStm subj.a vp.stm ;
comp = vp.comp ! subj.a ;
vComp = vp.vComp ** {
subcl = vp.vComp.subcl ! subj.a
@@ -931,16 +942,16 @@ oper
in mkClause Subord isRel hasSubjPron hasSTM ;
-- Question clauses: subject pronoun not included, STM is
cl2qcl : Bool -> ClSlash -> Clause =
cl2qcl : ClType -> Bool -> ClSlash -> Clause = \cltyp ->
let hasSubjPron : Bool = False ;
isRel : Bool = False ;
in mkClause Question isRel hasSubjPron ;
in mkClause cltyp isRel hasSubjPron ;
-- Question clauses: subject pronoun is included
cl2qclslash : Bool -> ClSlash -> Clause =
let hasSubjPron : Bool = True ;
isRel : Bool = False ;
in mkClause Question isRel hasSubjPron ;
in mkClause PolarQuestion isRel hasSubjPron ;
-- Sentence: include subject pronoun and STM.
-- When subordinate, include "in".
@@ -979,7 +990,7 @@ oper
Subord => obj.p1 ;
_ => [] } ;
questionNounObj = case cltyp of {
Question => obj.p1 ;
PolarQuestion|WhQuestion => obj.p1 ;
_ => [] } ;
-- Control whether to include subject pronoun and STM
@@ -1017,7 +1028,9 @@ oper
-> Str ;
vf : ClType -> VFun = \clt -> case clt of {
Subord => vfSubord ; _ => vfStatement } ;
Subord => vfSubord ;
WhQuestion => vfQuestion ; -- INF + waayaa 'why did you fail to go'
_ => vfStatement } ;
vfStatement : VFun = \t,ant,p,agr,vp ->
case <t,ant,p> of {
@@ -1043,7 +1056,13 @@ oper
|Pl2 => v.s ! VNegCond SgFem ;
Pl1 _ => v.s ! VNegCond PlInv ;
_ => v.s ! VNegCond SgMasc --Sg1|Sg3 Masc|Pl3|Impers
}
}
} ;
vfQuestion : VFun = \t,ant,p,agr,vp ->
case <t,ant,p> of {
<_,_,Neg> => vp.s ! VInf ++ vfStatement t ant Pos agr (useV fail_V) ;
_ => vfStatement t ant p agr vp
} ;
vfSubord : VFun = \t,ant,p,agr,vp ->
@@ -1056,22 +1075,36 @@ oper
STMarker : Type = ClType => Polarity => Str ;
mkStm : STM -> STMarker = \stm ->
-- NB. Agreement is used only for negative questions. If we want to change it
-- in other sentence types, we need to change predVP and mkClause accordingly;
-- certain VVs put stuff between STM and subject pronoun. Some VVs render now
-- incorrectly in negative questions.
mkStm : Agreement -> STM -> STMarker = \agr,stm ->
\\cltyp,pol =>
case <cltyp,pol> of {
<Statement,Pos> => showSTM stm ;
<Statement,Neg> => "ma" ;
<Question,Pos> => "ma" ;
<Question,Neg> => "sow" ;
<Subord,Pos> => [] ;
<Subord,Neg> => "aan"
<Subord,Neg> => "aan" ;
<WhQuestion,_> => "ma" ; -- neg. wh-questions are formed with waayaa 'fail to do sth', so they are syntactically positive
<PolarQuestion,Pos> => "ma" ;
<PolarQuestion,Neg> => case agr of { -- Negative question in past tense has only one form, need subject pronoun to know what the subject is.
Sg1 => "miyaanan" ; -- Saeed p. 200
Sg2 => "miyaanad" ; -- Saeed p. 200
Sg3 Masc => "miyaanu" ; -- Saeed p. 200
Sg3 Fem => "miyaanay" ; -- ???
Pl1 Excl => "miyaanaannu" ; -- ???
Pl1 Incl => "miyaanaynu" ; -- ???
Pl2 => "miyaanaydin" ; -- ???
Pl3 => "miyaanay" ; -- ???
Impers => "ma aan" } -- not merged
} ;
modSTM : Str -> STMarker -> STMarker = \str,stm ->
modSTM : (pos, neg : Str) -> STMarker -> STMarker = \pos,neg,stm ->
\\cltyp,pol =>
case <cltyp,pol> of {
<_,Pos> => str ;
_ => stm ! cltyp ! pol
case pol of {
Pos => pos ;
_ => neg
} ;
--------------------------------------------------------------------------------
-- linrefs

View File

@@ -34,7 +34,7 @@ lin
--2 Imperatives
-- : VP -> Imp ;
--ImpVP vp = { s = linVP vp } ;
ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ;
--2 Embedded sentences

View File

@@ -40,10 +40,10 @@ lin there_Adv = ss "" ;
-- Conj
lin and_Conj = {s2 = table {Definite => "ee" ; Indefinite => "oo"} ; s1 = [] ; n = Pl} ;
lin or_Conj = {s2 = \\_ => "ama" ; s1 = [] ; n = Sg} ; -- mise with interrogatives
lin or_Conj = {s2 = \\_ => "ama" ; s1 = [] ; n = Sg} ; -- mise with interrogatives; Saeed p. 122-123: "Note that the clause introduced by misé has the form of a declarative not an interrogative though the whole sentence is interpreted as a question."
-- lin if_then_Conj = mkConj
-- lin both7and_DConj = mkConj "" "" pl ;
-- lin either7or_DConj = mkConj "" "" pl ;
lin either7or_DConj = {s2 = \\_ => "ama" ; s1 = "ama" ; n = Sg} ;
--
-- lin but_PConj = ss "" ;
-- lin otherwise_PConj = ss "" ;

View File

@@ -0,0 +1,62 @@
-- Examples from Saeed p. 119
--------------
-- Positive --
--------------
-- Declarative
-- LangEng: he/she/it waits (for him/her/it)
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc
LangSom: waa sugaa
-- Interrogative
-- LangEng: does he/she/it wait (for him/her/it)
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestCl (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc
LangSom: ma sugaa
-- Imperative
-- LangEng: wait for it (sg and pl)
Lang: PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc
LangSom: sug
Lang: PhrUtt NoPConj (UttImpPl PPos (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc
LangSom: suga
-- Conditional
-- LangEng: he/she/it would wait (for him/her/it)
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TCond ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc
LangSom: waa sugi lahaa
-- Optative and potential not implemented (yet?)
--------------
-- Negative --
--------------
-- Declarative
-- LangEng: he/she/it doesn't wait (for him/her/it)
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc
LangSom: ma sugo
-- Interrogative 1: TODO
-- LangEng: does he/she/it wait (for him/her/it)
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestCl (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc
LangSom: ma aan sugo
-- LangEng: why doesn't it wait for it
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestIAdv why_IAdv (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc
LangSom: maxaa u sugi waayaa
-- Imperative
-- LangEng: don't wait for it (sg and pl)
Lang: PhrUtt NoPConj (UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc
LangSom: ha sugin
Lang: PhrUtt NoPConj (UttImpPl PNeg (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc
LangSom: ha sugina
-- Conditional
-- LangEng: he/she/it wouldn't wait (for him/her/it)
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TCond ASimul) PNeg (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc
LangSom: ma sugeen

View File

@@ -1,6 +1,16 @@
-- Question clauses
-- Polar questions
-- LangEng: do you teach the cat
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestCl (PredVP (UsePron youSg_Pron) (ComplSlash (SlashV2a teach_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))) NoVoc
LangSom: ma ku bartaa bisad BIND da
-- LangEng: don't you teach the cat
Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestCl (PredVP (UsePron youSg_Pron) (ComplSlash (SlashV2a teach_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))) NoVoc
LangSom: miyaanad ku barto bisad BIND da
-- Wh-questions
-- LangEng: who wants to go
-- subject pronoun not included, because who is a subject. STM merged to pron.
LangSom: yaa rabaa in uu tago
@@ -31,7 +41,7 @@ Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv where_I
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
-- Negative wh-question, 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