=Added linearisations for several lexical items. The linearization type for adjectives was modified to cater for certain adjectives that are negatives of others. An example is certain and uncertain

This commit is contained in:
David Bamutura
2020-10-22 00:02:51 +03:00
parent d4aba3bded
commit 6ca4907c11
4 changed files with 293 additions and 391 deletions
+73 -175
View File
@@ -1,4 +1,21 @@
--# -path=.:../prelude:../abstract:../common
--# -path=.:../abstract:../../prelude:../common
--1 Rukiga Lexical Paradigms
--
-- David Bamutura 2017--2020
-- based on the English Paradigms file.
-- This is an API for the user of the resource grammar
-- for adding lexical items. It gives functions for forming
-- expressions of open categories: nouns, adjectives, verbs.
--
-- Closed categories (determiners, pronouns, conjunctions) are
-- accessed through the resource syntax API, $Structural.gf$.
--
-- The structure of functions for each word class $C$ is the following:
-- first we give a handful of patterns that aim to cover all
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
-- escape to construct the most irregular words of type $C$.
resource ParadigmsCgg =
open (Predef=Predef), ResCgg, CatCgg, Prelude in {
@@ -45,13 +62,13 @@ oper
--3 Relational nouns
mkN2 : overload {
--mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --%
--mkN2 : N -> N2 ; -- e.g. wife of (default prep. to)
--mkN2 : N -> Str -> N2 ; -- access to --%
mkN2 : N -> Prep -> N2 ; -- e.g. access to
--mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --%
} ;
-- mkN2 : overload {
-- --mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --%
-- --mkN2 : N -> N2 ; -- e.g. wife of (default prep. to)
-- --mkN2 : N -> Str -> N2 ; -- access to --%
-- mkN2 : N -> Prep -> N2 ; -- e.g. access to
-- --mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --%
-- } ;
mkN2 = overload {
mkN2 : N -> Prep -> N2 = prepN2 ;
@@ -130,187 +147,68 @@ oper
mkV2V : V -> Prep -> Prep -> V2V = \v,p,t -> lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVAux}) ;
} ;
{-
-- Verbs with a particle.
-- The particle, such as in "switch on", is given as a string.
mkV2V : overload {
mkV2V : Str -> V2V ;
mkV2V : V -> V2V ;
mkV2V : V -> Prep -> Prep -> V2V ; -- e.g. want (noPrep NP) (to VP)
} ;
-}
--mkV = overload {
--mkV : (cry : Str) -> V
--= \cry -> lin V (mkVerb cry) ; -- what does it mean to create a lin on the fly
--};
{- Note: The following is copied from the file swahili/ParadigmsSwa.gf
--1 Swahili Lexical Paradigms
--2 Parameters
--
-- To abstract over gender names, we define the following identifiers.
oper
Animacy : Type ;
animate : Animacy ;
inanimate : Animacy ;
-- To abstract over number names, we define the following.
Number : Type ;
singular : Number ;
plural : Number ;
-- To abstract over case names, we define the following.
Case : Type ;
nominative : Case ;
locative : Case ;
-- To abstract over nounclass names, we define the following.
partV : V -> Str -> V ; -- with particle, e.g. switch + on
partV v p = lin V {s = v.s ;
pres = v.pres;
perf = v.perf;
isPresBlank = v.isPresBlank;
isPerfBlank = v.isPerfBlank;
isRegular = v.isRegular;
p = p ;
isRefl = v.isRefl
} ;
partV2 : V2 -> Str -> V2 ; -- with particle, e.g. switch + on
partV2 v p = lin V2 {s = v.s ;
pres = v.pres;
perf = v.perf;
isPresBlank = v.isPresBlank;
isPerfBlank = v.isPerfBlank;
isRegular = v.isRegular;
p = p ;
isRefl = v.isRefl;
comp = []; isCompN2 = False} ;
Gender : Type ;
-- mkVA : V -> VA ; -- e.g. become (AP)
-- mkV2A : overload {
-- mkV2A : V -> V2A ; -- e.g. paint (NP) (AP)
-- mkV2A : V -> Prep -> V2A ; -- backwards compatibility
-- mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. strike (NP) as (AP)
-- } ;
-- mkVQ : V -> VQ ; -- e.g. wonder (QS)
-- mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (QS)
m_wa : Gender ;
m_mi : Gender ;
ji_ma : Gender ;
e_ma : Gender ;
ma_ma : Gender ;
ki_vi : Gender ;
e_e : Gender ;
u_u : Gender ;
u_ma : Gender ;
u_e : Gender ;
-- mkAS : A -> AS ; --%
-- mkA2S : A -> Prep -> A2S ; --%
-- mkAV : A -> AV ; --%
-- mkA2V : A -> Prep -> A2V ; --%
-- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$.
-- $V0$ is just $V$; the second argument is treated as adverb.
--2 Nouns
V0 : Type ; --%
AS, A2S, AV, A2V : Type ; --%
-- Worst case: give all four forms and the semantic gender.
--2 Other categories
mkN : (mtu,watu : Str) -> Gender -> Animacy -> N ;
-- The regular function captures the variants for nouns depending on Gender and Number
regN : Str -> Gender -> Animacy -> N ;
-- In practice the worst case is just: give singular and plural nominative.
mk2N : (mtu , watu : Str) -> Gender -> Animacy -> N ;
mk2N x y g anim = mkNounIrreg x y g anim ** {lock_N = <>};
mkN2 : N -> Prep -> N2 ;
mkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p.s ; lock_N2 = <>} ;
mkPrep : Str -> Prep ;
-- mkPrep p = {s = p ; c = CPrep PNul ; isDir = False ; lock_Prep = <>} ;
mkPrep p = {s = p ; lock_Prep = <>} ;
--3 Relational nouns
--
-- Relational nouns ("fille de x") need a case and a preposition.
-- All nouns created by the previous functions are marked as
-- $nonhuman$. If you want a $human$ noun, wrap it with the following
-- function:
-- genderN : Gender -> N -> N ;
-- For regular adjectives, the adverbial form is derived. This holds
-- even for cases with the variation "happy - happily".
regA : Str -> A ;
-- If comparison is formed by "kuliko", as usual in Swahili,
-- the following pattern is used:
compADeg : A -> A ;
mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --%
mkInterj : Str -> Interj
= \s -> lin Interj (ss s) ;
--.
--2 Definitions of paradigms
--
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
--.
Animacy = ResSwa.Animacy ;
Number = ResSwa.Number ;
Case = ResSwa.Case ;
Gender = ResSwa.Gender ;
animate = AN ;
inanimate = IN ;
singular = Sg ;
plural = Pl ;
nominative = Nom ;
locative = Loc ;
m_wa = g1_2 ;
m_mi = g3_4 ;
ji_ma = g5_6 ;
e_ma = g5a_6 ;
ma_ma = g6 ;
ki_vi = g7_8 ;
e_e = g9_10 ;
u_u = g11 ;
u_ma = g11_6 ;
u_e = g11_10 ;
VForm = ResSwa.VForm ;
-- regN x g anim = mkNomReg x g anim ** {lock_N = <>} ;
regN = \x,g,anim ->
mkNomReg x g anim ** {lock_N = <>} ;
-- mkN x y g anim = mkNounIrreg x y g anim ** {lock_N = <>} ;
mkN = \x,y,g,anim ->
mkNounIrreg x y g anim ** {lock_N = <>} ;
-- Adjectives
regA a = compADeg {
s = \\_ => (mkAdjective a).s ;
lock_A = <>} ;
compADeg a =
{
s = table {
Posit => a.s ! Posit ;
_ => \\f => a.s ! Posit ! f ++ "kuliko"
} ;
lock_A = <>} ;
-- Verbs
regV : Str -> V ;
regV = \enda -> mkV enda ** {s1 = [] ; lock_V = <>} ;
{--
mkV2 = overload {
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
mkV2 : V -> V2 = dirV2 ;
mkV2 : V -> Prep -> V2 = mmkV2
} ;
mmkV2 : V -> Prep -> V2 ;
mmkV2 v p = v ** {c2 = p ; lock_V2 = <>} ;
dirV2 : V -> V2 = \v -> mmkV2 v "na" ;
--}
--2 Adverbs
-- Adverbs are not inflected. Most lexical ones have position
-- after the verb.
mkAdv : Str -> Adv ;
mkAdv x = ss x ** {lock_Adv = <>} ;
-}
-- Rearrange this document in future so that a paradigms file is
-- as should be i.e with an abstract part and a a part with
-- definitions
V0 : Type = V ;
AS, A2S, AV : Type = A ;
A2V : Type = A2 ;
}