1
0
forked from GitHub/gf-core

resource = resource-1.0

This commit is contained in:
aarne
2006-06-22 22:25:55 +00:00
parent 7e5584b1ab
commit 251bc4c738
881 changed files with 31130 additions and 31130 deletions

View File

@@ -1,38 +1,25 @@
--# -path=.:../romance:../../prelude
--# -path=.:../romance:../common:../../prelude
--1 A Simple Spanish Resource Morphology
--
-- Aarne Ranta 2002--2003
-- Aarne Ranta 2002 -- 2005
--
-- This resource morphology contains definitions needed in the resource
-- syntax. It moreover contains the most usual inflectional patterns.
-- The patterns for verbs contain the complete "Bescherelle" conjugation
-- tables.
--
-- We use the parameter types and word classes defined in $TypesSpa.gf$.
-- syntax. To build a lexicon, it is better to use $ParadigmsSpa$, which
-- gives a higher-level access to this module.
resource MorphoSpa = open (Predef=Predef), Prelude, TypesSpa, BeschSpa in {
resource MorphoSpa = CommonRomance, ResSpa **
open PhonoSpa, Prelude, Predef in {
--2 Some phonology
--
--3 Elision
--
-- The phonological rule of *elision* can be defined as follows in GF.
-- In Italian it includes both vowels and the *impure 's'*.
flags optimize=all ;
oper
vocale : Strs = strs {
"a" ; "e" ; "h" ; "i" ; "o" ; "u"
} ;
elisQue = "que" ; --- no elision in Italian
elisDe = "de" ;
--2 Nouns
--
-- The following macro is useful for creating the forms of number-dependent
-- tables, such as common nouns.
oper
numForms : (_,_ : Str) -> Number => Str = \vino, vini ->
table {Sg => vino ; Pl => vini} ;
@@ -49,18 +36,18 @@ oper
-- Common nouns are inflected in number and have an inherent gender.
mkCNom : (Number => Str) -> Gender -> CNom = \mecmecs,gen ->
mkNoun : (Number => Str) -> Gender -> Noun = \mecmecs,gen ->
{s = mecmecs ; g = gen} ;
mkCNomIrreg : Str -> Str -> Gender -> CNom = \mec,mecs ->
mkCNom (numForms mec mecs) ;
mkNounIrreg : Str -> Str -> Gender -> Noun = \mec,mecs ->
mkNoun (numForms mec mecs) ;
mkNomReg : Str -> CNom = \mec ->
mkNomReg : Str -> Noun = \mec ->
case last mec of {
"o" | "e" => mkCNom (nomVino mec) Masc ;
"a" => mkCNom (nomVino mec) Fem ;
"z" => mkCNomIrreg mec (init mec + "ces") Fem ;
_ => mkCNom (nomPilar mec) Masc
"o" | "e" => mkNoun (nomVino mec) Masc ;
"a" => mkNoun (nomVino mec) Fem ;
"z" => mkNounIrreg mec (init mec + "ces") Fem ;
_ => mkNoun (nomPilar mec) Masc
} ;
--2 Adjectives
@@ -105,50 +92,22 @@ oper
-- We follow the rule that the atonic nominative is empty.
mkPronoun : (_,_,_,_,_,_,_,_ : Str) ->
PronGen -> Number -> Person -> ClitType -> Pronoun =
\il,le,lui,Lui,son,sa,ses,see,g,n,p,c ->
Gender -> Number -> Person -> Pronoun =
\il,le,lui,Lui,son,sa,ses,see,g,n,p ->
{s = table {
Ton Nom => il ;
Ton x => prepCase x ++ Lui ;
Aton Nom => il ; ---- [] ;
Aton Nom => strOpt il ; ---- [] ;
Aton Acc => le ;
---- Aton (CPrep P_de) => "ne" ; --- hmm
Aton (CPrep P_a) => lui ;
Aton (CPrep q) => strPrep q ++ Lui ; ---- GF bug with c or p!
Poss Sg Masc => son ;
Poss Sg Fem => sa ;
Poss Pl Masc => ses ;
Poss Pl Fem => see
Aton q => prepCase q ++ Lui ; ---- GF bug with c or p!
Poss {n = Sg ; g = Masc} => son ;
Poss {n = Sg ; g = Fem} => sa ;
Poss {n = Pl ; g = Masc} => ses ;
Poss {n = Pl ; g = Fem} => see
} ;
g = g ;
n = n ;
p = p ;
c = c
} ;
-- used in constructions like "(no) hay ..."
pronEmpty : Number -> Pronoun = \n -> mkPronoun
[]
[]
[]
[]
[] [] [] []
(PGen Masc)
n
P3
Clit2 ;
--2 Reflexive pronouns
--
-- It is simply a function depending on number and person.
pronRefl : Number -> Person -> Str = \n,p -> case <n,p> of {
<Sg,P1> => "me" ;
<Sg,P2> => "te" ;
<_, P3> => "se" ;
<Pl,P1> => "nos" ;
<Pl,P2> => "vos"
a = {g = g ; n = n ; p = p} ;
hasClit = True
} ;
@@ -159,53 +118,4 @@ oper
pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! AF g n ;
qualPron : Gender -> Number -> Str = pronForms (adjUtil "cuál" "cuales") ;
talPron : Gender -> Number -> Str = pronForms (adjUtil "tál" "tales") ;
tuttoPron : Gender -> Number -> Str = pronForms (adjSolo "todo") ;
--2 Articles
--
-- The definite article has quite some variation: three parameters and
-- elision. This is the simples definition we have been able to find.
artDefTable : Gender => Number => Case => Str = \\g,n,c => case <g,n,c> of {
<Masc,Sg, CPrep P_de> => "del" ;
<Masc,Sg, CPrep P_a> => "al" ;
<Masc,Sg, _> => prepCase c ++ "el" ;
<Fem ,Sg, _> => prepCase c ++ "la" ;
<Masc,Pl, _> => prepCase c ++ "los" ;
<Fem ,Pl, _> => prepCase c ++ "las"
} ;
--2 Verbs
--
--3 The Bescherelle conjugations.
--
-- The following conjugations tables were generated using FM software
-- from a Haskell source.
--
-- The verb "essere" is often used in syntax.
verbSer = verbPres (ser_7 "ser") AHabere ;
verbHaber = verbPres (haber_10 "haber") AHabere ;
-- for bw compatibility
ser_7 : Str -> Verbum = ser_1 ;
haber_10 : Str -> Verbum = haber_3 ;
-- for Numerals
param DForm = unit | teen | ten | hundred ;
param Modif = mod | unmod | conj ;
oper spl : Str -> {s : Gender => Str ; n : Number} = \s -> {s = \\_ =>
s ; n = Pl} ;
uno : Gender => Str = table {Masc => "uno" ; Fem => "una"} ;
yuno : Gender => Str = \\g => "y" ++ uno ! g ;
}