mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
Merge pull request #131 from odanoburu/morpho
(Por) generalize acuteToVowel to diacriticToVowel
This commit is contained in:
@@ -64,17 +64,17 @@ oper
|
||||
"i" => "í" ;
|
||||
"o" => "ó" ;
|
||||
"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 {
|
||||
"á" => "a" ;
|
||||
"é" => "e" ;
|
||||
("á"|"â"|"ã") => "a" ;
|
||||
("é"|"ê") => "e" ;
|
||||
"í" => "i" ;
|
||||
"ó" => "o" ;
|
||||
("ó"|"ô"|"õ") => "o" ;
|
||||
"ú" => "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.
|
||||
@@ -130,7 +130,7 @@ oper
|
||||
|
||||
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 ;
|
||||
|
||||
|
||||
@@ -85,25 +85,20 @@ oper
|
||||
--2 Nouns
|
||||
|
||||
regN : Str -> N ;
|
||||
regN x = mkNomReg x ** {lock_N = <>} ;
|
||||
regN x = lin N (mkNomReg x) ;
|
||||
|
||||
femN : N -> N ;
|
||||
femN x = {s = x.s ; g = feminine ; lock_N = <>} ;
|
||||
femN n = n ** {g = feminine} ;
|
||||
|
||||
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 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
|
||||
-- computes the plural and the gender by a heuristic. The heuristic
|
||||
-- says that the gender is feminine for nouns ending with "a" or
|
||||
-- "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.
|
||||
-- computes the plural and the gender by a heuristic (see MorphoPor
|
||||
-- for which heuristic).
|
||||
mkN = overload {
|
||||
-- predictable; "-a" for feminine, otherwise Masculine
|
||||
mkN : (luz : Str) -> N = regN ;
|
||||
@@ -136,7 +131,7 @@ oper
|
||||
-- Relational nouns ("filha de x") need a case and a preposition.
|
||||
|
||||
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",
|
||||
-- with the empty preposition.
|
||||
@@ -150,7 +145,7 @@ oper
|
||||
-- Three-place relational nouns ("a conexão de x a y") need two
|
||||
-- prepositions.
|
||||
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
|
||||
--
|
||||
@@ -174,10 +169,10 @@ oper
|
||||
} ;
|
||||
|
||||
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 {
|
||||
-- feminine for "-a"
|
||||
-- feminine for "-a", else masculine
|
||||
mkPN : (Anna : Str) -> PN = regPN ;
|
||||
-- force gender
|
||||
mkPN : (Pilar : Str) -> Gender -> PN = mk2PN ;
|
||||
|
||||
@@ -164,4 +164,5 @@ concrete StructuralPor of Structural = CatPor **
|
||||
that_Subj = {s = "que" ; m = Conjunct} ;
|
||||
|
||||
lin language_title_Utt = ss "português" ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user