1
0
forked from GitHub/gf-rgl
This commit is contained in:
krangelov
2019-09-03 20:54:25 +02:00
37 changed files with 14898 additions and 850 deletions

View File

@@ -8,18 +8,18 @@ FocusObjS nsubj head -- again might be wrong; more correct to call
QuestIAdv advmod head -- "where does John sleep" cf. AdvVP
QuestIComp head nsubj -- "where is John": John is clearly nsubj, but is where the head?
QuestQVP nsubj head
QuestSlash dobj head
QuestSlash obj head
QuestVP nsubj head
IdetCN det head
PredSCVP csubj head
ComplSlash head dobj
ComplSlashIP head dobj
Slash3V3 head dobj
SlashV2VNP head dobj xcomp
PastPartAgentAP head dobj
AdvQVP head dobj
ComplSlash head obj
ComplSlashIP head obj
Slash3V3 head obj
SlashV2VNP head obj xcomp
PastPartAgentAP head obj
AdvQVP head obj
Slash2V3 head iobj
@@ -157,12 +157,12 @@ TExclMark head dep -- punctuation in the middle in these three
TFullStop head dep
TQuestMark head dep
ComplV2 head dobj -- shortcuts in App
ComplV2V head dobj xcomp
ComplV3 head iobj dobj ---- could be dobj dobj
ComplV2 head obj -- shortcuts in App
ComplV2V head obj xcomp
ComplV3 head iobj obj ---- could be dobj dobj
PassAgentV2 head ncomp -- not sure
RelV2 mark nsubj head
QuestV2 dobj nsubj head
QuestV2 obj nsubj head
ModCN amod head -- in ResourceDemo
RSubjS mark advcl head

View File

