1
0
forked from GitHub/gf-rgl

Merge pull request #131 from odanoburu/morpho

(Por) generalize acuteToVowel to diacriticToVowel
This commit is contained in:
Inari Listenmaa
2019-01-09 13:49:03 +02:00
committed by GitHub
4 changed files with 20 additions and 23 deletions

View File

@@ -64,17 +64,17 @@ oper
"i" => "í" ; "i" => "í" ;
"o" => "ó" ; "o" => "ó" ;
"u" => "ú" ; "u" => "ú" ;
_ => error "input '" ++ v ++ "' must be vowel character." _ => error ("input '" ++ v ++ "' must be vowel character.")
} ; } ;
acuteToVowel : Str -> Str = \v -> diacriticToVowel : Str -> Str = \v ->
case v of { case v of {
"á" => "a" ; ("á"|"â"|"ã") => "a" ;
"é" => "e" ; ("é"|"ê") => "e" ;
"í" => "i" ; "í" => "i" ;
"ó" => "o" ; ("ó"|"ô"|"õ") => "o" ;
"ú" => "u" ; "ú" => "u" ;
_ => error "input '" ++ v ++ "' must be an acute vowel character." _ => error ("input '" ++ v ++ "' must be a vowel character with an accent.")
} ; } ;
-- Common nouns are inflected in number and have an inherent gender. -- Common nouns are inflected in number and have an inherent gender.
@@ -130,7 +130,7 @@ oper
home + "m" => mkNoun (nomNuvem vinho) Masc ; home + "m" => mkNoun (nomNuvem vinho) Masc ;
g + v@("á"|"é"|"í"|"ó"|"ú"|"ê") + "s" => mkNoun (numForms vinho (g + acuteToVowel v + "ses")) Masc ; g + v@("á"|"é"|"í"|"ó"|"ú"|"ê") + "s" => mkNoun (numForms vinho (g + diacriticToVowel v + "ses")) Masc ;
ônibu + "s" => mkNoun (nomAreia vinho) Masc ; ônibu + "s" => mkNoun (nomAreia vinho) Masc ;

View File

@@ -85,25 +85,20 @@ oper
--2 Nouns --2 Nouns
regN : Str -> N ; regN : Str -> N ;
regN x = mkNomReg x ** {lock_N = <>} ; regN x = lin N (mkNomReg x) ;
femN : N -> N ; femN : N -> N ;
femN x = {s = x.s ; g = feminine ; lock_N = <>} ; femN n = n ** {g = feminine} ;
mascN : N -> N ; mascN : N -> N ;
mascN x = {s = x.s ; g = masculine ; lock_N = <>} ; mascN n = n ** {g = masculine} ;
mk2N : (bastão, bastões : Str) -> Gender -> N ; mk2N : (bastão, bastões : Str) -> Gender -> N ;
mk2N x y g = mkNounIrreg x y g ** {lock_N = <>} ; mk2N x y g = lin N (mkNounIrreg x y g) ;
--- [] update this docstring
-- The regular function takes the singular form and the gender, and -- The regular function takes the singular form and the gender, and
-- computes the plural and the gender by a heuristic. The heuristic -- computes the plural and the gender by a heuristic (see MorphoPor
-- says that the gender is feminine for nouns ending with "a" or -- for which heuristic).
-- "z", and masculine for all other words. Nouns ending with "a",
-- "o", "e" have the plural with "s", those ending with "z" have
-- "ces" in plural; all other nouns have "es" as plural ending. The
-- accent is not dealt with.
mkN = overload { mkN = overload {
-- predictable; "-a" for feminine, otherwise Masculine -- predictable; "-a" for feminine, otherwise Masculine
mkN : (luz : Str) -> N = regN ; mkN : (luz : Str) -> N = regN ;
@@ -136,7 +131,7 @@ oper
-- Relational nouns ("filha de x") need a case and a preposition. -- Relational nouns ("filha de x") need a case and a preposition.
mkN2 : N -> Prep -> N2 ; -- relational noun with prepositio mkN2 : N -> Prep -> N2 ; -- relational noun with prepositio
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; mkN2 = \n,p -> lin N2 (n ** {c2 = p}) ;
-- The most common cases are the genitive "de" and the dative "a", -- The most common cases are the genitive "de" and the dative "a",
-- with the empty preposition. -- with the empty preposition.
@@ -150,7 +145,7 @@ oper
-- Three-place relational nouns ("a conexão de x a y") need two -- Three-place relational nouns ("a conexão de x a y") need two
-- prepositions. -- prepositions.
mkN3 : N -> Prep -> Prep -> N3 ; -- prepositions for two complements mkN3 : N -> Prep -> Prep -> N3 ; -- prepositions for two complements
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; mkN3 = \n,p,q -> lin N3 (n ** {c2 = p ; c3 = q}) ;
--3 Relational common noun phrases --3 Relational common noun phrases
-- --
@@ -174,10 +169,10 @@ oper
} ; } ;
mk2PN : Str -> Gender -> PN ; -- Pilar mk2PN : Str -> Gender -> PN ; -- Pilar
mk2PN x g = {s = x ; g = g} ** {lock_PN = <>} ; mk2PN x g = lin PN {s = x ; g = g} ;
mkPN = overload { mkPN = overload {
-- feminine for "-a" -- feminine for "-a", else masculine
mkPN : (Anna : Str) -> PN = regPN ; mkPN : (Anna : Str) -> PN = regPN ;
-- force gender -- force gender
mkPN : (Pilar : Str) -> Gender -> PN = mk2PN ; mkPN : (Pilar : Str) -> Gender -> PN = mk2PN ;

View File

@@ -164,4 +164,5 @@ concrete StructuralPor of Structural = CatPor **
that_Subj = {s = "que" ; m = Conjunct} ; that_Subj = {s = "que" ; m = Conjunct} ;
lin language_title_Utt = ss "português" ; lin language_title_Utt = ss "português" ;
} ; } ;

View File

@@ -1,4 +1,5 @@
concrete TextPor of Text = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] ** open Prelude in { concrete TextPor of Text = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond]
** open Prelude in {
flags coding=utf8 ; flags coding=utf8 ;