@@ -105,6 +105,10 @@ abstract Extend = Cat ** {
NominalizeVPSlashNP : VPSlash -> NP -> NP ;
-- counterpart to ProgrVP, for VPSlash
ProgrVPSlash : VPSlash -> VPSlash;
-- existential for mathematics
ExistsNP : NP -> Cl ; -- there exists a number / there exist numbers

View File

@@ -50,6 +50,7 @@ lin
PastPartAP = variants {} ; -- VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space
PastPartAgentAP = variants {} ; -- VPSlash -> NP -> AP ; -- (opportunity) lost by the company
NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ;
ProgrVPSlash = variants {} ; -- VPSlash -> VPSlash ;
ExistsNP = ExistNP ; -- NP -> Cl ; -- there exists a number / there exist numbers
ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
ExistMassCN cn = ExistNP (MassNP cn) ;

View File

@@ -14,7 +14,7 @@ concrete ExtendEng of Extend =
ExistsNP, ExistCN, ExistMassCN, ExistPluralCN,
FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP,
GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP,
PassAgentVPSlash, PassVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN,
PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN,
EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash,
UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2
]
@@ -222,6 +222,8 @@ concrete ExtendEng of Extend =
lin
PassVPSlash vps = passVPSlash (lin VPS vps) [] ;
PassAgentVPSlash vps np = passVPSlash (lin VPS vps) ("by" ++ np.s ! NPAcc) ;
ProgrVPSlash vp = insertObjc (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a)
(predAux auxBe ** {c2 = vp.c2; gapInMiddle = vp.gapInMiddle; missingAdv = vp.missingAdv});
--- AR 7/3/2013
ComplSlashPartLast vps np = case vps.gapInMiddle of {

View File

@@ -5,8 +5,7 @@ concrete LangFin of Lang =
LexiconFin
, ConstructionFin
, DocumentationFin --# notpresent
** {
flags startcat = Phr ; unlexer = text ; lexer = finnish ;
, MarkupFin - [stringMark]
** {
} ;

View File

@@ -0,0 +1,9 @@
* {"en","et","ei","emme","ette","eivät","älä","älkää"} PART neg head
UseComp {"olen","olet","on","olemme","olette","ovat","olin","olit","oli","olimme","olitte","olivat","olisin","olisit","olisi","olisimme","olisitte","olisivat","ole","olko"} VERB cop head
CompAdv {"olen","olet","on","olemme","olette","ovat","olin","olit","oli","olimme","olitte","olivat","olisin","olisit","olisi","olisimme","olisitte","olisivat","ole","olko"} VERB cop head
CompAP {"olen","olet","on","olemme","olette","ovat","olin","olit","oli","olimme","olitte","olivat","olisin","olisit","olisi","olisimme","olisitte","olisivat","ole","olko"} VERB cop head
CompNP {"olen","olet","on","olemme","olette","ovat","olin","olit","oli","olimme","olitte","olivat","olisin","olisit","olisi","olisimme","olisitte","olisivat","ole","olko"} VERB cop head
CompCN {"olen","olet","on","olemme","olette","ovat","olin","olit","oli","olimme","olitte","olivat","olisin","olisit","olisi","olisimme","olisitte","olisivat","ole","olko"} VERB cop head
PredVP {"olen","olet","on","olemme","olette","ovat","olin","olit","oli","olimme","olitte","olivat","olisin","olisit","olisi","olisimme","olisitte","olisivat","ole","olko"} AUX aux head
ComplVS {"että"} PART mark xcomp

15
src/finnish/MarkupFin.gf Normal file
View File

@@ -0,0 +1,15 @@
--# -path=.:../abstract:../common
concrete MarkupFin of Markup = CatFin, MarkHTMLX ** {
lin
MarkupCN m cn = cn ** {s = \\nf => appMark m (cn.s ! nf)} ;
MarkupNP m np = np ** {s = \\c => appMark m (np.s ! c)} ;
MarkupAP m ap = ap ** {s = \\b,nf => appMark m (ap.s ! b ! nf)} ;
MarkupAdv m adv = {s = appMark m adv.s} ;
MarkupS m s = {s = appMark m s.s} ;
MarkupUtt m utt = {s = appMark m utt.s} ;
MarkupPhr m phr = {s = appMark m phr.s} ;
MarkupText m txt = {s = appMark m txt.s} ;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
* {"ekki"} PART neg head
* {"hef","hefur","hafa","höfum","hafði","hafið","hafðir","hafð","höfðuð","höfðu","höfðum","mun","munt","munu","munum","myndi","myndir","mynduð","myndum","myndu"} AUX aux head
* {"kan","kunde","kunnat","måste"} AUX aux head
UseComp {"verið","vera","var","voru","vorum","voruð","varst","er","eru","erum","ert"} VERB cop head
CompAdv {"verið","vera","var","voru","vorum","voruð","varst","er","eru","erum","ert"} VERB cop head
CompAP {"verið","vera","var","voru","vorum","voruð","varst","er","eru","erum","ert"} VERB cop head
CompNP {"verið","vera","var","voru","vorum","voruð","varst","er","eru","erum","ert"} VERB cop head
CompCN {"verið","vera","var","voru","vorum","voruð","varst","er","eru","erum","ert"} VERB cop head
ComplVV {"að"} PART mark xcomp
ComplVS {"að"} PART mark xcomp

View File

@@ -1102,7 +1102,8 @@ resource MorphoIce = ResIce ** open Prelude, (Predef=Predef), ResIce in {
getðiditi : Str -> Str = \s -> case s of {
_ + "ði" => "ði" ;
_ + "di" => "di" ;
_ + "ti" => "ti"
_ + "ti" => "ti" ;
_ => Predef.error ("no telja type past ending for" ++ s)
} ;
param

View File

@@ -278,13 +278,19 @@ resource ParadigmsIce = open
} ;
mk1A : Str -> A = \s -> lin A (aForms2Adjective
(weakPosit s []) (strongPosit1 s) (compar1 s) (weakSuperl s []) (strongSuperl1 s) (regAAdv1 s)) ;
(weakPosit s s) (strongPosit1 s) (compar1 s) (weakSuperl s s) (strongSuperl1 s) (regAAdv1 s)) ; --- AR 2019-08-08: second arguments of weak declensions were [], producing only endings
mk2A : (_,_ : Str) -> A = \mas,fem -> lin A (aForms2Adjective
(weakPosit mas fem) (strongPosit2 mas fem) (compar2 mas fem) (weakSuperl mas fem) (strongSuperl2 mas fem) (regAAdv2 mas fem)) ;
mk2A : (_,_ : Str) -> A = \mas,fem -> case mas of {
_ + ("ll"|"nn") => mk1A mas ; ---- AR 2019-08-08 ; the case below does not work
_ => lin A (aForms2Adjective
(weakPosit mas fem) (strongPosit2 mas fem) (compar2 mas fem) (weakSuperl mas fem) (strongSuperl2 mas fem) (regAAdv2 mas fem))
} ;
mk3A : (_,_,_ : Str) -> A = \mas,fem,com -> lin A (aForms2Adjective
(weakPosit mas fem) (strongPosit2 mas fem) (compar1 com) (weakSuperl com []) (strongSuperl1 com) (regAAdv2 mas fem)) ;
mk3A : (_,_,_ : Str) -> A = \mas,fem,com -> case mas of {
_ + ("ll"|"nn") => mk1A mas ; ---- AR 2019-08-08 ; the case below does not work
_ => lin A (aForms2Adjective
(weakPosit mas fem) (strongPosit2 mas fem) (compar1 com) (weakSuperl com []) (strongSuperl1 com) (regAAdv2 mas fem))
} ;
strongPosit1 : Str -> AForms = \s -> case s of {
#consonant* + "ei" + ("ll" | "nn") => dSeinn s ;

View File

@@ -0,0 +1,337 @@
concrete SmallDictIce of SmallDictIceAbs = CatIce **
open
ParadigmsIce, (I=WiktIrregIce)
in {
-- monolingual dictionary bootstrapped from LexIce
-- AR 2019-08-07
lin anda_V = mkV "anda" "anda" "andaði" "andaður"; -- some bug somewhere...
lin aska_N = mkN "aska" feminine ;
lin auga_N = mkN "auga" neuter ;
lin auðveldur_A = mkA "auðveldur" ;
lin bak_N = mkN "bak" neuter ;
lin banki_N = mkN "banki" masculine ;
lin barn_N = mkN "barn" neuter ;
lin bein_N = mkN "bein" neuter ;
lin beinn_A = mkA "beinn" ;
lin beittur_A = mkA "beittur" ;
lin belja_N = mkN "belja" feminine ;
lin berja_V = (mkV "berja") ;
lin beygja_V = mkV "beygja" "beygi" ;
lin binda_V = I.binda_V ;
lin biðja_V = I.biðja_V ;
lin blautur_A = mkA "blautur" ;
lin blár_A = mkA "blár" "blá" ;
lin blása_V = I.blása_V ;
lin blóm_N = mkN "blóm" neuter ;
lin blóð_N = mkN "blóð" neuter ;
lin borg_N = mkN "borg" "borgir" feminine ;
lin borð_N = mkN "borð" neuter ;
lin borða_V = (mkV "borða" "borða" "borðaði" "borðaður") ;
lin brauð_N = mkN "brauð" neuter ;
lin breiður_A = mkA "breiður" ;
lin brenna_V = I.brenna_V ;
lin brjóst_N = mkN "brjóst" neuter ;
lin brjóta_V = I.brjóta_V ;
lin bróðir_N = mkN "bróðir" "bróður" "bræður" masculine ;
lin brúnn_A = mkA "brúnn" ;
lin bátur_N = mkN "bátur" masculine ;
lin bæta_V = mkV "bæta" "bæti" "bætti" "bættur" ;
lin bíll_N = mkN "bíll" masculine ;
lin bíta_V = I.bíta_V ;
lin bók_N = mkN "bók" "bókar" "bækur" feminine ;
lin bólgna_V = mkV "bólgna" "bólgna" "bólgnaði" "bólgnaður" ;
lin börkur_N = mkN "börkur" "barkar" "berkir" masculine ;
lin búð_N = mkN "búð" "búðir" feminine ;
lin dagblað_N = mkN "dagblað" neuter ;
lin dagur_N = mkN "dagur" masculine ;
lin detta_V = I.detta_V ;
lin deyja_V = I.deyja_V ;
lin drekka_V = I.drekka_V ;
lin drepa_V = I.drepa_V ;
lin drottning_N = mkN "drottning" feminine ;
lin dýr_N = mkN "dýr" neuter ;
lin eftir_V = (I.bíða_V) ;
lin egg_N = mkN "egg" neuter ;
lin eiginkona_N = mkCompoundN "eigin" (kona_N) ;
lin eiginmaður_N = mkCompoundN "eigin" (maður_N) ;
lin eldavél_N = mkN "eldavél" "eldavélar" feminine ;
lin eldur_N = mkN "eldur" "eldar" masculine ;
lin elska_V = (mkV "elska" "elska" "elskaði" "elskaður") ;
lin epli_N = mkN "epli" neuter ;
lin eyra_N = mkN "eyra" neuter ;
lin fallegur_A = mkA "fallegur" ;
lin fara_V = I.fara_V ;
lin faðir_N = mkN "faðir" "föður" "feður" masculine ;
lin ferða_V = mkV "ferða" "ferða" "ferðaði" "ferðaður" ; -- this verb only exists in the middle voice
lin finna_V = I.finna_V ;
lin fiskur_N = mkN "fiskur" masculine ;
lin fita_N = mkN "fita" feminine ;
lin fjall_N = mkN "fjall" neuter ;
lin fjöður_N = mkN "fjöður" "fjaðrir" feminine ;
lin fljóta_V = I.fljóta_V ;
lin fljúga_V = I.fljúga_V ;
lin flugvél_N = mkN "flugvél" "flugvélar" feminine ;
lin flæða_V = mkV "flæða" ;
lin friður_N = mkN "friður" masculine ;
lin frjósa_V = I.frjósa_V ;
lin fræ_N = mkN "fræ" neuter ;
lin frændi_N = mkN "frændi" masculine ; -- frænka is the feminine equivalent
lin fugl_N = mkN "fugl" masculine ;
lin fullur_A = mkA "fullur" ;
lin fótleggur_N = mkCompoundN "fót" (mkN "leggur" "leggjar" "leggir" masculine) ;
lin fótur_N = mkN "fótur" "fætur" masculine ;
lin gamall_A = mkA "gamall" ;
lin ganga_V = I.ganga_V ;
lin garður_N = mkN "garður" masculine ;
lin gefa_V = I.gefa_V ;
lin gera_V = (mkV "gera") ;
lin giftur_A = mkA "giftur" ;
lin gleyma_V = (mkV "gleyma") ;
lin gluggi_N = mkN "gluggi" masculine ;
lin grafa_V = I.grafa_V ;
lin gras_N = mkN "gras" neuter ;
lin grænn_A = mkA "grænn" ;
lin gull_N = mkN "gull" neuter ;
lin gulur_A = mkA "gulur" ;
lin gólf_N = mkN "gólf" neuter ;
lin góður_A = mkA "góður" "góð" "betri" ;
lin görn_N = mkN "görn" "garnir" feminine ;
lin gúmmí_N = mkN "gúmmí" neuter ;
lin halda_V = I.halda_V ;
lin hanski_N = mkN "hanski" masculine ;
lin hata_V = (mkV "hata" "hata" "hataði" "hataður") ;
lin hattur_N = mkN "hattur" masculine ;
lin haus_N = mkN "haus" masculine ;
lin heimskur_A = mkA "heimskur" ;
lin heitur_A = mkA "heitur" ;
lin hestur_N = mkN "hestur" masculine ;
lin heyra_V = (mkV "heyra") ;
lin himinn_N = mkN "himinn" masculine ;
lin hjarta_N = mkN "hjarta" neuter ;
lin hjól_N = mkN "hjól" neuter ;
lin hlaupa_V = I.hlaupa_V ;
lin hlusta_V = (mkV "hlusta" "hlusta" "hlustaði" "hlustaður") ;
lin hlæja_V = I.hlæja_V ;
lin hné_N = mkN "hné" neuter ;
lin hoppa_V = mkV "hoppa" "hoppa" ;
lin horfa_V = (mkV "horfa") ;
lin horn_N = mkN "horn" neuter ;
lin hreinn_A = mkA "hreinn" ;
lin hrækja_V = mkV "hrækja" ;
lin hugsa_V = mkV "hugsa" "hugsa" "hugsaði" "hugsaður" ;
lin hundur_N = mkN "hundur" masculine ;
lin hurð_N = mkN "hurð" "hurðir" feminine ;
lin hvítur_A = mkA "hvítur" ;
lin háls_N = mkN "háls" masculine ;
lin hár_N = mkN "hár" neuter ;
lin háskóli_N = mkN "háskóli" masculine ;
lin hæð_N = mkN "hæð" "hæðir" feminine ;
lin höfn_N = mkN "höfn" "hafnir" feminine ;
lin hönd_N = mkN "hönd" "hönd" "hendi" "handar" "hendur" "hendur" "höndum" "handa" feminine ;
lin húfa_N = mkN "húfa" feminine ;
lin hús_N = mkN "hús" neuter ;
lin húð_N = mkN "húð" "húðir" feminine ;
lin iðnaður_N = mkN "iðnaður" masculine ;
lin járn_N = mkN "járn" neuter ;
lin jörð_N = mkN "jörð" "jarðir" feminine ;
lin kaldur_A = mkA "kaldur" ;
lin kasta_V = (mkV "kasta" "kasta" "kastaði" "kastaður") ;
lin kaupa_V = (mkV "kaupa" "kaupi" "keypti" "keyptur" "keypt") ;
lin kenna_V = (mkV "kenna") ;
lin kennari_N = mkN "kennari" masculine ;
lin kind_N = mkN "kind" "kindar" "kindur" feminine ;
lin kirkja_N = mkN "kirkja" feminine ;
lin kjöt_N = mkN "kjöt" neuter ;
lin klettur_N = mkN "klettur" masculine ;
lin klippa_V = (mkV "klippa") ;
lin klár_A = mkA "klár" "klár" ;
lin klóra_V = (mkV "klóra" "klóra" "klóraði" "klóraður") ;
lin koma_V = I.koma_V ;
lin kona_N = mkN "kona" "konu" "konur" "kvenna" feminine ;
lin konungur_N = mkN "konungur" masculine ;
lin kreista_V = (mkV "kreista") ;
lin kringlóttur_A = mkA "kringlóttur" ;
lin kápa_N = mkN "kápa" feminine ;
lin köttur_N = mkN "köttur" "kattar" "kettir" masculine ;
lin lag_N = mkN "lag" neuter ;
lin lampi_N = mkN "lampi" masculine ;
lin land_N = mkN "land" neuter ;
lin langt_Adv = mkAdv "langt" ;
lin langur_A = mkA "langur" ;
lin lauf_N = mkN "lauf" neuter ;
lin leika_V = I.leika_V ;
lin leita_V = (mkV "leita" "leita" "leitaði" "leitaður") ;
lin lesa_V = I.lesa_V ;
lin lest_N = mkN "lest" "lestir" feminine ;
lin leðinilegur_A = mkA "leðinilegur" ;
lin leður_N = mkN "leður" neuter ;
lin lifa_V = mkV "lifa" ;
lin lifur_N = mkN "lifur" "lifrar" feminine ;
lin list_N = mkN "list" "listir" feminine ;
lin ljótur_A = mkA "ljótur" ;
lin ljúga_V = I.ljúga_V ;
lin loft_N = mkN "loft" neuter ;
lin loka_V = (mkV "loka" "loka" "lokaði" "lokaður") ;
lin láta_V = I.láta_V ;
lin læknir_N = mkN "læknir" "lækni" "lækni" "læknis" "læknar" "lækna" "læknum" "lækna" masculine ;
lin læra_V = (mkV "læra") ;
lin líklegur_A = mkA "líklegur" ;
lin lítill_A = mkA "lítill" "lítil" "minni" ;
lin lögregluþjónn_N = mkCompoundN "lögreglu" (mkN "þjónn" masculine) ;
lin lús_N = mkN "lús" "lýs" feminine ;
lin magi_N = mkN "magi" masculine ;
lin maður_N = mkN "maður" "manns" "menn" masculine ;
lin mikilvægur_A = mkA "mikilvægur" ;
lin mjólk_N = mkN "mjólk" "mjólk" "mjólk" "mjólkur" "mjólk" "mjólk" "mjólk" "mjólkur" feminine ;
lin munnur_N = mkN "munnur" masculine ;
lin myndavél_N = mkN "myndavél" "myndavélar" feminine ;
lin mála_V = (mkV "mála" "mála" "málaði" "málaður") ;
lin málfræði_N = mkN "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" feminine ;
lin móðir_N = mkN "móðir" "mæður" feminine ;
lin nafn_N = mkN "nafn" neuter ;
lin nef_N = mkN "nef" neuter ;
lin nemandi_N = mkN "nemandi" masculine ;
lin nudda_V = (mkV "nudda" "nudda" "nuddaði" "nuddaður") ;
lin nálægur_A = mkA "nálægur" ;
lin nótt_N = mkN "nótt" "nætur" "nætur" "nótta" feminine ;
lin nögl_N = mkN "nögl" "naglar" "neglur" feminine ;
lin númer_N = mkN "númer" neuter ;
lin núna_Adv = mkAdv "núna" ;
lin nýr_A = mkA "nýr" "ný" ;
lin olía_N = mkN "olía" feminine ;
lin opna_V = (mkV "opna" "opna" "opnaði" "opnaður") ;
lin ormur_N = mkN "ormur" masculine ;
lin ostur_N = mkN "ostur" masculine ;
lin other_A = mkA "other" ;
lin pappír_N = mkN "pappír" masculine ;
lin penni_N = mkN "penni" masculine ;
lin persóna_N = mkN "persóna" feminine ;
lin plat_N = mkN "plat" neuter ;
lin pláneta_N = mkN "pláneta" feminine ;
lin prestur_N = mkN "prestur" masculine ;
lin prik_N = mkN "prik" neuter ;
lin rauður_A = mkA "rauður" ;
lin regla_N = mkN "regla" feminine ;
lin reipi_N = mkN "reipi" neuter ;
lin reykur_N = mkN "reykur" "reykjar" "reykir" masculine;
lin rigning_N = mkN "rigning" feminine ;
lin rotinn_A = mkA "rotinn" ;
lin ryk_N = mkN "ryk" neuter ;
lin réttur_A = mkA "réttur" ;
lin rófa_N = mkN "rófa" feminine ;
lin rót_N = mkN "rót" "rótar" "rætur" feminine ;
lin salt_N = mkN "salt" neuter ;
lin sandur_N = mkN "sandur" masculine ;
lin sauma_V = mkV "sauma" "sauma" "saumaði" "saumaður" ;
lin segja_V = mkV "segja" "segi" "sagði" "sagður";
lin selja_V = (mkV "selja") ;
lin senda_V = (mkV "senda") ;
lin silfur_N = mkN "silfur" neuter ;
lin sitja_V = I.sitja_V ;
lin sjá_V = I.sjá_V ;
lin sjónvarp_N = mkN "sjónvarp" neuter ;
lin sjór_N = mkN "sjór" "sjó" "sjó" "sjós" "sjóir" "sjói" "sjóum" "sjóa" masculine ;
lin sjúga_V = I.sjúga_V ;
lin skemmtilegur_A = mkA "skemmtilegur" ;
lin skilja_V = (mkV "skilja") ;
lin skip_N = mkN "skip" neuter ;
lin skipta_V = (mkV "skipta") ;
lin skrifa_V = (mkV "skrifa" "skrifa" "skrifaði" "skrifaður") ;
lin skyrta_N = mkN "skyrta" feminine ;
lin skítugur_A = mkA "skítugur" ;
lin skógur_N = mkN "skógur" masculine ;
lin skóli_N = mkN "skóli" masculine ;
lin skór_N = mkN "skór" "skór" masculine ;
lin ský_N = mkN "ský" neuter ;
lin sléttur_A = mkA "sléttur" ;
lin smjör_N = mkN "smjör" neuter ;
lin snjór_N = mkN "snjór" masculine ;
lin snákur_N = mkN "snákur" masculine ;
lin sofa_V = I.sofa_V ;
lin sokkur_N = mkN "sokkur" masculine ;
lin spurning_N = mkN "spurning" feminine ;
lin spyrja_V = (mkV "spyrja" "spyr" "spurði" "spurður") ;
lin standa_V = I.standa_V ;
lin stansa_V = mkV "stansa" "stansa" "stansaði" "stansaður" ;
lin steinn_N = mkN "steinn" masculine ;
lin stelpa_N = mkNPlGen "stelpa" feminine ;
lin stinga_V = I.stinga_V ;
lin stjarna_N = mkN "stjarna" feminine ;
lin stjóri_N = mkN "stjóri" masculine ;
lin strjúka_V = I.strjúka_V ;
lin strákur_N = mkN "strákur" masculine ;
lin stríð_N = mkN "stríð" neuter ;
lin stuttur_A = mkA "stuttur" "stutt" "syttri" ;
lin stál_N = mkN "stál" neuter ;
lin stóll_N = mkN "stóll" masculine ;
lin stór_A = mkA "stór" "stór" "stærri" ;
lin svara_V = (mkV "svara" "svara" "svaraði" "svaraður") ;
lin svartur_A = mkA "svartur" ;
lin synda_V = mkV "synda" ;
lin syngja_V = I.syngja_V ;
lin systir_N = mkN "systir" "systur" feminine ;
lin sígvél_N = mkN "sígvél" neuter ;
lin sól_N = mkN "sól" "sólir" feminine ;
lin tala_V = (mkV "tala" "tala" "talaði" "talaður") ;
lin telja_V = (mkV "telja") ;
lin teppi_N = mkN "teppi" neuter ;
lin tilbúinn_A = mkA "tilbúinn" ;
lin toga_V = (mkV "toga" "toga" "togaði" "togaður") ;
lin tré_N = mkN "tré" neuter ;
lin trúarbragð_N = mkN "trúarbragð" neuter ;
lin tunga_N = mkNPlGen "tunga" feminine ;
lin tungl_N = mkN "tungl" neuter ;
lin tungumál_N = mkN "tungumál" neuter ;
lin tómur_A = mkA "tómur" ;
lin tónlist_N = mkN "tónlist" "tónlist" "tónlist" "tónlistar" "tónlist" "tónlist" "tónlist" "tónlistar" feminine ;
lin tölva_N = mkN "tölva" feminine ;
lin tönn_N = mkN "tönn" "tannar" "tennur" feminine ;
lin týna_V = (mkV "týna") ;
lin ungur_A = mkA "ungur" "ung" "yngri" ;
lin vatn_N = mkN "vatn" neuter ;
lin vegalend_N = mkN "vegalend" "vegalengdir" feminine ;
lin vegur_N = mkN "vegur" "vegar" "vegir" masculine ;
lin veitingastaður_N = mkCompoundN "veitinga" (mkN "staður" "staðar" "staðir" masculine) ;
lin veiða_V = (mkV "veiða") ;
lin velta_V = mkV "velta" ;
lin verksmiðja_N = mkN "verksmiðja" feminine ;
lin verða_V = I.verða_V ;
lin vindur_N = mkN "vindur" masculine ;
lin vinna_V = I.vinna_V ;
lin vinur_N = mkN "vinur" "vinar" "vinir" masculine ;
lin vita_V = I.vita_V ;
lin viður_N = mkN "viður" "viðar" "viðir" masculine ;
lin vona_V = mkV "vona" "vona" "vonaði" "vonaður" ;
lin vondur_A = mkA "vondur" "vond" "verri" ;
lin vængur_N = mkN "vængur" masculine ;
lin vín_N = mkN "vín" neuter ;
lin víður_A = mkA "víður" ;
lin á_N = mkN "á" "ár" feminine ;
lin ár_N = mkN "ár" neuter ;
lin ást_N = mkN "ást" "ástir" feminine ;
lin ástæða_N = mkNPlGen "ástæða" feminine ;
lin ávöxtur_N = mkN "ávöxtur" "ávaxtar" "ávextir" masculine ;
lin æla_V = mkV "æla" ;
lin í_Adv = mkAdv "í dag" ;
lin íbúð_N = mkN "íbúð" "íbúðir" feminine ;
lin ísskápur_N = mkCompoundN "ís" (mkN "skápur" "skáps" "skápar" masculine) ;
lin ís_N = mkN "ís" masculine ;
lin óvinur_N = mkCompoundN "ó" (vinur_N) ;
lin óviss_A = mkA "óviss" "óviss" "óvissari" ;
lin öl_N = mkN "öl" neuter ;
lin útvarp_N = mkN "útvarp" neuter ;
lin ýta_V = (mkV "ýta") ;
lin þak_N = mkN "þak" neuter ;
lin þefa_V = mkV "þefa" "þefa" "þefaði" "þefaður" ;
lin þegar_Adv = mkAdv "þegar" ;
lin þoka_N = mkN "þoka" feminine ;
lin þorp_N = mkN "þorp" neuter ;
lin þrífa_V = I.þrífa_V ;
lin þröngur_A = mkA "þröngur" ;
lin þungur_A = mkA "þungur" "þung" "þyngri" ;
lin þunnur_A = mkA "þunnur" "þunn" "þynnri" ;
lin þurr_A = mkA "þurr" "þurr" ;
lin þykkur_A = mkA "þykkur" ;
}

View File

@@ -0,0 +1,334 @@
abstract SmallDictIceAbs = Cat ** {
-- monolingual dictionary bootstrapped from LexIce
-- AR 2019-08-07
fun anda_V : V ;
fun aska_N : N ;
fun auga_N : N ;
fun auðveldur_A : A ;
fun bak_N : N ;
fun banki_N : N ;
fun barn_N : N ;
fun bein_N : N ;
fun beinn_A : A ;
fun beittur_A : A ;
fun belja_N : N ;
fun berja_V : V ;
fun beygja_V : V ;
fun binda_V : V ;
fun biðja_V : V ;
fun blautur_A : A ;
fun blár_A : A ;
fun blása_V : V ;
fun blóm_N : N ;
fun blóð_N : N ;
fun borg_N : N ;
fun borð_N : N ;
fun borða_V : V ;
fun brauð_N : N ;
fun breiður_A : A ;
fun brenna_V : V ;
fun brjóst_N : N ;
fun brjóta_V : V ;
fun bróðir_N : N ;
fun brúnn_A : A ;
fun bátur_N : N ;
fun bæta_V : V ;
fun bíll_N : N ;
fun bíta_V : V ;
fun bók_N : N ;
fun bólgna_V : V ;
fun börkur_N : N ;
fun búð_N : N ;
fun dagblað_N : N ;
fun dagur_N : N ;
fun detta_V : V ;
fun deyja_V : V ;
fun drekka_V : V ;
fun drepa_V : V ;
fun drottning_N : N ;
fun dýr_N : N ;
fun eftir_V : V ;
fun egg_N : N ;
fun eiginkona_N : N ;
fun eiginmaður_N : N ;
fun eldavél_N : N ;
fun eldur_N : N ;
fun elska_V : V ;
fun epli_N : N ;
fun eyra_N : N ;
fun fallegur_A : A ;
fun fara_V : V ;
fun faðir_N : N ;
fun ferða_V : V ;
fun finna_V : V ;
fun fiskur_N : N ;
fun fita_N : N ;
fun fjall_N : N ;
fun fjöður_N : N ;
fun fljóta_V : V ;
fun fljúga_V : V ;
fun flugvél_N : N ;
fun flæða_V : V ;
fun friður_N : N ;
fun frjósa_V : V ;
fun fræ_N : N ;
fun frændi_N : N ;
fun fugl_N : N ;
fun fullur_A : A ;
fun fótleggur_N : N ;
fun fótur_N : N ;
fun gamall_A : A ;
fun ganga_V : V ;
fun garður_N : N ;
fun gefa_V : V ;
fun gera_V : V ;
fun giftur_A : A ;
fun gleyma_V : V ;
fun gluggi_N : N ;
fun grafa_V : V ;
fun gras_N : N ;
fun grænn_A : A ;
fun gull_N : N ;
fun gulur_A : A ;
fun gólf_N : N ;
fun góður_A : A ;
fun görn_N : N ;
fun gúmmí_N : N ;
fun halda_V : V ;
fun hanski_N : N ;
fun hata_V : V ;
fun hattur_N : N ;
fun haus_N : N ;
fun heimskur_A : A ;
fun heitur_A : A ;
fun hestur_N : N ;
fun heyra_V : V ;
fun himinn_N : N ;
fun hjarta_N : N ;
fun hjól_N : N ;
fun hlaupa_V : V ;
fun hlusta_V : V ;
fun hlæja_V : V ;
fun hné_N : N ;
fun hoppa_V : V ;
fun horfa_V : V ;
fun horn_N : N ;
fun hreinn_A : A ;
fun hrækja_V : V ;
fun hugsa_V : V ;
fun hundur_N : N ;
fun hurð_N : N ;
fun hvítur_A : A ;
fun háls_N : N ;
fun hár_N : N ;
fun háskóli_N : N ;
fun hæð_N : N ;
fun höfn_N : N ;
fun hönd_N : N ;
fun húfa_N : N ;
fun hús_N : N ;
fun húð_N : N ;
fun iðnaður_N : N ;
fun járn_N : N ;
fun jörð_N : N ;
fun kaldur_A : A ;
fun kasta_V : V ;
fun kaupa_V : V ;
fun kenna_V : V ;
fun kennari_N : N ;
fun kind_N : N ;
fun kirkja_N : N ;
fun kjöt_N : N ;
fun klettur_N : N ;
fun klippa_V : V ;
fun klár_A : A ;
fun klóra_V : V ;
fun koma_V : V ;
fun kona_N : N ;
fun konungur_N : N ;
fun kreista_V : V ;
fun kringlóttur_A : A ;
fun kápa_N : N ;
fun köttur_N : N ;
fun lag_N : N ;
fun lampi_N : N ;
fun land_N : N ;
fun langt_Adv : Adv ;
fun langur_A : A ;
fun lauf_N : N ;
fun leika_V : V ;
fun leita_V : V ;
fun lesa_V : V ;
fun lest_N : N ;
fun leðinilegur_A : A ;
fun leður_N : N ;
fun lifa_V : V ;
fun lifur_N : N ;
fun list_N : N ;
fun ljótur_A : A ;
fun ljúga_V : V ;
fun loft_N : N ;
fun loka_V : V ;
fun láta_V : V ;
fun læknir_N : N ;
fun læra_V : V ;
fun líklegur_A : A ;
fun lítill_A : A ;
fun lögregluþjónn_N : N ;
fun lús_N : N ;
fun magi_N : N ;
fun maður_N : N ;
fun mikilvægur_A : A ;
fun mjólk_N : N ;
fun munnur_N : N ;
fun myndavél_N : N ;
fun mála_V : V ;
fun málfræði_N : N ;
fun móðir_N : N ;
fun nafn_N : N ;
fun nef_N : N ;
fun nemandi_N : N ;
fun nudda_V : V ;
fun nálægur_A : A ;
fun nótt_N : N ;
fun nögl_N : N ;
fun númer_N : N ;
fun núna_Adv : Adv ;
fun nýr_A : A ;
fun olía_N : N ;
fun opna_V : V ;
fun ormur_N : N ;
fun ostur_N : N ;
fun other_A : A ;
fun pappír_N : N ;
fun penni_N : N ;
fun persóna_N : N ;
fun plat_N : N ;
fun pláneta_N : N ;
fun prestur_N : N ;
fun prik_N : N ;
fun rauður_A : A ;
fun regla_N : N ;
fun reipi_N : N ;
fun reykur_N : N ;
fun rigning_N : N ;
fun rotinn_A : A ;
fun ryk_N : N ;
fun réttur_A : A ;
fun rófa_N : N ;
fun rót_N : N ;
fun salt_N : N ;
fun sandur_N : N ;
fun sauma_V : V ;
fun segja_V : V ;
fun selja_V : V ;
fun senda_V : V ;
fun silfur_N : N ;
fun sitja_V : V ;
fun sjá_V : V ;
fun sjónvarp_N : N ;
fun sjór_N : N ;
fun sjúga_V : V ;
fun skemmtilegur_A : A ;
fun skilja_V : V ;
fun skip_N : N ;
fun skipta_V : V ;
fun skrifa_V : V ;
fun skyrta_N : N ;
fun skítugur_A : A ;
fun skógur_N : N ;
fun skóli_N : N ;
fun skór_N : N ;
fun ský_N : N ;
fun sléttur_A : A ;
fun smjör_N : N ;
fun snjór_N : N ;
fun snákur_N : N ;
fun sofa_V : V ;
fun sokkur_N : N ;
fun spurning_N : N ;
fun spyrja_V : V ;
fun standa_V : V ;
fun stansa_V : V ;
fun steinn_N : N ;
fun stelpa_N : N ;
fun stinga_V : V ;
fun stjarna_N : N ;
fun stjóri_N : N ;
fun strjúka_V : V ;
fun strákur_N : N ;
fun stríð_N : N ;
fun stuttur_A : A ;
fun stál_N : N ;
fun stóll_N : N ;
fun stór_A : A ;
fun svara_V : V ;
fun svartur_A : A ;
fun synda_V : V ;
fun syngja_V : V ;
fun systir_N : N ;
fun sígvél_N : N ;
fun sól_N : N ;
fun tala_V : V ;
fun telja_V : V ;
fun teppi_N : N ;
fun tilbúinn_A : A ;
fun toga_V : V ;
fun tré_N : N ;
fun trúarbragð_N : N ;
fun tunga_N : N ;
fun tungl_N : N ;
fun tungumál_N : N ;
fun tómur_A : A ;
fun tónlist_N : N ;
fun tölva_N : N ;
fun tönn_N : N ;
fun týna_V : V ;
fun ungur_A : A ;
fun vatn_N : N ;
fun vegalend_N : N ;
fun vegur_N : N ;
fun veitingastaður_N : N ;
fun veiða_V : V ;
fun velta_V : V ;
fun verksmiðja_N : N ;
fun verða_V : V ;
fun vindur_N : N ;
fun vinna_V : V ;
fun vinur_N : N ;
fun vita_V : V ;
fun viður_N : N ;
fun vona_V : V ;
fun vondur_A : A ;
fun vængur_N : N ;
fun vín_N : N ;
fun víður_A : A ;
fun á_N : N ;
fun ár_N : N ;
fun ást_N : N ;
fun ástæða_N : N ;
fun ávöxtur_N : N ;
fun æla_V : V ;
fun í_Adv : Adv ;
fun íbúð_N : N ;
fun ísskápur_N : N ;
fun ís_N : N ;
fun óvinur_N : N ;
fun óviss_A : A ;
fun öl_N : N ;
fun útvarp_N : N ;
fun ýta_V : V ;
fun þak_N : N ;
fun þefa_V : V ;
fun þegar_Adv : Adv ;
fun þoka_N : N ;
fun þorp_N : N ;
fun þrífa_V : V ;
fun þröngur_A : A ;
fun þungur_A : A ;
fun þunnur_A : A ;
fun þurr_A : A ;
fun þykkur_A : A ;
}

View File

@@ -2,6 +2,7 @@ import qualified Data.Map
import qualified Data.Text.IO
import Data.Char
import Data.List
import System.Directory
-- AR 2019-08-06
-- checking IrregIce wrt Wikipedia:
@@ -138,43 +139,69 @@ actInf v@(i:_) = last (words i)
jumpToIcelandic ls = dropWhile (\l -> not (isPrefixOf "<h2>" l && isPrefixOf "Icelandic" (untag l))) ls
-------------------------------
-- just retrieving ------------
----------------------------------------------------------------------
-- just retrieving, instead of checking existing GF files ------------
-- to be run in verbs/
getAllWiktVerbs = do
vs <- readFile "wikt-verbs.txt" >>= return . lines
writeFile "v.tmp" ""
mapM_ (\v -> getWiktVerb v >>= appendFile "v.tmp" . unlines . emitGF) vs
-- to be run in wiktionary/, with subdirs nouns/ adjectives/ verbs/
-- to be run in adjectives/
getAllWiktNouns = do
vs <- readFile "nouns/wikt-nouns.txt" >>= return . lines
writeFile "n.tmp" ""
mapM_ (\v -> getWiktNoun "nouns/" v >>= appendFile "n.tmp" . unlines . emitGF) vs
getAllWiktAdjectives = do
vs <- readFile "wikt-verbs.txt" >>= return . lines
mapM_ (\v -> getWiktAdjective v >>= putStrLn . unlines . emitGF) vs
vs <- readFile "adjectives/wikt-adjectives.txt" >>= return . lines
writeFile "a.tmp" ""
mapM_ (\v -> getWiktAdjective "adjectives/" v >>= appendFile "a.tmp" . unlines . emitGF) vs
getAllWiktVerbs = do
vs <- readFile "verbs/wikt-verbs.txt" >>= return . lines
writeFile "v.tmp" ""
mapM_ (\v -> getWiktVerb "verbs/" v >>= appendFile "v.tmp" . unlines . emitGF) vs
-- return ([relevant Wikt lines], (fun,cat,lin), message)
getWiktWord :: Int -> (String -> [String] -> ([String],((String,String,String),Message))) -> FilePath -> IO ([String],((String,String,String),Message))
getWiktWord number check file = do
s <- readFile file >>= return . map untag . take number . getTD . jumpToIcelandic . lines
return $ check file s
getWiktWord :: Int -> (String -> [String] -> ([String],((String,String,String),Message))) -> FilePath -> FilePath -> IO ([String],((String,String,String),Message))
getWiktWord number check dir file = do
let dirfile = dir++file
ex <- doesFileExist dirfile
if not ex
then return ([],(noGF,MBad (file ++ " does not exist")))
else do
s <- readFile dirfile >>= return . map untag . take number . getTD . jumpToIcelandic . lines
return $ check file s
getWiktNoun = getWiktWord 17 checkNoun
getWiktAdjective = getWiktWord 120 noCheck
getWiktAdjective = getWiktWord 120 checkAdjective
getWiktVerb = getWiktWord 75 checkVerb
noCheck :: String -> [String] -> ([String],((String,String,String),Message))
noCheck s ss = (ss, (noGF, MMissing s))
noGF = ("--","--","--")
checkNoun noun forms = noCheck noun forms ----
checkNoun noun forms = case length forms of
---- n | n < 24 -> (forms, (noGF, MBad (adj ++ " A: only " ++ show (length forms) ++ " lines")))
n | n < 17 -> (forms, (noGF, MBad (noun ++ " N: only " ++ show (length forms) ++ " lines")))
_ -> (forms, checkZZ noun (noun ++ "_N", "N", "mkgN " ++ gender (forms!!0), [forms!!i | i <- [1,5,9,13,3,7,11,15]]))
where
gender s = case take 1 s of
"m" -> "masculine"
"f" -> "feminine"
_ -> "neuter" --- "n"
checkVerb verb forms =
if length forms < 75
then (forms, (noGF, MBad (verb ++ ": only " ++ show (length forms) ++ " lines")))
else case unexpectedWikLines forms of
[] -> (forms, ((verb ++ "_V", "V", app "mkV" [verb, forms!!5, forms!!18, forms!!74, forms!!1]), MGood verb)) ----
us -> (forms, (noGF, MBad (verb ++ ": unexpected lines " ++ show (length us))))
checkAdjective adj forms = case length forms of
n | n < 24 -> (forms, (noGF, MBad (adj ++ " A: only " ++ show (length forms) ++ " lines")))
n | n < 120 -> (forms, checkZZ adj (adj ++ "_A", "A", "mkA", [forms!!0, forms!!1]))
_ -> (forms, checkZZ adj (adj ++ "_A", "A", "mkA", [forms!!0, forms!!1,forms!!48]))
checkVerb verb forms = case length forms of
n | n < 75 -> (forms, (noGF, MBad (verb ++ " V: only " ++ show (length forms) ++ " lines")))
_ -> case unexpectedWikLines forms of
[] -> (forms, checkZZ verb (verb ++ "_V", "V", "mkV", [verb, forms!!5, forms!!18, forms!!74, forms!!1]))
us -> (forms, (noGF, MBad (verb ++ " V: unexpected lines " ++ show (length us))))
data Message =
MGood String
@@ -185,6 +212,11 @@ data Message =
app f xs = unwords $ f : map (quote . wform . words) xs
quote s = "\"" ++ s ++ "\""
checkZZ w (fun,cat,lin,args) =
if elem "ZZ" (map (wform . words) args)
then (noGF, MBad (w ++ " " ++ cat ++ ": missing forms in data"))
else ((fun,cat, app lin args),MGood w)
emitGF (ss,((fun,cat,lin),msg)) = case msg of
MGood _ -> [unwords ["fun",fun,":",cat,";"],unwords ["lin",fun,"=",lin,";"]]
_ -> ["-- " ++ show msg]

View File

@@ -119,6 +119,8 @@ incomplete concrete ExtendRomanceFunctor of Extend =
NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ;
ProgrVPSlash = variants {} ; -- VPSlash -> VPSlash ;
ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
ExistMassCN cn = ExistNP (MassNP cn) ;
ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ;

View File

@@ -11,7 +11,14 @@ lin
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
-- : Prep -> NP -> Adv ;
PrepNP prep np = prep ** {s = [] ; np = nplite np} ;
PrepNP prep np = prep ** {
np = case prep.isPoss of {
True => nplite emptyNP ;
False => nplite np } ;
miscAdv = case prep.isPoss of {
True => np.s ! Abs ++ prep.miscAdv ! np.a ;
False => prep.miscAdv ! Sg3 Masc }
} ;
-- Adverbs can be modified by 'adadjectives', just like adjectives.
@@ -24,8 +31,7 @@ lin
-- Subordinate clauses can function as adverbs.
-- : Subj -> S -> Adv ;
SubjS subj s = let subs = s.s ! True in
mkAdv (subs.beforeSTM ++ subj.s ++ subs.stm ++ subs.afterSTM) ;
SubjS subj s = mkAdv (s.s ! True) ;
-- Comparison adverbs also work as numeral adverbs.

View File

@@ -9,11 +9,11 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
S = ResSom.Sentence ;
QS = SS ;
RS = {s : Gender => Case => Str} ;
RS = {s : State => GenNum => Case => Str} ;
-- relative sentence. Tense and polarity fixed,
-- but agreement may depend on the CN/NP it modifies.
Cl = ResSom.Clause ;
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"
@@ -62,7 +62,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
NP = ResSom.NounPhrase ;
Pron = ResSom.Pronoun ; --Pronouns need enough info to turn it into NP or Quant.
Det = ResSom.Determiner ;
Predet = {s : Str} ;
Predet = {s : Str ; da : DefArticle ; isPoss : Bool} ;
Quant = ResSom.Quant ;
Num = ResSom.Num ;
Ord = {s : Str ; n : Number} ;
@@ -84,7 +84,11 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
-- Constructed in StructuralSom.
Conj = {s2 : State => Str ; s1 : Str ; n : Number } ;
Subj = SS ;
Prep = ResSom.Prep ** {c2 : Preposition ; berri, sii, dhex : Str} ;
Prep = ResSom.Prep ** {
isPoss : Bool ;
c2 : Preposition ;
berri, sii, dhex : Str ;
miscAdv : Agreement => Str } ;
@@ -94,15 +98,16 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
-- additional lexicon modules.
V,
-- TODO: eventually proper lincats
VV, -- verb-phrase-complement verb e.g. "want"
VS, -- sentence-complement verb e.g. "claim" -- TODO: VPs that have VS use waxa as stm? see Nilsson p. 68
VS, -- sentence-complement verb e.g. "claim"
-- TODO: eventually different lincats
VQ, -- question-complement verb e.g. "wonder"
VA, -- adjective-complement verb e.g. "look"
V2V, -- verb with NP and V complement e.g. "cause"
V2S, -- verb with NP and S complement e.g. "tell"
V2Q, -- verb with NP and Q complement e.g. "ask"
V2A = ResSom.Verb ; -- verb with NP and AP complement e.g. "paint"
V2A = ResSom.Verb ; -- verb with NP and AP complement e.g. "paint"
VV = ResSom.VV ; -- verb-phrase-complement verb e.g. "want"
V2 = ResSom.Verb2 ;
V3 = ResSom.Verb3 ;
@@ -119,7 +124,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
linref
-- Cl = linCl ;
VP = linVP VInf ;
VP = infVP ;
CN = linCN ;
Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ;
Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ++ prep.miscAdv ! Sg3 Masc ;
}

View File

@@ -38,14 +38,15 @@ lin
ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ;
--RS depends on gender and case, otherwise exactly like previous.
-- RS depends on state, gender and case, otherwise exactly like previous.
-- RS can modify CNs, which are open for state, number and case, and have inherent gender.
lincat
[RS] = {s1,s2 : Gender => Case => Str} ;
[RS] = {s1,s2 : State => Gender => Case => Str} ;
lin
BaseRS x y = twoTable2 Gender Case x y ;
ConsRS xs x = consrTable2 Gender Case comma xs x ;
ConjRS co xs = conjunctDistrTable2' Gender Case co xs ;
BaseRS = twoTable3 State GenNum Case ;
ConsRS = consrTable3 State GenNum Case comma ;
ConjRS = conjunctRSTable ;
{-
lincat
@@ -115,9 +116,16 @@ oper
-- Like conjunctTable from prelude/Coordination.gf,
-- but forces the first argument into absolutive.
conjunctNPTable : ConjDistr -> ({s1,s2 : Case => Str} ** BaseNP) -> {s : Case => Str ; st : State} = \co,xs -> xs **
{s = -- TODO if xs is a pronoun, make them use (pronTable ! xs.a).sp
table { cas => co.s1 ++ xs.s1 ! Abs ++ co.s2 ! xs.st ++ xs.s2 ! cas}} ;
conjunctNPTable : ConjDistr -> ({s1,s2 : Case => Str} ** BaseNP) -> NP = \co,xs -> lin NP (xs ** {
s = \\c => co.s1 ++ xs.s1 ! Abs ++ co.s2 ! xs.st ++ xs.s2 ! c
}) ;
conjunctRSTable : ConjDistr -> {s1,s2 : State => GenNum => Case => Str} -> RS = \co,xs -> lin RS (xs ** {
s = \\st,g,c => co.s1
++ xs.s1 ! st ! g ! c
++ co.s2 ! st
++ xs.s2 ! st ! g ! c
}) ;
np2objpron : NounPhrase -> NounPhrase = \np -> np ** {
s = objpron np

View File

@@ -6,7 +6,7 @@ concrete ExtendSom of Extend = CatSom
** open Prelude, ResSom in {
lin
-- : NP -> SSlash -> Utt ; -- her I love -- Sayeed p. 189-
-- : NP -> SSlash -> Utt ; -- her I love -- Saeed p. 189-
FocusObj np sslash = -- FIXME: preposition disappears in negative sentences
let ss = sslash.s ! False ;
ssSub = sslash.s ! True ; -- the negative particle is the same as subordinate, but verb forms come from main clause

View File

@@ -31,10 +31,16 @@ concrete IdiomSom of Idiom = CatSom ** open Prelude, ResSom, VerbSom in {
ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
-}
-- : VP -> VP ;
--ProgrVP vp = vp ** { } ;
ProgrVP vp = vp ** {
s = table {
VPres _ agr pol => vp.s ! VPres Progressive agr pol ;
VPast _ agr => vp.s ! VPast Progressive agr ;
VNegPast _ => vp.s ! VNegPast Progressive ;
x => vp.s ! x }
} ;
{- TODO: Sayeed p. 92 optative
{- TODO: Saeed p. 92 and 207, optative
-- : VP -> Utt ; -- let's go
ImpPl1 vp = { } ;

View File

@@ -1,5 +1,5 @@
concrete LexiconSom of Lexicon = CatSom **
open ParadigmsSom,ResSom in {
open ParadigmsSom, ResSom in {
----
-- A
@@ -33,7 +33,7 @@ lin big_A = mkA "weyn" ;
-- lin bike_N = mkN "" ;
lin bird_N = mkN "shimbir" fem ;
-- lin bite_V2 = mkV2 "" ;
-- lin black_A = mkA "" ;
lin black_A = mkA "madow" ;
-- lin blood_N = mkN "" ;
-- lin blow_V = mkV "" ;
-- lin blue_A = mkA "" ;
@@ -63,7 +63,7 @@ lin car_N = mkN "baabuur" masc ;
-- lin carpet_N = mkN "" ;
lin cat_N = mkN "bisad" ;
-- lin ceiling_N = mkN "" ;
-- lin chair_N = mkN "" ;
lin chair_N = mkN "kursi" ;
-- lin cheese_N = mkN "" ;
-- lin child_N = mkN "" ;
-- lin church_N = mkN "" ;
@@ -74,7 +74,7 @@ lin city_N = mkN "magaalo" ;
-- lin cloud_N = mkN "" ;
-- lin coat_N = mkN "" ;
-- lin cold_A = mkA "" ;
-- lin come_V = etorri_V ;
lin come_V = mkV "iman" ;
-- lin computer_N = mkN "" ;
-- lin correct_A = mkA "" ;
-- lin count_V2 = mkV2 "" ;
@@ -193,7 +193,7 @@ lin jump_V = mkV "bood" ;
-- lin knee_N = mkN "" ;
-- lin know_V2 = mkV2 "" ;
-- lin know_VQ = mkVQ "" ;
-- lin know_VS = mkVS "" ;
lin know_VS = mkV "ogaan" ; -- copula ** {sii = "og"} ;
----
@@ -211,7 +211,7 @@ lin language_N = mkN "af" ;
-- lin lie_V = mkV "" ;
-- lin like_V2 = mkV2 "" ;
-- lin listen_V2 = mkV2 "" ;
-- lin live_V = mkV "" ;
lin live_V = copula ** {sii = "nool"} ;
-- lin liver_N = mkN "" ;
-- lin long_A = mkA "" ;
-- lin lose_V2 = mkV2 "" ;
@@ -258,7 +258,7 @@ lin name_N = mkN "magac" ;
-- lin paris_PN = mkPN "Paris" ;
-- lin peace_N = mkN "" ;
-- lin pen_N = mkN "" ;
-- lin person_N = mkN "" ;
lin person_N = mkNoun "dad" "dadka" "dad" "dadka" Masc ;
-- lin planet_N = mkN "" ;
-- lin plastic_N = mkN "" ;
-- lin play_V = mkV "" ;
@@ -304,7 +304,7 @@ lin salt_N = mkN "cusbo" ;
-- lin school_N = mkN "" ;
-- lin science_N = mkN "" ;
-- lin scratch_V2 = mkV2 "" ;
-- lin sea_N = mkN "" ;
lin sea_N = mkN "bad" fem ;
lin see_V2 = mkV2 "ark" ;
-- lin seed_N = mkN "" ;
-- lin seek_V2 = mkV2 "" ;
@@ -312,7 +312,7 @@ lin see_V2 = mkV2 "ark" ;
-- lin send_V3 = mkV3 "" ;
-- lin sew_V = mkV "" ;
-- lin sharp_A = mkA "" ;
-- lin sheep_N = mkN "" ;
lin sheep_N = mkN "lax" fem ;
-- lin ship_N = mkN "" ;
-- lin shirt_N = mkN "" ;
-- lin shoe_N = mkN "" ;
@@ -397,7 +397,7 @@ lin wait_V2 = mkV2 "sug" ;
-- lin watch_V2 = mkV2 "" ;
lin water_N = mkNoun "biyo" "biyaha" "biyo" "biyaha" Masc ; -- ?? gender
-- lin wet_A = mkA "" ;
-- lin white_A = mkA "" ;
lin white_A = mkA "cad" ;
-- lin wide_A = mkA "" ;
-- lin wife_N = mkN "" ;
-- lin win_V2 = mkV2 "" ;

View File

@@ -23,12 +23,11 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- If cn has modifier, Nom ending attaches to the modifier
<_,Nom,True,_,_> => {nf=Def det.n ; c=Abs} ;
-- Definite
<_,_,False,Definite,n> => {nf=Def n ; c=c} ;
-- a Det with st=Indefinite uses Indef forms
<_,_,_,Indefinite,n> => {nf=Indef n ; c=c} ;
<_,_,False,Indefinite,n> => {nf=Indef n ; c=c} ;
_ => {nf=Def det.n ; c=c} -- TODO check
-- All other determiners use the definite stem
_ => {nf=Def det.n ; c=c}
} ;
art = gda2da cn.gda ! det.n ;
num = case det.isNum of {True => Sg ; _ => det.n} ;
@@ -42,7 +41,7 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
in dt.pref -- if det is numeral
++ cn.s ! nfc.nf
++ dt.s -- non-numeral det
++ cn.mod ! num ! c
++ cn.mod ! det.st ! num ! c
} ;
-- : PN -> NP ;
@@ -57,10 +56,20 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
UsePron pron = pron ** {st = Definite} ;
-- : Predet -> NP -> NP ; -- only the man
PredetNP predet np = np ** {
s = \\c => predet.s ++ np.s ! c ---- ?
} ;
PredetNP predet np =
let qnt = PossPron (pronTable ! np.a) ;
det = qnt.shortPoss ! predet.da ;
predetS : Str = case predet.isPoss of {
True => glue predet.s det ;
False => predet.s
} ;
in np ** {
s = \\c =>
case <np.isPron,predet.isPoss> of {
<True,True> => np.empty ++ predetS ;
_ => np.s ! c ++ predetS} ;
isPron = False ; -- NP it loses its pronoun status when Predet is added
} ;
-- A noun phrase can also be postmodified by the past participle of a
-- verb, by an adverb, or by a relative clause
@@ -73,9 +82,17 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- : NP -> Adv -> NP ; -- Paris today ; boys, such as ..
--AdvNP,ExtAdvNP = \np,adv -> np ** {} ; --adverbs are complicated
-- : NP -> RS -> NP ; -- Paris, which is here
-- : NP -> RS -> NP ; -- Paris, which is here
{- NB. technically, if the RS has undergone ConjRS, it could contain both
restrictive and appositive relative clauses. Quote Saeed p.215-216:
"When multiple relative clauses occur, this formal distinction is
maintained, since in the only context both can occur, on nouns with
determiners, restrictives are joined by ee while appositives employ oo."
In practice, we don't care--it's impossible to know on the RGL level
which RS are restrictive and which appositive, as it is semantic.
-}
RelNP np rs = np ** {
s = \\c => objpron np ! c ++ rs.s ! npgender np ! c ;
s = \\c => objpron np ! c ++ "oo" ++ rs.s ! Indefinite ! npgennum np ! c ;
isPron = False ;
} ;
@@ -90,8 +107,8 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- MassNP : CN -> NP ;
MassNP cn = useN cn ** {
s = table { Nom => cn.s ! NomSg ++ cn.mod ! Sg ! Nom ;
c => cn.s ! Indef Sg ++ cn.mod ! Sg ! c }
s = table { Nom => cn.s ! NomSg ++ cn.mod ! Indefinite ! Sg ! Nom ;
c => cn.s ! Indef Sg ++ cn.mod ! Indefinite ! Sg ! c }
} ;
@@ -113,7 +130,8 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- Independent form uses plural morpheme, not gender-flipped allomorph
<Pl,_> => num.s ! indep ++ quant.sp ! PlInv ! c ++ num.thousand } ;
isNum = num.isNum ;
n = num.n
n = num.n ;
shortPoss = \\da => quant.shortPoss ! da ++ num.s ! indep
} ;
-- d = case <num.isNum,quant.st> of {
-- <True,_> => Numerative ;
@@ -124,7 +142,8 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
DetQuantOrd quant num ord =
let theseFive = DetQuant quant num in theseFive ** {
s = \\g,c => theseFive.s ! g ! c ++ ord.s ;
sp = \\g,c => theseFive.sp ! g ! c ++ ord.s
sp = \\g,c => theseFive.sp ! g ! c ++ ord.s ;
shortPoss = \\da => theseFive.shortPoss ! da ++ ord.s
} ;
-- Whether the resulting determiner is singular or plural depends on the
@@ -170,7 +189,7 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
DefArt = defQuant "a" "kan" "tan" "kuwan" False ;
-- : Quant
IndefArt = indefQuant ** {sp = \\gn,c => "1"} ; -- TODO sp forms
IndefArt = indefQuant ; -- TODO sp forms
-- : Pron -> Quant
PossPron pron =
@@ -224,19 +243,20 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- : AP -> CN -> CN
AdjCN ap cn = cn ** {
s = table { NomSg => cn.s ! Indef Sg ; -- When an adjective is added, noun loses case marker.
x => cn.s ! x } ;
mod = \\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs
++ case cn.hasMod of {
True => "oo" ;
False => [] }
++ ap.s ! AF n c ;
x => cn.s ! x } ;
mod = \\st,n,c =>
cn.mod ! st ! n ! Abs -- If there was something before, it is now in Abs
++ andConj st cn.hasMod -- If the sentence is already modified, any new modifier needs to be introduced with conjunction
++ ap.s ! AF n c ;
hasMod = True
} ;
-- : CN -> RS -> CN ;
RelCN cn rs = cn ** {
mod = \\n,c => cn.mod ! n ! c ++ rs.s ! gender cn ! c ;
mod = \\st,n,c => --what to do with subject case if there's both adj and RS?
cn.mod ! st ! n ! Abs
++ andConj st cn.hasMod
++ rs.s ! st ! gennum cn Sg ! c ; -- gennum cn Sg, because plural form is only for 1st person plural
hasMod = True ;
} ;
@@ -263,7 +283,9 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
--2 Possessive and partitive constructs
-- : PossNP : CN -> NP -> CN ;
PossNP cn np = cn ** {mod = \\n,c => cn.mod ! n ! c ++ np.s ! Abs} ; -- guriga Axmed, not Axmed gurigiisa
PossNP cn np = cn ** { -- guriga Axmed, not Axmed gurigiisa
mod = \\st,n,c => cn.mod ! st ! n ! c ++ objpron np ! Abs
} ;
{-
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
PartNP cn np = cn ** { } ;
@@ -284,4 +306,12 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- : Det -> DAP ; -- this (or that)
DetDAP det = det ;
-}
oper
andConj : State -> Bool -> Str = \st,hasMod ->
case <st,hasMod> of {
<Indefinite,True> => "oo" ;
<Definite,True> => "ee" ;
_ => []
} ;
}

View File

@@ -29,6 +29,14 @@ oper
lincat
Digit = LinDigit ;
{- Saeed p. 70-71: "When used with nouns, the cardinal numerals act as
the head of the construction and the counted noun occurs in the genitive
case. […] This construction also occurs with composite numerals like
laba boqol 'two hundred',
where laba 'two' is a feminine noun in absolutive case and
boqol 'hundred' is a masculine noun in genitive case.
Since laba is head, the whole nominal is feminine." -}
Sub10, Sub100, Sub1000, Sub1000000 = {
s : DForm => Str ;
thousand : Str ; -- TODO figure out if this really works so
@@ -69,14 +77,14 @@ lin pot111 = {
s = \\_ => "koob iyo" ++ n1.ten.s ;
ord = "koob iyo" ++ n1.ten.ord ;
thousand = [] ;
da = M KA ; -- TODO check
da = M KA ;
n = Pl
} ;
lin pot1to19 d = {
s = \\_ => d.unit.s ! Kow ++ "iyo" ++ n1.ten.s ;
s = \\_ => d.unit.s ! Hal ++ "iyo" ++ n1.ten.s ;
thousand = [] ;
ord = d.unit.s ! Kow ++ "iyo" ++ n1.ten.ord ;
da = M KA ; -- TODO check
ord = d.unit.s ! Hal ++ "iyo" ++ n1.ten.ord ;
da = M KA ;
n = Pl
} ;
lin pot0as1 n = n ;
@@ -86,25 +94,24 @@ lin pot1 d = d.ten ** {
n = Pl
} ;
lin pot1plus d e = d.ten ** {
s = \\b => d.unit.s ! Kow ++ "iyo" ++ e.s ! b ;
ord = d.unit.s ! Kow ++ "iyo" ++ e.ord ; -- TODO check
s = \\b => e.s ! b ++ "iyo" ++ d.ten.s ;
ord = e.s ! Hal ++ "iyo" ++ d.ten.ord ;
thousand = [] ;
n = Pl ;
} ;
lin pot1as2 n = n ;
lin pot2 d = d ** {
thousand = "boqol" ; -- TODO check
ord = d.s ! Kow ++ "boqlaad"
} ; -- TODO what's the def. art. allomorph?
thousand = "boqol" ;
ord = d.s ! Hal ++ "boqlaad"
} ;
lin pot2plus d e = d ** {
s = \\b => d.s ! b ++ "boqol iyo" ++ e.s ! b ;
ord = d.ord ++ "boqol iyo" ++ e.ord ;
thousand = "boqol iyo" ++ e.s ! Hal ;
ord = d.s ! Hal ++ "boqol iyo" ++ e.ord ;
n = Pl} ;
lin pot2as3 n = n ;
lin pot3 n = n ** {
thousand = "kun" ;
ord = n.s ! Kow ++ "kunaad" ;
--da = M KA ; -- TODO check
thousand = n.thousand ++ "kun" ;
ord = n.s ! Hal ++ "kunaad" ;
n = Pl } ;
lin pot3plus n m = n ** {

View File

@@ -1,4 +1,4 @@
resource ParadigmsSom = open CatSom, ResSom, ParamSom, Prelude in {
resource ParadigmsSom = open CatSom, ResSom, ParamSom, NounSom, Prelude in {
oper
@@ -32,6 +32,12 @@ 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
waa_in : VVForm ; -- No explicit verb, just uses "waa in" construction
--2 Nouns
@@ -85,6 +91,12 @@ oper
mkV3 : V -> (_,_ : Preposition) -> V2 ; -- Already constructed verb with preposition
} ;
mkVV : overload {
mkVV : (kar : Str) -> VV ; -- VV that takes its complement in infinitive.
mkVV : (rab : Str) -> VVForm -> VV ; -- Specify complement type: infinitive or subjunctive.
mkVV : V -> VVForm -> VV ; -- VV out of an existing V
} ;
-- TODO: actual constructors
-- mkVA : Str -> VA = \s -> lin VA (mkVerb s) ;
--
@@ -104,17 +116,17 @@ oper
mkPrep = overload {
mkPrep : Str -> CatSom.Prep = \s ->
lin Prep ((ResSom.mkPrep s s s s s s) ** {
c2=noPrep ; sii,dhex,berri=[]}) ;
emptyPrep ** (ResSom.mkPrep s s s s s s) ; -- ** {
mkPrep : (x1,_,_,_,_,x6 : Str) -> CatSom.Prep = \a,b,c,d,e,f ->
lin Prep ((ResSom.mkPrep a b c d e f) ** {
c2=noPrep ; sii,dhex,berri=[]}) ;
emptyPrep ** (ResSom.mkPrep a b c d e f) ; --
mkPrep : Preposition -> CatSom.Prep = \p ->
lin Prep ((prep p) ** {sii,dhex,berri=[]}) ;
emptyPrep ** (prep p) ;
mkPrep : CatSom.Prep -> (x1,x2,x3 : Str) -> CatSom.Prep = \p,s,t,u ->
p ** {berri = s ; sii = t ; dhex = u} ;
} ;
possPrep : N -> CatSom.Prep ; -- Nouns like dhex that are used with possessive suffix to form adverbials
-- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num ->
-- lin Conj { s = s1 ; s2 = s2 } ;
@@ -125,7 +137,7 @@ oper
berri = s ;
c2 = noPrep ;
np = {s = [] ; a = P3_Prep} ;
sii,dhex = []
sii,dhex,miscAdv = []
} ;
mkAdV : Str -> AdV = \s -> lin AdV {s = s} ;
@@ -161,6 +173,11 @@ oper
la = ResSom.La ;
u = ResSom.U ;
noPrep = ResSom.NoPrep ;
VVForm = ResSom.VVForm ;
infinitive = Infinitive ;
subjunctive = Subjunctive ;
waa_in = Waa_In ;
------------------------
mkN = overload {
@@ -216,6 +233,36 @@ oper
mkV3 : (sug : Str) -> (_,_ : Preposition) -> V3 = \s,p,q -> lin V3 (regV s ** {c2 = p ; c3 = q}) ;
mkV3 : V -> (_,_ : Preposition) -> V2 = \v,p,q -> lin V3 (v ** {c2 = p ; c3 = q}) ;
} ;
mkVV = overload {
mkVV : (kar : Str) -> VV -- VV that takes its complement in infinitive.
= \kar -> lin VV ({vvtype=Infinitive} ** mkV kar) ;
mkVV : (rab : Str) -> VVForm -> VV -- Specify string and complement type:
= \rab,vvf -> lin VV ({vvtype=vvf} ** mkV rab) ;
mkVV : V -> VVForm -> VV
= \v,vvf -> lin VV (v ** {vvtype=vvf}) ;
mkVV : VVForm -> VV -- VV such as "waa in"
= \b -> let dummyV : V = mkV "in"
in lin VV (dummyV ** {vvtype=b ; s = \\_ => "in"})
} ;
possPrep : N -> CatSom.Prep = \dhex -> emptyPrep ** {
miscAdv = \\agr =>
let qnt = PossPron (pronTable ! agr) ;
num = getNum agr ;
art = gda2da dhex.gda ! Sg ;
det = qnt.s ! art ! Abs ; -- this includes BIND
in dhex.s ! Def Sg ++ det ;
isPoss = True
} ;
emptyPrep : CatSom.Prep = lin Prep {
sii,berri,dhex = [] ;
miscAdv = \\_ => [] ;
s = \\_ => [] ;
c2 = noPrep ;
isPoss = False
} ;
--------------------------------------------------------------------------------
}

View File

@@ -9,6 +9,8 @@ oper
vstar : pattern Str = #("a" | "e" | "i" | "o" | "u" | "y" | "w") ; -- semivowels included
vv : pattern Str = #("aa" | "ee" | "ii" | "oo" | "uu") ;
c : pattern Str = #("m"|"n"|"p"|"b"|"t"|"d"|"k"|"g"|"f"|"v"
|"s"|"h"|"l"|"j"|"r"|"z"|"c"|"q");
cstar : pattern Str = #("m"|"n"|"p"|"b"|"t"|"d"|"k"|"g"|"f"|"v" -- semivowels included
|"s"|"h"|"l"|"j"|"r"|"z"|"c"|"q"|"y"|"w");
lmnr : pattern Str = #("l" | "m" | "n" | "r") ;
kpt : pattern Str = #("k" | "p" | "t") ;
@@ -52,7 +54,7 @@ oper
} where {
allomF : Str -> DefTA = \wiilka ->
case wiilka of {
_ + "ta" => DA ; _ + "sha" => SHA ;
_ + "ta" => TA ; _ + "sha" => SHA ;
_ + "da" => DA ; _ + "dha" => DHA } ;
allomM : Str -> DefKA = \wiilka ->
case wiilka of {
@@ -154,7 +156,7 @@ oper
_ => Sg3 g } ;
getNum : Agreement -> Number = \a ->
case a of { Sg1|Sg2|Sg3 _ => Sg ; _ => Pl } ;
case a of { Sg1|Sg2|Sg3 _|Impers => Sg ; _ => Pl } ;
plAgr : Agreement -> Agreement = \agr ->
case agr of { Sg1 => Pl1 Excl ;
@@ -175,7 +177,7 @@ oper
Sg2_Prep => Sg2 ;
Pl1_Prep i => Pl1 i ;
Pl2_Prep => Pl2 ;
_ => Pl3
_ => Sg3 Masc
} ;
isP3 = overload {
@@ -188,8 +190,17 @@ oper
gender : {gda : GenderDefArt} -> Gender = \n ->
case n.gda of {FM _ _ => Fem ; _ => Masc} ;
npgender : {a : Agreement} -> Gender = \n ->
case n.a of {Sg3 Fem => Fem ; _ => Masc} ;
gennum : {gda : GenderDefArt} -> Number -> GenNum = \gda,n ->
case n of {Pl => PlInv ; Sg =>
case gda.gda of {FM _ _ => SgFem ; _ => SgMasc}
} ;
npgennum : {a : Agreement} -> GenNum = \n ->
case n.a of {
Sg2|Sg3 Fem => SgFem ;
Sg1|Sg3 Masc => SgMasc ;
_ => PlInv } ;
--------------------------------------------------------------------------------
-- Numerals
@@ -242,7 +253,7 @@ oper
--------------------------------------------------------------------------------
-- Verbs
-- Sayeed p. 84-85
-- Saeed p. 84-85
-- Tense: Past/Present/Future
-- Aspect: Simple/Progressive/Habitual
-- Mood: Declarative/Imperative/Conditional/Optative/Potential
@@ -271,9 +282,14 @@ param
| VPres Aspect VAgr Polarity
| VNegPast Aspect
| VPast Aspect VAgr
-- | VRelShort -- "som är/har/…" TODO is this used in other verbs?
| VRel Gender -- Reduced present general in relative clauses
| VImp Number Polarity ;
| VImp Number Polarity
| VRel GenNum {- Saeed p. 95-96 + ch 8
Reduced present general in relative clauses; as absolutive
1/2SG/3SG M/2PL/3PL suga (VRel MascSg)
3 SG F sugta (VRel FemSg)
1PL sugna (VRel PlInv) -}
| VRelNeg -- Saeed p. 211 have: lahayn, be: ahayni
| VNegCond GenNum ;
VAgr =
Sg1_Sg3Masc
@@ -284,6 +300,10 @@ param
PredType = NoPred | Copula | NoCopula ;
STM = Waa PredType | Waxa ;
VVForm = Infinitive | Subjunctive | Waa_In ;
oper
if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f ->
case p of {Pos => t ; Neg => f } ;
@@ -300,6 +320,17 @@ oper
Pl1 _ => Pl1_ ; Pl2 => Pl2_ ; Pl3 => Pl3_
} ;
isNeg : VForm -> Bool = \vf -> case vf of {
VNegPast _ => True ;
VNegCond _ => True ;
VRelNeg => True ;
VImp _ Neg => True ;
VPres _ _ Neg => True ;
_ => False
} ;
showSTM : STM -> Str = \stm -> case stm of {
Waxa => "waxa" ; Waa _ => "waa" } ;
--------------------------------------------------------------------------------
-- Clauses

View File

@@ -3,7 +3,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
lin
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
UttS s = let basecl = s.s ! False in {s = linBaseCl basecl} ;
UttS s = {s = s.s ! False} ;
UttQS qs = qs ;
UttImpSg pol imp =
@@ -17,7 +17,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
UttNP np = { s = np.s ! Abs} ;
UttVP vp = { s = infVP vp } ;
UttAdv adv = {s = linAdv adv} ;
UttCN n = {s = linCN n } ;
UttCN n = {s = linCN n} ;
UttCard n = {s = n.s ! Mid} ;
UttAP ap = { s = ap.s ! AF Sg Abs } ;
UttInterj i = i ;

View File

@@ -6,10 +6,17 @@ concrete QuestionSom of Question = CatSom ** open
lin
-- : Cl -> QCl ;
QuestCl cl = mergeQCl (cl.s ! Question) ;
QuestCl = cl2qcl ;
-- : IP -> VP -> QCl ;
-- QuestVP ip vp = ;
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
let clRaw : ClSlash = predVP ip vp ;
cl : ClSlash = clRaw ** {
stm = \\clt,p => case <clt,p> of {
<_,Pos> => "baa" ;
_ => clRaw.stm ! clt ! p }
}
in cl2qcl cl ;
-- : IP -> ClSlash -> QCl ; -- whom does John love
--QuestSlash ip cls = ;
@@ -36,7 +43,7 @@ concrete QuestionSom of Question = CatSom ** open
-- Interrogative quantifiers have number forms and can take number modifiers.
-- : IQuant -> Num -> IDet ; -- which (five)
--IdetQuant = NS.DetQuant ;
IdetQuant = NS.DetQuant ;
-- Interrogative adverbs can be formed prepositionally.
-- : Prep -> IP -> IAdv ; -- with whom

View File

@@ -6,31 +6,27 @@ lin
-- : Cl -> RCl ; -- such that John loves her
-- RelCl cl = {s = cl.s ! Subord} ;
{-
-- Sayeed p. 95-96 + ch 8
Reduced present general in relative clauses; as absolutive
1/2SG/3SG M/2PL/3PL sugá (VRel Masc)
3 SG F sugtá (VRel Fem)
1PL sugná -- not yet in the grammar
(18) (a) nimánka buugágga keená men-the books-the bring
'the men who bring the books'
(b) buugágga nimanku keenàan
books-the men-the bring 'the books which the men bring'
-}
-- : RP -> VP -> RCl ;
RelVP rp vp = {s = \\g,c,t,a,p =>
let cls = predVPSlash impersNP vp ;
rcl = mergeRCl (cls.s ! False) ; -- Other than present tense, just use normal verb forms
in rp.s ++ case <g,c,t,a,p> of {
<Fem,Abs,Pres,Simul,Pos> => linVP (VRel Fem) vp ;
<Masc,Abs,Pres,Simul,Pos> => linVP (VRel Masc) vp ;
_ => rcl.s ! t ! a ! p }
{- NB. this works because vfSubord only puts different forms from vfStatement
in Pres,Simul,Pos. RelVP needs a third set of forms in Abs,Pres,Simul,Pos,
called "reduced present general" (Saeed p. 95-96 + ch 8).
These forms are found in VRel in VP, and aren't chosen by predVP, so we put
them in manually in RelVP.
-}
RelVP rp vp = {s = \\gn,c,t,a,p =>
let cls = predVP impersNP vp ;
rclSubord = cl2rcl cls ;
rclStatement = cl2rclNom cls ;
in rp.s ++ case <gn,c,t,a,p> of {
<g,Abs,Pres,Simul,Pos> => linVP (VRel g) Subord vp ; -- reduced present only in absolutive
<_,Abs,Pres,Simul,Neg> => linVP VRelNeg Subord vp ; -- special form for have and be
<_,Nom,Pres,Simul,Pos> => rclStatement.s ! t ! a ! p ; -- as nominative, use the usual forms, not subordinate
_ => rclSubord.s ! t ! a ! p } -- the rest is Subord because of negation.
} ;
-- : RP -> ClSlash -> RCl ; -- whom John loves
RelSlash rp cls =
let rcl = mergeSTM True (cls.s ! True) -- in subordinate clause, STM is not included but subject pronoun is
let rcl = cl2relslash cls -- in subordinate clause, STM is not included but subject pronoun is
in rcl ** {s = \\g,c,t,a,p => rp.s ++ rcl.s ! t ! a ! p} ;

View File

@@ -13,13 +13,14 @@ oper
Noun3 : Type = Noun ;
CNoun : Type = Noun ** {
mod : Number => Case => Str ;
mod : State -- for conjunctions: oo for indef, ee for def
=> Number => Case => Str ;
hasMod : Bool ;
isPoss : Bool -- to prevent impossible forms in ComplN2 with Ns that have short possessive, e.g. "father"
} ;
cn2str : Number -> Case -> CNoun -> Str = \n,c,cn ->
cn.s ! Indef n ++ cn.mod ! n ! c ;
cn.s ! Indef n ++ cn.mod ! Indefinite ! n ! c ;
PNoun : Type = {s : Str ; a : Agreement} ;
@@ -154,23 +155,20 @@ oper
False => np.s} ;
useN : Noun -> CNoun ** BaseNP = \n -> n **
{ mod = \\_,_ => [] ; hasMod = False ;
{ mod = \\_,_,_ => [] ; hasMod = False ;
a = Sg3 (gender n) ; isPron,isPoss = False ;
empty = [] ; st = Indefinite
} ;
emptyNP : NounPhrase = {
s = \\_ => [] ;
a = Pl3 ;
a = Sg3 Masc ;
isPron = False ;
empty = [] ;
st = Indefinite
} ;
impersNP : NounPhrase = emptyNP ** {
a = Impers ;
isPron = True
} ;
impersNP : NounPhrase = pronTable ! Impers ;
--------------------------------------------------------------------------------
-- Pronouns
@@ -184,6 +182,18 @@ oper
sp : Case => Str ;
} ;
{- Saeed p.115: "This combination of possessive and article [kay-ga, tay-da]
is the basic form but possessives occur with the full range of determiners,
with associated meanings, for example:
remote article kii/tii: gurigaagii 'your house (remote)'
demonstrative kaas/taas: gurigaagaas 'that house of yours'
interrogative kee/tee: gurigaagee? 'which house of yours?'"
Since RGL abstract syntax doesn't allow combining two Quants, the way to go is
to have another Pron -> Quant function in Extra, which forms Quants such as
-gaagii, -gaagaas, -gaagee.
-}
pronTable : Agreement => Pronoun = table {
Sg1 => {
s = table {Nom => "aan" ; Abs => "i"} ;
@@ -234,10 +244,10 @@ oper
poss = {s, short = quantTable "ood" ; sp = gnTable "ood" "ood" "uwood"}
} ;
Impers => {
s = table {Nom => "la" ; Abs => "la"} ;
s = \\_ => [] ; -- the string `la' comes from Passive (: PrepCombination)
a = Impers ; isPron = True ; sp = \\_ => "" ;
empty = [] ; st = Definite ;
poss = {s, short = quantTable "??" ; sp = gnTable "??" "??" "??"}
poss = {s, short = quantTable "iis" ; sp = gnTable "iis" "iis" "uwiis"}
}
} ;
@@ -290,7 +300,7 @@ oper
} ;
Numeral : Type = BaseNum ** {
ord : Str -- whether to choose Numerative as the value of NForm
ord : Str
} ;
baseQuant : BaseQuant = {
@@ -316,6 +326,12 @@ oper
st = Definite ;
} ;
defIQuant : Str -> Quant = \ee ->
let quantRaw = defQuant ee ("k"+ee) ("t"+ee) ("kuw"+ee) False
in quantRaw ** {
s = \\da,c => quantRaw.s ! da ! Abs ;
sp = \\gn,c => quantRaw.sp ! gn ! Abs } ;
gnTable : (m,f,p : Str) -> (GenNum => Str) = \m,f,p ->
table {SgMasc => m ; SgFem => f ; _ => p} ;
@@ -453,14 +469,15 @@ oper
BaseVerb : Type = {
s : VForm => Str ;
} ;
Verb : Type = BaseVerb ** {
sii : Str ; -- closed class of particles: sii, soo, kala, wada (Sayeed 171)
sii : Str ; -- closed class of particles: sii, soo, kala, wada (Saeed 171)
dhex : Str ; -- closed class of adverbials: hoos, kor, dul, dhex, …
isCopula : Bool ;
} ;
Verb2 : Type = Verb ** {c2 : Preposition} ;
Verb3 : Type = Verb2 ** {c3 : Preposition} ;
VV : Type = Verb ** {vvtype : VVForm} ;
-- Saeed page 79:
-- "… the reference form is the imperative singular form
@@ -523,7 +540,7 @@ oper
VPres Progressive Pl3_ pol => progr + "aan" ;
VPast Simple Sg1_Sg3Masc
=> qaat + ay ;
=> qaat + ay ;
VPast Simple Sg2_Sg3Fem => arag + t + ay ; -- t, d or s
VPast Simple Pl1_ => arag + n + ay ;
VPast Simple Pl2_ => arag + t + "een" ; -- t, d or s
@@ -539,6 +556,10 @@ oper
VNegPast Simple => arkin ;
VNegPast Progressive => progr + "n" ;
-- TODO check conjugations 2 and 3
VNegCond PlInv => arag + n + "een" ;
VNegCond SgMasc => qaat + "een" ; -- for most verbs same as VPast Simple Pl3_
VNegCond SgFem => arag + t + "een" ; -- for most verbs same as VPast Simple Pl2_
VImp Sg Pos => arag ;
VImp Pl Pos => qaat + "a" ;
@@ -546,10 +567,14 @@ oper
VImp Pl Neg => qaat + "ina" ;
VInf => arki ;
-- VRelShort => arki ; -- TODO does this exist?
VRel Masc => qaat + "a" ;
VRel Fem => arag + t + "a" } ;
VRel SgMasc => qaat + "a" ;
VRel SgFem => arag + t + "a" ;
VRel PlInv => arag + "na" ;
VRelNeg => qaat + "o" -- TODO check
} ;
sii, dhex = [] ;
isCopula = False ;
} ;
-------------------------
@@ -611,14 +636,18 @@ oper
VPast _ Pl2_ => "ahaydeen" ;
VPast _ Pl3_ => "ahaayeen" ;
VNegPast _ => "ahi" ;
--VRelShort => "ah" ;
VRel _ => "ah" ; -- TODO find right forms
VNegCond SgMasc => "ahaadeen" ; -- 1SG/3 SG M/3PL
VNegCond SgFem => "ahaateen" ; -- 2SG/3 SG F/2PL
VNegCond PlInv => "ahaanneen" ; -- 1PL
VRel _ => "ah" ; -- All persons: see Nilsson p. 78. TODO check Saeed p. 103
VRelNeg => "ahayni" ; -- Saeed
VInf => "ahaan" ;
VImp Sg pol => if_then_Pol pol "ahaw" "ahaanin" ;
VImp Pl pol => if_then_Pol pol "ahaada" "ahaanina" ;
VPres _ _ _ => nonExist -- use presCopula instead
} ;
sii, dhex = []
sii, dhex = [] ;
isCopula = True
} ;
have_V : Verb =
@@ -629,30 +658,30 @@ oper
VPres _ Pl1_ Pos => "leenahay" ;
VPres _ Pl2_ Pos => "leedihiin" ;
VPres _ Pl3_ Pos => "leeyihiin" ;
VPast asp agr => "l" + copula.s ! VPast asp agr ;
-- VRelShort => "leh" ;
VRel _ => "leh" ; -- TODO find right forms
VPres _ Sg1_Sg3Masc Neg => "lihi" ;
VPres _ Sg2_Sg3Fem Neg => "lihid" ;
VPres _ Pl1_ Neg => "lihin" ;
VPres _ Pl2_ Neg => "lihidin" ;
VPres _ Pl3_ Neg => "laha" ;
VNegPast _ => "lahayn" ;
VPast asp agr => "l" + copula.s ! VPast asp agr ;
VNegCond agr => "l" + copula.s ! VNegCond agr ;
VRel _ => "leh" ; -- All persons: see Nilsson p. 78
VRelNeg => "lahayn" ;
x => hold_V.s ! x }
} ;
-- Till VERBFRASEN ansluter sig
-- · satstypsmarkörer (waa, ma...),
-- · subjekts-pronomenet la man,
-- · objektspronomenen,
-- · prepositionerna och
-- · riktnings-adverben soó (mot en plats/person), sií (bort frånen plats/person), wadá tillsammans (mot en gemensam punkt), kalá iväg, isär (bort från en gemensam punkt).
-- Riktningsadverben har ibland en mycket konkret betydelse, men många gånger är betydelsen mera abstrakt.
-- Till satsmarkörerna, dvs. både fokusmarkörerna och satstypsmarkörerna ansluter sig
-- subjektspronomenen aan, aad, uu, ay, aynu, men inte la (man).
------------------
-- VP
BaseAdv : Type = {
sii, -- sii, soo, wala, kada go inside VP.
dhex, -- dhex, hoos, koor, dul, … go inside VP.
berri : Str -- e.g. "tomorrow"; goes before VP.
berri, -- AdV, e.g. "tomorrow"; goes before VP.
miscAdv : Str -- dump for any other kind of adverbial.
} ;
Adverb : Type = BaseAdv ** {
@@ -662,23 +691,29 @@ oper
Complement : Type = {
comp : Agreement => {p1,p2 : Str} ; -- Agreement for AP complements
pred : PredType ; -- to choose right sentence type marker and copula
stm : STM ; -- to choose right sentence type marker
} ;
VerbPhrase : Type = BaseVerb ** Complement ** BaseAdv ** {
c2 : PrepCombination ; -- Prepositions can combine together and with object pronoun.
obj2 : NPLite ; -- {s : Str ; a : PrepAgr}
secObj : Str ; -- if two overt pronoun objects
vComp : Str ; -- VV complement
miscAdv : Str ; -- dump for any other kind of adverb, that isn't
} ; -- in a closed class of particles or made with PrepNP.
vComp : {subjunc : Str ; -- "waa in" or subjunctive construction: "in" is placed here
inf : Str ; -- auxiliary VV with infinitive argument
subcl : Agreement => Str} -- VV complement if it's a subordinate clause
} ;
VPSlash : Type = VerbPhrase ;
useV : Verb -> VerbPhrase = \v -> v ** {
comp = \\_ => <[],[]> ;
pred = NoPred ;
vComp,berri,miscAdv,refl = [] ;
stm = case v.isCopula of { -- can change into Waxa in ComplVV
True => Waa Copula ;
False => Waa NoPred
} ;
vComp = {subjunc, inf = [] ;
subcl = \\_ => []} ;
berri,miscAdv = [] ;
c2 = Single NoPrep ;
obj2 = {s = [] ; a = P3_Prep} ;
secObj = []
@@ -692,7 +727,7 @@ oper
c2 = combine v3.c2 v3.c3 ;
} ;
passV2 : Verb2 -> VerbPhrase = \v2 -> passVP (useV v2) ;
passV2 : Verb2 -> VerbPhrase = \v2 -> passVP (useVc v2) ;
passVP : VerbPhrase -> VerbPhrase = \vp -> vp ** {
c2 = case vp.c2 of {
@@ -719,9 +754,9 @@ oper
} ;
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
insertCompAgrPlus vp (nplite np) ;
insertCompLite vp (nplite np) ;
insertCompAgrPlus : VPSlash -> NPLite -> VerbPhrase = \vp,nplite ->
insertCompLite : VPSlash -> NPLite -> VerbPhrase = \vp,nplite ->
case vp.obj2.a of {
-- If the old object is 3rd person (or nonexistent), we replace its agreement.
-- We keep both old and new string (=noun, if there was one) in obj2.s.
@@ -745,122 +780,235 @@ oper
NoPrep => vp ** adv'' ; -- the adverb is not formed with PrepNP, e.g. "tomorrow"
_ => case vp.c2 of {
-- if free complement slots, introduce adv.np with insertComp
Single NoPrep => insertCompAgrPlus (vp ** {c2 = Single adv.c2}) adv.np ** adv' ;
Single p => insertCompAgrPlus (vp ** {c2 = combine p adv.c2}) adv.np ** adv' ;
Single NoPrep => insertCompLite (vp ** {c2 = Single adv.c2}) adv.np ** adv' ;
Single p => insertCompLite (vp ** {c2 = combine p adv.c2}) adv.np ** adv' ;
-- if complement slots are full, just insert strings.
_ => vp ** adv''
}
} where {
adv' : {sii,dhex,berri : Str} = { -- adv.np done with insertComp
adv' : {sii,dhex,berri,miscAdv : Str} = { -- adv.np done with insertComp
sii = vp.sii ++ adv.sii ;
dhex = vp.dhex ++ adv.dhex ;
berri = vp.berri ++ adv.berri } ;
berri = vp.berri ++ adv.berri ;
miscAdv = vp.miscAdv ++ adv.miscAdv} ;
adv'' : {sii,dhex,berri,miscAdv : Str} -- adv.np inserted into miscAdv
= adv' ** {dhex = (prepTable ! adv.c2).s ! adv.np.a ++ adv.dhex ;
miscAdv = adv.np.s}
miscAdv = adv.miscAdv ++ adv.np.s}
} ;
--------------------------------------------------------------------------------
-- Sentences etc.
BaseCl : Type = {beforeSTM, stm, afterSTM : Str} ; -- adverbs, subjects, all that comes before sentence type marker. Eventual Subj attaches to the part after STM.
Clause : Type = {s : ClType => Tense => Anteriority => Polarity => BaseCl} ;
ClSlash : Type = {s : Bool {-is subordinate-} => Tense => Anteriority => Polarity => BaseCl} ;
Sentence : Type = {s : Bool {-is subordinate-} => BaseCl} ;
RClause : Type = {s : Gender => Case => Tense => Anteriority => Polarity => Str} ;
QClause : Type = {s : Tense => Anteriority => Polarity => Str} ;
mergeQCl : (Tense => Anteriority => Polarity => BaseCl) -> QClause = mergeSTM True ;
mergeRCl : (Tense => Anteriority => Polarity => BaseCl) -> QClause = mergeSTM False ;
mergeSTM : Bool -> (Tense => Anteriority => Polarity => BaseCl) -> QClause = \includeSTM,b ->
{s = \\t,a,p => (b ! t ! a ! p).beforeSTM
++ if_then_Str includeSTM (b ! t ! a ! p).stm []
++ (b ! t ! a ! p).afterSTM
{- After PredVP, we might still want to add more adverbs (QuestIAdv),
but we're done with verb inflection.
-}
ClSlash : Type = BaseAdv ** {
-- Fixed in Cl
subj : {noun, pron : Str ; isP3 : Bool} ; -- noun and subject pronoun if applicable
obj2 : NPLite ;
secObj : Str ;
c2 : PrepCombination ; -- NB. QuestIAdv can add more prepositions
comp : {p1,p2 : Str} ;
vComp : {inf,subcl,subjunc : Str} ;
-- Still open
pred : ClType => Tense => Anteriority => Polarity => Str ;
stm : ClType => Polarity => Str
} ;
predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps ->
let cl = predVP np vps in {s = table {
True => cl.s ! Subord ;
False => cl.s ! Statement }
} ;
Clause : Type = {s : Tense => Anteriority => Polarity => Str} ;
QClause = Clause ;
RClause : Type = {s : GenNum => Case => Tense => Anteriority => Polarity => Str} ;
Sentence : Type = {s : Bool {-is subordinate-} => Str} ;
predVP : NounPhrase -> VerbPhrase -> Clause = \np,vps -> {
s = \\cltyp,t,a,p =>
let predRaw : {fin : Str ; inf : Str} = vf cltyp t a p subj.a vp ;
pred : {fin : Str ; inf : Str} = case <cltyp,p,vp.pred> of {
<Statement,Pos,NoCopula> => {fin,inf = []} ;
<_ , _, Copula> => {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ;
_ => predRaw
predVPslash = predVP ; -- Cl and ClSlash are the same category
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vps -> vp ** {
subj = {noun = subjnoun ; pron = subjpron ; isP3 = isP3 subj.a} ;
pred = \\cltyp,t,a,p =>
let predRaw = vf cltyp t a p subj.a vp ;
in case <cltyp, p, t, vp.stm, subj.a> of {
<Statement, Pos, Pres, Waa NoCopula, Sg3 _|Pl3> -- VP comes from CompNP/CompCN + P3 subject
=> [] ;
<_, _, Pres, Waa (Copula|NoCopula), _> -- Comp* present tense + any subject
=> presCopula ! {agr=subj.a ; pol=p} ;
_ => predRaw -- Any other verb
} ;
subjnoun : Str = if_then_Str np.isPron np.empty (subj.s ! Nom) ;
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ;
obj : {p1,p2 : Str} =
let o : {p1,p2 : Str} = vp.comp ! subj.a ;
bind : Str = case <isPassive vp,vp.obj2.a, vp.c2, vp.pred> of {
<False,P3_Prep,Single NoPrep,NoPred> => [] ;
_ => BIND } ;
in case <cltyp,p> of {
<Statement,Neg> => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} ;
_ => o
-- object pronoun, prepositions and negation all contract
} ;
stm : {p1,p2 : Str} = case cltyp of {
Subord => {p1 = if_then_Pol p [] "aan" ; -- if we form a ClSlash, no sentence type marker; negation with aan (Sayeed p. 210)
p2 = if_then_Pol p subjpron []} ;
Question => {p1 = "ma" ; p2 = []} ; -- TODO find out how negative questions work
Statement => case <p,vp.pred,subj.a> of {
<Pos,Copula|NoCopula,Sg3 _|Impers> => {p1 = "waa" ; p2 = []} ;
_ => stmarkerNoContr ! subj.a ! p }} ;
in (wordOrder subjnoun subjpron stm obj pred vp) ;
} where {
vp = case isPassive vps of {
True => complSlash (insertComp vps np) ;
_ => complSlash vps } ;
subj = case isPassive vps of {True => impersNP ; _ => np}
stm = \\cltyp,pol =>
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 ;
vComp = vp.vComp ** {
subcl = vp.vComp.subcl ! subj.a
}
} where {
vp : VerbPhrase = case isPassive vps of {
True => insertComp vps np ;
_ => vps } ;
subj : NounPhrase = case isPassive vps of {
True => impersNP ;
_ => np } ;
subjnoun : Str = case np.isPron of {
True => np.empty ;
False => subj.s ! Nom
} ;
subjpron : Str = case <vp.stm,subj.a> of {
<Waa (Copula|NoCopula),Pl3|Sg3 _|Impers>
=> np.empty ;
_ => (pronTable ! subj.a).s ! Nom
}
} ;
wordOrder : (sn,sp : Str) -> (stm,obj : {p1,p2 : Str}) -> {fin,inf : Str} -> VerbPhrase -> BaseCl =
\subjnoun,subjpron,stm,obj,pred,vp -> {
beforeSTM = vp.berri -- AdV
++ subjnoun -- subject if it's a noun
++ obj.p1 ; -- object if it's a noun
stm = stm.p1 ; -- sentence type marker
afterSTM = stm.p2 -- possible subj. pronoun
++ obj.p2 -- object if it's a pronoun
++ vp.sii -- restricted set of particles
++ vp.dhex -- restricted set of nouns/adverbials
++ vp.secObj -- "second object"
++ vp.vComp -- VV complement
++ pred.inf -- potential infinitive/participle
++ pred.fin -- the verb inflected
++ vp.miscAdv } ; ---- NB. Only used if there are several adverbs.
---- Primary places for adverbs are obj, sii or dhex.
-- just like complSlash but for Cl
complCl : ClSlash -> ClSlash = \cl -> let np = cl.obj2 in cl ** {
comp = {p1 = np.s ++ cl.comp.p1 ;
p2 = cl.comp.p2 ++ prepCombTable ! np.a ! cl.c2}
} ;
VFun : Type = Tense -> Anteriority -> Polarity -> Agreement -> Verb
-> {fin : Str ; inf : Str} ;
-- RelVP: subject pronoun is never included
cl2rcl : ClSlash -> Clause =
let hasSubjPron : Bool = False ;
hasSTM : Bool = False ;
isRel : Bool = True ;
in wordOrder Subord isRel hasSubjPron hasSTM ;
-- No subject pronoun, no STM, but use verb forms from Statement
cl2rclNom : ClSlash -> Clause = \cls ->
let hasSubjPron : Bool = False ;
hasSTM : Bool = False ;
isRel : Bool = True ;
in wordOrder Statement isRel hasSubjPron hasSTM cls ;
-- RelSlash: subject pronoun is included if it's not 3rd person
-- TODO check this rule with more example sentences
cl2relslash : ClSlash -> Clause =
let hasSubjPron : Bool = True ;
hasSTM : Bool = False ;
isRel : Bool = True ;
in wordOrder Subord isRel hasSubjPron hasSTM ;
-- Question clauses: subject pronoun not included, STM is
cl2qcl : ClSlash -> Clause =
let hasSubjPron : Bool = False ;
hasSTM : Bool = True ;
isRel : Bool = False ;
in wordOrder Question isRel hasSubjPron hasSTM ;
-- Sentence: include subject pronoun and STM.
-- When subordinate, include "in".
cl2sentence : Bool -> ClSlash -> Clause = \isSubord,cls -> {
s = \\t,a,p =>
let cltyp : ClType = case isSubord of {
True => Subord ;
False => Statement } ;
cl : ClSlash = case isSubord of { -- add "in" to the clause if used as subordinate
True => cls ** {vComp = cls.vComp ** {subjunc = "in"}} ;
False => cls } ;
sent = wordOrder cltyp False True True cl
in sent.s ! t ! a ! p
} ;
wordOrder : ClType -> (rel,sp,stm : Bool) -> ClSlash -> Clause = \cltyp,isRel,hasSubjPron,hasSTM,incomplCl -> {
s = \\t,a,p =>
let -- Put all arguments in their right place
cl : ClSlash = complCl incomplCl ;
-- Contractions
bind : Str = case <isPassive cl, cl.obj2.a, cl.c2> of {
<False,P3_Prep,Single NoPrep> => [] ; -- nothing to attach to the STM
_ => BIND } ; -- something to attach, use BIND
obj : {p1,p2 : Str} = case <cltyp,p> of {
<Statement,Neg> -- object pronoun and prepositions contract with negation
=> {p2 = [] ; p1 = cl.comp.p1 ++ cl.comp.p2 ++ bind} ;
_ => cl.comp } ;
-- Placement of object noun varies depending on type of clause
statementNounObj = case cltyp of {
Statement => obj.p1 ;
_ => [] } ;
subordNounObj = case cltyp of {
Subord => obj.p1 ;
_ => [] } ;
questionNounObj = case cltyp of {
Question => obj.p1 ;
_ => [] } ;
-- Control whether to include subject pronoun and STM
subjpron : Str = case <hasSubjPron,p,cl.subj.isP3,isRel> of {
<True,Pos,True,True> => [] ;
<True,Pos,_,_> => cl.subj.pron ;
_ => [] } ;
stm : Str = case <hasSTM,p> of {
<True,_> => cl.stm ! cltyp ! p ;
<_,Neg> => cl.stm ! cltyp ! p ; -- negation overrides hasSTM=False
_ => [] }
in cl.berri -- AdV
++ cl.subj.noun -- subject if it's a noun
++ statementNounObj -- noun object if it's a statement
++ stm
++ cl.vComp.subjunc -- "waa in" construction /
++ subjpron -- subject pronoun
++ subordNounObj -- noun object if it's subordinate clause: "timir aan /laf/ lahayn" (Saeed p. 210-211)
++ obj.p2 -- object if it's a pronoun
++ cl.sii -- restricted set of particles
++ cl.dhex -- restricted set of nouns/adverbials
++ cl.secObj -- "second object"
++ cl.vComp.inf -- VV complement, if it's infinitive
++ cl.pred ! cltyp ! t ! a ! p -- the inflecting verb
++ questionNounObj -- noun object if it's a question
++ cl.vComp.subcl -- VV complement, if it's subordinate clause
++ cl.miscAdv ---- NB. Only used if there are several adverbs, or for "waa in" construction.
} ; ---- Primary places for adverbs are obj, sii or dhex.
VFun : Type = Tense -> Anteriority -> Polarity -> Agreement -> BaseVerb
-> Str ;
vf : ClType -> VFun = \clt -> case clt of {
Subord => vfSubord ; _ => vfStatement } ;
vfStatement : VFun = \t,ant,p,agr,vp ->
case <t,ant> of {
<Pres,Simul> => {fin = presV vp ; inf = [] } ;
<Past,Simul> => {fin = pastV vp ; inf = [] } ;
<Pres,Anter> => {fin = presCopula ! agrPol ; inf = vp.s ! VInf } ; ---- just guessing
<Past,Anter> => {fin = pastV (cSug "jir") ; inf = vp.s ! VInf} ;
<Fut,Simul> => {fin = presV (cSug "doon") ; inf = vp.s ! VInf} ;
<Fut,Anter> => {fin = pastV (cSug "doon") ; inf = vp.s ! VInf} ;
<Cond,Simul> => {fin = pastV have_V ; inf = vp.s ! VInf} ; -- TODO check
<Cond,Anter> => {fin = pastV have_V ; inf = vp.s ! VInf} -- TODO check
case <t,ant,p> of {
<Cond,_,Pos> => vp.s ! VInf ++ pastV have_V ;
<Cond,_,Neg> => condNegV vp ;
<Pres,Simul> => presV vp ;
<Past,Simul> => pastV vp ;
<Pres,Anter> => vp.s ! VInf ++ presCopula ! agrPol ; ---- just guessing
<Past,Anter> => vp.s ! VInf ++ pastV (cSug "jir") ;
<Fut,Simul> => vp.s ! VInf ++ presV (cSug "doon") ;
<Fut,Anter> => vp.s ! VInf ++ pastV (cSug "doon")
}
where {
agrPol : {agr:Agreement ; pol:Polarity} = {agr=agr; pol=p} ;
pastV : Verb -> Str = \v ->
pastV : BaseVerb -> Str = \v ->
case p of { Neg => v.s ! VNegPast Simple ;
Pos => v.s ! VPast Simple (agr2vagr agr) } ;
presV : Verb -> Str = \v -> v.s ! VPres Simple (agr2vagr agr) p ;
} ;
presV : BaseVerb -> Str = \v -> v.s ! VPres Simple (agr2vagr agr) p ;
condNegV : BaseVerb -> Str = \v -> case agr of {
Sg2|Sg3 Fem
|Pl2 => v.s ! VNegCond SgFem ;
Pl1 _ => v.s ! VNegCond PlInv ;
_ => v.s ! VNegCond SgMasc --Sg1|Sg3 Masc|Pl3|Impers
}
} ;
vfSubord : VFun = \t,ant,p,agr,vp ->
case <t,ant,p> of {
@@ -868,17 +1016,22 @@ oper
_ => vfStatement t ant p agr vp
} ; -- TODO other relative forms
infVP : VerbPhrase -> Str = linVP VInf ;
infVP : VerbPhrase -> Str = linVP VInf Statement ;
stmarkerContr : Agreement => Polarity => Str = \\a,b =>
waaContr : Agreement => Polarity => Str = \\a,b =>
let stm = if_then_Pol b "w" "m"
in stm + subjpron ! a ;
stmarkerNoContr : Agreement => Polarity => {p1,p2 : Str} = \\a,p =>
waaNoContr : Agreement => Polarity => {p1,p2 : Str} = \\a,p =>
case p of {
Pos => {p1 = "waa" ; p2 = subjpron ! a} ;
Neg => {p1 = "ma" ; p2 = []} } ;
waxaNoContr : Agreement => Polarity => {p1,p2 : Str} = \\a,p =>
case p of {
Pos => {p1 = "waxa" ; p2 = subjpron ! a} ;
Neg => {p1 = "ma" ; p2 = []} } ; -- TODO: find out how to properly negate waxa clauses!
subjpron : Agreement => Str = table {
Sg1|Pl1 Excl => "aan" ;
Pl1 Incl => "aynu" ;
@@ -891,19 +1044,52 @@ oper
-- linrefs
oper
linVP : VForm -> VerbPhrase -> Str = \vf,vp ->
let vp' = complSlash vp ;
inf = {inf = vp.s ! vf ; fin=[]} ;
wo = wordOrder [] [] {p1,p2=[]} (vp'.comp ! pagr2agr vp.obj2.a) inf vp' ;
in wo.beforeSTM ++ wo.afterSTM ;
linVP : VForm -> ClType -> VerbPhrase -> Str = \vf,cltyp,vp ->
let pred = vp.s ! vf ;
vp' = complSlash vp ;
stm = case <cltyp,isNeg vf> of {
<Subord,True> => {p1 = "aan" ; p2 = []} ;
_ => {p1,p2 = []}
} ;
wo = wordOrderOld (Sg3 Masc) [] stm (vp'.comp ! pagr2agr vp.obj2.a) pred vp' cltyp ;
in wo.beforeSTM ++ wo.stm ++ wo.afterSTM ;
linCN : CNoun -> Str = \cn -> cn.s ! NomSg ++ cn.mod ! Sg ! Abs ;
linCN : CNoun -> Str = \cn -> cn.s ! Indef Sg ++ cn.mod ! Indefinite ! Sg ! Abs ;
linAdv : Adverb -> Str = \adv ->
adv.berri
++ adv.sii
++ (prepTable ! adv.c2).s ! adv.np.a
++ adv.dhex
++ adv.np.s ;
++ adv.np.s
++ adv.miscAdv ;
linBaseCl : BaseCl -> Str = \b -> b.beforeSTM ++ b.stm ++ b.afterSTM ;
-- TODO: deprecate eventually
BaseCl : Type = {beforeSTM, stm, afterSTM : Str} ; -- adverbs, subjects, all that comes before sentence type marker. Eventual Subj attaches to the part after STM.
wordOrderOld : Agreement -> (sn : Str) -> (stm,obj : {p1,p2 : Str}) -> Str -> VerbPhrase -> ClType -> BaseCl =
\agr,subjnoun,stm,obj,pred,vp,cltyp -> {
beforeSTM = vp.berri -- AdV
++ subjnoun -- subject if it's a noun
++ case cltyp of {
Subord => [] ;
_ => obj.p1 } ; -- noun object if it's a statement
stm = stm.p1 ; -- sentence type marker; empty if subordinate and positive
afterSTM = vp.vComp.subjunc -- "waa in" construction
++ stm.p2 -- possible subj. pronoun
++ case cltyp of {
Subord => obj.p1 ; -- noun object if it's subordinate clause
_ => [] }
++ obj.p2 -- object if it's a pronoun
++ vp.sii -- restricted set of particles
++ vp.dhex -- restricted set of nouns/adverbials
++ vp.secObj -- "second object"
++ vp.vComp.inf -- VV complement, if it's infinitive
++ pred -- the verb inflected
++ vp.vComp.subcl ! agr -- VV complement, if it's subordinate clause
++ vp.miscAdv } ; ---- NB. Only used if there are several adverbs, or for "waa in" construction.
}

View File

@@ -10,12 +10,12 @@ lin
-- : NP -> VP -> Cl
PredVP = predVP ;
-- : SC -> VP -> Cl ; -- that she goes is good (Sayeed p. 94)
-- : SC -> VP -> Cl ; -- that she goes is good (Saeed p. 94)
--PredSCVP sc vp = ;
--2 Clauses missing object noun phrases
-- : NP -> VPSlash -> ClSlash ;
SlashVP = predVPSlash ;
SlashVP = predVP ;
{-
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv = cls ** insertAdv adv cls ;
@@ -27,9 +27,9 @@ lin
-}
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
UseSlash t p cls = {s = \\b =>
let sent = cls.s ! b ! t.t ! t.a ! p.p in
sent ** {beforeSTM = t.s ++ p.s ++ sent.beforeSTM}
UseSlash t p cls = {
s = \\isSubord => let cl = cl2sentence isSubord cls in
t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p
} ;
--2 Imperatives
@@ -52,17 +52,16 @@ lin
-}
-- : Temp -> Pol -> Cl -> S ;
UseCl t p cl = {s = \\b =>
let cltyp = if_then_else ClType b Subord Statement ;
sent = cl.s ! cltyp ! t.t ! t.a ! p.p in
sent ** {beforeSTM = t.s ++ p.s ++ sent.beforeSTM} ;
UseCl t p cls = {
s = \\isSubord => let cl = cl2sentence isSubord cls in
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} ;
-- : Temp -> Pol -> RCl -> RS ;
UseRCl t p cl = {s = \\g,c => t.s ++ p.s ++ cl.s ! g ! c ! t.t ! t.a ! p.p} ;
UseRCl t p cl = {s = \\st,g,c => t.s ++ p.s ++ cl.s ! g ! c ! t.t ! t.a ! p.p} ;
-- AdvS : Adv -> S -> S ; -- then I will go home
-- ExtAdvS : Adv -> S -> S ; -- next week, I will go home
@@ -77,7 +76,8 @@ lin
oper
advS : Adverb -> S -> S = \a,s -> s ** {s = \\b => let ss = s.s ! b in
ss ** {beforeSTM = linAdv a ++ ss.beforeSTM}} ;
advS : Adverb -> S -> S = \a,sent -> sent ** {
s = \\b => sent.s ! b ++ linAdv a
} ;
}

View File

@@ -51,27 +51,45 @@ lin or_Conj = {s2 = \\_ => "ama" ; s1 = [] ; n = Sg} ; -- mise with interrogativ
-----------------
-- *Det and Quant
--lin how8many_IDet = R.indefDet "" pl ;
lin all_Predet = {s = "giddi" ; isPoss = True ; da = M GA} ;
--lin not_Predet = { s = "" } ;
--lin only_Predet = { s = "" } ;
lin most_Predet = {s = "badi" ; isPoss = True ; da = F DA} ;
{-
lin how8many_IDet = R.indefDet "" pl ;
lin all_Predet = { s = "" } ;
lin not_Predet = { s = "" } ;
lin only_Predet = { s = "" } ;
lin most_Predet = { s = "" } ;
lin every_Det = R.defDet [] pl **
{ s = mkVow } ;
lin few_Det = R.indefDet "" pl ;
lin many_Det = R.indefDet "" pl ;
lin much_Det = R.indefDet "" sg ;
lin somePl_Det = R.indefDet "" pl ;
lin someSg_Det = R.indefDet "" sg ;
lin no_Quant = mkPrep no_Quant
-}
lin that_Quant = defQuant "aas" "kaas" "taas" "kuwaas" True ;
lin somePl_Det = {
sp = \\_,_ => "qaar" ;
isPoss, isNum = False ;
st = Definite ; -- NB. Indefinite means actually only IndefArt.
n = Pl ;
s = \\x,_ => BIND ++ defStems ! x ++ BIND ++ "a qaarkood" ;
shortPoss = \\x => BIND ++ defStems ! x ++ BIND ++ "a qaarkood" ;
} ;
lin someSg_Det = somePl_Det ** {
n = Sg ;
s = table {
M x => \\_ => BIND ++ defStems ! M x ++ BIND ++ "a qaarkiis" ;
F x => \\_ => BIND ++ defStems ! F x ++ BIND ++ "a qaarkeed" } ;
shortPoss = table {
M x => BIND ++ defStems ! M x ++ BIND ++ "a qaarkiis" ;
F x => BIND ++ defStems ! F x ++ BIND ++ "a qaarkeed" }
} ;
--lin no_Quant = mkPrep no_Quant
lin that_Quant = defQuant "aas" "kaas" "taas" "kuwaas" True ; -- true = nominative marker is i
lin this_Quant = defQuant "an" "kan" "tan" "kuwan" True ;
--lin which_IQuant = defQuant
lin which_IQuant = defIQuant "ee" ;
{-
-----
@@ -92,24 +110,26 @@ oper
-- Prep
lin above_Prep = mkPrep (mkPrep ka) [] [] "dul" ;
-- lin after_Prep = mkPrep "" ;
-- lin after_Prep = mkPrep ""
-- lin before_Prep = mkPrep "" ;
-- lin behind_Prep = mkPrep "" ;
-- lin between_Prep = mkPrep "" ;
lin between_Prep = possPrep (nUl "dhex") ;
-- lin by8agent_Prep = mkPrep ;
-- lin by8means_Prep = mkPrep ;
-- lin during_Prep = mkPrep ;
-- lin except_Prep = mkPrep ;
-- lin for_Prep = mkPrep ;
-- lin from_Prep = mkPrep "" ;
-- lin in8front_Prep = mkPrep "" ;
lin in8front_Prep = possPrep (nUl "hor") ;
lin in_Prep = mkPrep ku ;
lin on_Prep = mkPrep ku ;
-- lin part_Prep = mkPrep ;
-- lin possess_Prep = mkPrep ;
-- lin through_Prep = mkPrep ;
-- lin to_Prep = mkPrep ;
-- lin under_Prep = mkPrep "" ;
lin under_Prep =
let hoos : CatSom.Prep = possPrep (nUl "hoos")
in hoos ** {c2 = Ku} ;
lin with_Prep = mkPrep la ;
-- lin without_Prep = mkPrep ;
@@ -156,16 +176,16 @@ lin yes_Utt = ss "haa" ;
-------
-- Verb
lin have_V2 = mkV2 have_V noPrep ;
lin have_V2 = mkV2 have_V noPrep ; -- TODO: check if {sii = "l" ++ BIND ; isCopula=True} makes sense for present tense negative
lin can8know_VV = can_VV ; -- can (capacity)
lin can_VV = mkV "kar" ; -- can (possibility)
{-lin must_VV = mkV "" ;
lin want_VV = mkV "" ;
lin can_VV = mkVV "kar" ; -- can (possibility)
lin must_VV = mkVV waa_in ;
lin want_VV = mkVV (mkV "rabid" "rab" "rab") subjunctive ;
------
-- Voc
{-
lin please_Voc = ss "" ;
-}
}

View File

@@ -1,4 +1,4 @@
concrete VerbSom of Verb = CatSom ** open ResSom, Prelude in {
concrete VerbSom of Verb = CatSom ** open ResSom, AdverbSom, Prelude in {
lin
@@ -15,15 +15,40 @@ lin
ReflVP = ResSom.insertRefl ;
-- : VV -> VP -> VP ;
ComplVV vv vp = vp ** { -- check Sayeed p. 169
s = vv.s ;
vComp = vp.vComp ++ vp.s ! VInf ;
pred = NoPred ;
} ;
{-
-- : VS -> S -> VP ;
ComplVS vs s = ;
ComplVV vv vp = let vc = vp.vComp in case vv.vvtype of {
Waa_In => vp ** {
vComp = vc ** {subjunc = vv.s ! VInf} ; -- it's always the word "in", and it will be placed before subject pronoun. it's placed in vv.s!VInf so that the VV would contribute with some string. /IL
obj2 = vp.obj2 ** {s = []} ; -- word order hack to avoid more parameters:
miscAdv = vp.miscAdv ++ vp.obj2.s -- dump the object to miscAdv
} ;
Subjunctive => useV vv ** {
stm = Waxa ;
vComp = vc ** { -- The whole previous VP becomes the subordinate clause
subcl = \\agr =>
let subj = pronTable ! agr ;
cls = predVPslash subj vp ;
scl = cl2sentence True cls ;
in scl.s ! Pres ! Simul ! Pos
}
} ;
Infinitive => vp ** {
s = vv.s ; -- check Saeed p. 169
vComp = vc ** {
inf = vc.inf ++ vp.s ! VInf
} ;
stm = Waa NoPred ;
}
} ;
-- : VS -> S -> VP ;
ComplVS vs s =
let vps = useV vs ;
subord = SubjS {s="in"} s ;
in vps ** {obj2 = {s = subord.berri ; a = P3_Prep}} ;
{-
-- : VQ -> QS -> VP ;
ComplVQ vq qs = ;
@@ -115,25 +140,25 @@ lin
-- : AP -> Comp ;
CompAP ap = {
comp = \\a => <[], ap.s ! AF (getNum a) Abs> ;
pred = Copula ;
stm = Waa Copula ;
} ;
-- : CN -> Comp ;
CompCN cn = {
comp = \\a => <[], cn2str Sg Abs cn> ;
pred = NoCopula ;
stm = Waa NoCopula ;
} ;
-- NP -> Comp ;
CompNP np = {
comp = \\a => <[], np.s ! Abs> ;
pred = NoCopula ;
stm = Waa NoCopula ;
} ;
-- : Adv -> Comp ;
CompAdv adv = {
comp = \\a => <[], linAdv adv> ;
pred = Copula ;
stm = Waa Copula ;
} ;
-- : VP -- Copula alone;

View File

@@ -0,0 +1,7 @@
-- LangEng: the big black bird
LangSom: shimbir BIND ta madow ee weyn
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumSg) (AdjCN (PositA big_A) (AdjCN (PositA black_A) (UseN bird_N))))) NoVoc
-- LangEng: a big black bird
LangSom: shimbir madow oo weyn
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant IndefArt NumSg) (AdjCN (PositA big_A) (AdjCN (PositA black_A) (UseN bird_N))))) NoVoc

View File

@@ -0,0 +1,87 @@
-- Restrictive relative clauses (RelCN)
-- Saeed p. 213
-- LangEng: the books that the men buy
LangSom: buugaag BIND ta niman BIND ku iibsadaan
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (SlashV2a buy_V2))))))) NoVoc
-- LangEng: the books that the man doesn't buy
LangSom: buugaag BIND ta nin BIND ku aan iibsado
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PNeg (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a buy_V2))))))) NoVoc
-- LangEng: the men that buy the books
LangSom: niman BIND ka buugaag BIND ta iibsada
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N)))))))) NoVoc
-- LangEng: the men that don't buy the books
LangSom: niman BIND ka aan buugaag BIND ta iibsado
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PNeg (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N)))))))) NoVoc
-- LangEng: the men that buy the books are these
LangSom: niman BIND ka buugaag BIND ta iibsadaa waa kuwan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N))))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc
-- LangEng: the men that don't buy the books are these
LangSom: niman BIND ka aan buugaag BIND ta iibsado waa kuwan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PNeg (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N))))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc
-- LangEng: the books that the men buy are these
LangSom: buugaag BIND ta niman BIND ku iibsadaan waa kuwan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (SlashV2a buy_V2)))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc
-- LangEng: the books that the men don't buy are these
LangSom: buugaag BIND ta niman BIND ku aan iibsadaan waa kuwan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PNeg (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (SlashV2a buy_V2)))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc
-- LangEng: the books that the man doesn't buy are these
LangSom: buugaag BIND ta nin BIND ku aan iibsado waa kuwan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PNeg (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (UseN man_N)) (SlashV2a buy_V2)))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc
-- With a verb that takes a preposition
-- LangEng: the woman that you taught
LangSom: naag BIND ta aad ku bartay
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN woman_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (UsePron youSg_Pron) (SlashV2a teach_V2))))))) NoVoc
-- Combine with passive
-- LangEng: the woman that was taught
LangSom: naag BIND ta lagu baray
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN woman_N) (UseRCl (TTAnt TPast ASimul) PPos (RelVP IdRP (PassV2 teach_V2)))))) NoVoc
-- Negative forms
-- LangEng: sheep that aren't black don't see you
LangSom: lax aan madow aha ku BIND ma arkaan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant IndefArt NumPl) (RelCN (UseN sheep_N) (UseRCl (TTAnt TPres ASimul) PNeg (RelVP IdRP (UseComp (CompAP (PositA black_A))))))) (ComplSlash (SlashV2a see_V2) (UsePron youPol_Pron))))) NoVoc
-- LangEng: you don't see sheep that aren't black
LangSom: laxo aan madow ahayni ma aragto
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron youPol_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumPl) (RelCN (UseN sheep_N) (UseRCl (TTAnt TPres ASimul) PNeg (RelVP IdRP (UseComp (CompAP (PositA black_A))))))))))) NoVoc
-- Appositive relative clauses (RelNP)
-- LangEng: he , that the men see
LangSom: isaga oo niman BIND ku arkaan
Lang: PhrUtt NoPConj (UttNP (RelNP (UsePron he_Pron) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (SlashV2a see_V2)))))) NoVoc
-- LangEng: he , that sees the men
LangSom: isaga oo niman BIND ka arka
Lang: PhrUtt NoPConj (UttNP (RelNP (UsePron he_Pron) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN man_N))))))) NoVoc
-- LangEng: he , that the men see , is this
LangSom: isagu oo niman BIND ku arkaan waa kan
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UsePron he_Pron) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (SlashV2a see_V2))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumSg))))))) NoVoc
--LangEng: he , that sees the men , is this
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
-- Question clauses
-- 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

View File

@@ -0,0 +1,28 @@
-- LangEng: the two cats
LangSom: laba BIND da bisadood
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2)))))))) (UseN cat_N))) NoVoc
-- LangEng: those three men
LangSom: saddex BIND daas nin
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant that_Quant (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))))))) (UseN man_N))) NoVoc
-- LangEng: my three fathers
LangSom: saddex BIND dayd BIND a aabbe
Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant (PossPron i_Pron) (NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3)))))))) (UseN2 father_N2))) NoVoc
-- LangEng: she is the first cat
LangSom: waa bisad BIND da kowaad
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseComp (CompNP (DetCN (DetQuantOrd DefArt NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN cat_N))))))) NoVoc
-- LangEng: she is my first cat
LangSom: waa bisad BIND dayd BIND a kowaad
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron she_Pron) (UseComp (CompNP (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN cat_N))))))) NoVoc
-- LangEng: he is my first father
LangSom: waa aabb BIND ahay kowaad
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (UseComp (CompNP (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN2 father_N2))))))) NoVoc
-- LangEng: he is my first man
LangSom: waa nin BIND kayg BIND a kowaad
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (UseComp (CompNP (DetCN (DetQuantOrd (PossPron i_Pron) NumSg (OrdNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) (UseN man_N))))))) NoVoc

View File

@@ -13,7 +13,7 @@ LangSom: waa ay ku arkeen
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron they_Pron) (ComplSlash (SlashV2a see_V2) (UsePron youSg_Pron))))) NoVoc
-- LangEng: they didn't see you
LangSom: ku &+ ma arkin
LangSom: ku BIND ma arkin
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PNeg (PredVP (UsePron they_Pron) (ComplSlash (SlashV2a see_V2) (UsePron youSg_Pron))))) NoVoc
-- LangEng: you taught yourself
@@ -21,7 +21,7 @@ LangSom: waa aad isku bartay
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron youSg_Pron) (ReflVP (SlashV2a teach_V2))))) NoVoc
-- LangEng: you don't teach yourself
LangSom: isku &+ ma barto
LangSom: isku BIND ma barto
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron youSg_Pron) (ReflVP (SlashV2a teach_V2))))) NoVoc
-- LangEng: one saw you
@@ -48,7 +48,7 @@ LangSom: hooyo waa ay ina kaa siisey
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (UseN2 mother_N2)) (ComplSlash (Slash3V3 give_V3 (UsePron we_Pron)) (UsePron youSg_Pron))))) NoVoc
-- LangEng: mother didn't give you us
LangSom: hooyo ina &+ ma ay kaa siin
LangSom: hooyo ina BIND ma kaa siin
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PNeg (PredVP (MassNP (UseN2 mother_N2)) (ComplSlash (Slash3V3 give_V3 (UsePron we_Pron)) (UsePron youSg_Pron))))) NoVoc
-- LangEng: he gave himself bread
@@ -56,13 +56,40 @@ LangSom: rooti waa uu is siiyey
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron he_Pron) (ReflVP (Slash2V3 give_V3 (MassNP (UseN bread_N))))))) NoVoc
-- LangEng: one adds salt to the meat
LangSom: hilib &+ ka cusbo waa lagu daraa
LangSom: hilib BIND ka cusbo waa lagu daraa
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (GenericCl (ComplSlash (Slash3V3 add_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))) (MassNP (UseN salt_N)))))) NoVoc
-- LangEng: one can add salt to meat
LangSom: hilib cusbo waa lagu dari karaa
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (GenericCl (ComplVV can_VV (ComplSlash (Slash3V3 add_V3 (MassNP (UseN meat_N))) (MassNP (UseN salt_N))))))) NoVoc
--------------------------------------------------------------------------------
-- Other complements
--LangEng: we knew that he is coming
LangSom: in uu imanayo waa aynu ogaannay
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron we_Pron) (ComplVS know_VS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron he_Pron) (ProgrVP (UseV come_V)))))))) NoVoc
-- LangEng: you must see mother of the cat
LangSom: waa in aad aragtaa bisad BIND da hooya BIND deed
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron youPol_Pron) (ComplVV must_VV (ComplSlash (SlashV2a see_V2) (MassNP (ComplN2 mother_N2 (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))) NoVoc
-- LangEng: the mother of the cat must be seen
LangSom: waa in la arkaa bisad BIND da hooya BIND deed
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (GenericCl (ComplVV must_VV (ComplSlash (SlashV2a see_V2) (MassNP (ComplN2 mother_N2 (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))))) NoVoc
-- LangEng: I want to read the book
LangSom: waxa aan rabaa in aan buug BIND ga akhriyo
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))))) NoVoc
-- LangEng: I don't want to read the book
LangSom: ma rabo in aan buug BIND ga akhriyo
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))))) NoVoc
-- LangEng: you want to see us under the chair
LangSom: waxa aad rabtaa in aad inagu aragto kursi BIND ga hoos BIND tiis BIND a
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron youSg_Pron) (ComplVV want_VV (AdvVP (ComplSlash (SlashV2a see_V2) (UsePron we_Pron)) (PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN chair_N)))))))) NoVoc
--------------------------------------------------------------------------------
-- Adverbials
@@ -71,5 +98,22 @@ LangSom: waa aan ka dul boodi karaa
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplVV can_VV (UseV jump_V)) (PrepNP above_Prep (UsePron it_Pron)))))) NoVoc
-- LangEng: you can't jump above me
LangSom: iga &+ ma dul boodi karto
LangSom: iga BIND ma dul boodi karto
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron youSg_Pron) (AdvVP (ComplVV can_VV (UseV jump_V)) (PrepNP above_Prep (UsePron i_Pron)))))) NoVoc
-- LangEng: I am taught in front of the house
LangSom: waa laygu baraa guri BIND ga hor BIND tiis BIND a
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (PassV2 teach_V2) (PrepNP in8front_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))) NoVoc
-- LangEng: I am taught in front of my mother
LangSom: waa laygu baraa hooya BIND day hor BIND teed BIND a
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (PassV2 teach_V2) (PrepNP in8front_Prep (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 mother_N2))))))) NoVoc
-- LangEng: I see a cat under the chair
LangSom: bisad waa aan ku arkaa kursi BIND ga hoos BIND tiis BIND a
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))) (PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN chair_N))))))) NoVoc
-- LangEng: my mother lives under the sea
LangSom: hooya BIND day waa ku nool tahay bad BIND da hoos BIND teed BIND a
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 mother_N2)) (AdvVP (UseV live_V) (PrepNP under_Prep (DetCN (DetQuant DefArt NumSg) (UseN sea_N))))))) NoVoc