forked from GitHub/gf-core
next-lib renamed to lib, lib to old-lib
This commit is contained in:
2
lib/src/catalan/AdjectiveCat.gf
Normal file
2
lib/src/catalan/AdjectiveCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete AdjectiveCat of Adjective = CatCat ** AdjectiveRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
2
lib/src/catalan/AdverbCat.gf
Normal file
2
lib/src/catalan/AdverbCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete AdverbCat of Adverb = CatCat ** AdverbRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
7
lib/src/catalan/AllCat.gf
Normal file
7
lib/src/catalan/AllCat.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete AllCat of AllCatAbs =
|
||||
LangCat,
|
||||
IrregCat,
|
||||
ExtraCat
|
||||
** {} ;
|
||||
5
lib/src/catalan/AllCatAbs.gf
Normal file
5
lib/src/catalan/AllCatAbs.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract AllCatAbs =
|
||||
Lang,
|
||||
IrregCatAbs,
|
||||
ExtraCatAbs
|
||||
** {} ;
|
||||
6073
lib/src/catalan/BeschCat.gf
Normal file
6073
lib/src/catalan/BeschCat.gf
Normal file
File diff suppressed because it is too large
Load Diff
6
lib/src/catalan/CatCat.gf
Normal file
6
lib/src/catalan/CatCat.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete CatCat of Cat =
|
||||
CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] **
|
||||
CatRomance with -- JS restore TPast for notpresent
|
||||
(ResRomance = ResCat) ;
|
||||
11
lib/src/catalan/CompatibilityCat.gf
Normal file
11
lib/src/catalan/CompatibilityCat.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
--# -path=.:../romance:../abstract:../common
|
||||
|
||||
concrete CompatibilityCat of Compatibility = CatCat ** open Prelude, CommonRomance in {
|
||||
|
||||
-- from Noun 19/4/2008
|
||||
|
||||
lin
|
||||
NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
|
||||
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
|
||||
|
||||
}
|
||||
2
lib/src/catalan/ConjunctionCat.gf
Normal file
2
lib/src/catalan/ConjunctionCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ConjunctionCat of Conjunction = CatCat ** ConjunctionRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
181
lib/src/catalan/DiffCat.gf
Normal file
181
lib/src/catalan/DiffCat.gf
Normal file
@@ -0,0 +1,181 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
instance DiffCat of DiffRomance = open CommonRomance, PhonoCat, BeschCat, Prelude in {
|
||||
|
||||
flags optimize=noexpand ;
|
||||
|
||||
param
|
||||
Prepos = P_de | P_a ;
|
||||
VType = VHabere | VRefl ;
|
||||
|
||||
oper
|
||||
dative : Case = CPrep P_a ;
|
||||
genitive : Case = CPrep P_de ;
|
||||
|
||||
prepCase = \c -> case c of {
|
||||
Nom => [] ;
|
||||
Acc => [] ;
|
||||
CPrep P_de => "de" ;
|
||||
CPrep P_a => "a"
|
||||
} ;
|
||||
|
||||
|
||||
artDef : Gender -> Number -> Case -> Str = \g,n,c ->
|
||||
case <g,n,c> of {
|
||||
<Masc,Sg, CPrep P_de> => pre {"del" ; ["de l'"] / vocalForta} ;
|
||||
<Masc,Sg, CPrep P_a> => pre {"al" ; ["a l'"] / vocalForta} ;
|
||||
<Masc,Sg, _> => elisEl ;
|
||||
<Fem, Sg, _> => prepCase c ++ elisLa ;
|
||||
<_, Pl, CPrep P_de> => "dels" ;
|
||||
<_, Pl, CPrep P_a> => "als" ;
|
||||
<Masc, Pl, _ > => "els" ;
|
||||
<Fem, Pl, _ > => "les"
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
artIndef = \g,n,c -> case <n,c> of {
|
||||
<Sg,CPrep P_de> => genForms ["d' un"] ["d' una"] ! g ;
|
||||
<Pl,CPrep P_de> => genForms ["d' uns"] ["d' unes"] ! g ;
|
||||
<Sg,_> => prepCase c ++ genForms "un" "una" ! g ;
|
||||
<Pl,_> => prepCase c ++ genForms "uns" "unes" ! g
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
possCase = \_,_,c -> prepCase c ;
|
||||
|
||||
partitive = \g,c -> case c of {
|
||||
CPrep P_de => "de" ;
|
||||
_ => prepCase c ++ artDef g Sg (CPrep P_de)
|
||||
} ;
|
||||
|
||||
conjunctCase : NPForm -> NPForm = \c -> case c of {
|
||||
Ton Nom | Aton Nom => Ton Nom ;
|
||||
_ => Ton Acc
|
||||
} ;
|
||||
|
||||
auxVerb : VType -> (VF => Str) = \_ -> haver_V.s ;
|
||||
|
||||
partAgr : VType -> VPAgr = \vtyp -> vpAgrNone ;
|
||||
|
||||
vpAgrClit : Agr -> VPAgr = \a ->
|
||||
vpAgrNone ;
|
||||
|
||||
pronArg = \n,p,acc,dat ->
|
||||
let
|
||||
paccp = case acc of {
|
||||
CRefl => <reflPron n p Acc, p,True> ;
|
||||
CPron ag an ap => <argPron ag an ap Acc, ap,True> ;
|
||||
_ => <[],P2,False>
|
||||
} ;
|
||||
pdatp = case dat of {
|
||||
CPron ag an ap => <argPron ag an ap dative, ap,True> ;
|
||||
_ => <[],P2,False>
|
||||
}
|
||||
in case <paccp.p2, pdatp.p2> of {
|
||||
---- AR 8/6/2008 efficiency problem in pgf generation:
|
||||
---- replace the case expr with
|
||||
---- a constant produces an error in V3 predication with two pronouns
|
||||
---- <P3,P3> => <"se" ++ paccp.p1, [],True> ;
|
||||
_ => <pdatp.p1 ++ paccp.p1, [],orB paccp.p3 pdatp.p3>
|
||||
} ;
|
||||
|
||||
--case <p,acc,dat> of {
|
||||
-- <Sg,P2,CRefl,CPron {n = Sg ; p = P1}> => <"te" ++ "me", []> ;
|
||||
-- <_,_,CPron {n = Sg ; p = P2},CPron {n = Sg ; p = P1}> => <"te" ++ "me", []> ;
|
||||
|
||||
infForm _ _ _ _ = True ;
|
||||
|
||||
mkImperative b p vp = {
|
||||
s = \\pol,aag =>
|
||||
let
|
||||
pe = case b of {True => P3 ; _ => p} ;
|
||||
agr = aag ** {p = pe} ;
|
||||
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||
----e verb = case <aag.n, pol,pe> of {
|
||||
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
|
||||
----e _ => (vp.s ! VPImperat).fin ! agr
|
||||
----e } ;
|
||||
verb = (vp.s ! VPImperat).fin ! agr ; ----e
|
||||
neg = vp.neg ! pol ;
|
||||
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
|
||||
in
|
||||
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
|
||||
} ;
|
||||
|
||||
negation : Polarity => (Str * Str) = table {
|
||||
Pos => <[],[]> ;
|
||||
Neg => <"no",[]>
|
||||
} ;
|
||||
|
||||
conjThan = "que" ;
|
||||
conjThat = "que" ;
|
||||
subjIf = "si" ;
|
||||
|
||||
|
||||
|
||||
clitInf b cli inf = inf ++ bindIf b ++ cli ; --- JS copied from DiffSpa
|
||||
|
||||
relPron : Bool => AAgr => Case => Str = \\b,a,c =>
|
||||
case c of {
|
||||
Nom | Acc => "que" ;
|
||||
CPrep P_a => "cuyo" ;
|
||||
_ => prepCase c ++ "cuyo"
|
||||
} ;
|
||||
|
||||
pronSuch : AAgr => Str = aagrForms "tal" "tal" "tals" "tals" ;
|
||||
|
||||
quelPron : AAgr => Str = aagrForms "qual" "qual" "quals" "quals" ;
|
||||
|
||||
partQIndir = [] ; ---- ?
|
||||
|
||||
reflPron : Number -> Person -> Case -> Str = \n,p,c ->
|
||||
let pro = argPron Fem n p c
|
||||
in
|
||||
case p of {
|
||||
P3 => case c of {
|
||||
Acc | CPrep P_a => "se" ;
|
||||
_ => "sÌ"
|
||||
} ;
|
||||
_ => pro
|
||||
} ;
|
||||
|
||||
argPron : Gender -> Number -> Person -> Case -> Str =
|
||||
let
|
||||
cases : (x,y : Str) -> Case -> Str = \me,moi,c -> case c of {
|
||||
Acc | CPrep P_a => me ;
|
||||
_ => moi
|
||||
} ;
|
||||
cases3 : (x,y,z : Str) -> Case -> Str = \les,leur,eux,c -> case c of {
|
||||
Acc => les ;
|
||||
CPrep P_a => leur ;
|
||||
_ => eux
|
||||
} ;
|
||||
in
|
||||
\g,n,p -> case <g,n,p> of {
|
||||
<_,Sg,P1> => cases "em" "mí" ;
|
||||
<_,Sg,P2> => cases "et" "tú" ;
|
||||
<_,Pl,P1> => cases "ens" "nosaltres" ; --- nosotros
|
||||
<_,Pl,P2> => cases "us" "vosaltres" ; --- vosotros
|
||||
<Fem,Sg,P3> => cases3 "la" "li" "ella" ;
|
||||
<Masc, Sg,P3> => cases3 "el" "li" "ell" ;
|
||||
<Fem,Pl,P3> => cases3 "les" "les" "elles" ;
|
||||
<Masc, Pl,P3> => cases3 "els" "els" "ells"
|
||||
} ;
|
||||
|
||||
vRefl : VType = VRefl ;
|
||||
isVRefl : VType -> Bool = \ty -> case ty of {
|
||||
VRefl => True ;
|
||||
_ => False
|
||||
} ;
|
||||
|
||||
auxPassive : Verb = copula ;
|
||||
|
||||
copula = verbBeschH (ser_52 "ser") ;
|
||||
|
||||
haver_V : Verb = verbBeschH (haver_59 "haver" True) ;
|
||||
|
||||
verbBeschH : Verbum -> Verb = \v -> verbBesch v ** {vtyp = VHabere} ;
|
||||
|
||||
}
|
||||
47
lib/src/catalan/ExtraCat.gf
Normal file
47
lib/src/catalan/ExtraCat.gf
Normal file
@@ -0,0 +1,47 @@
|
||||
concrete ExtraCat of ExtraCatAbs = ExtraRomanceCat **
|
||||
open CommonRomance, PhonoCat, MorphoCat, ParadigmsCat, ParamX, ResCat in {
|
||||
|
||||
-- lin
|
||||
-- i8fem_Pron = mkPronoun
|
||||
-- "yo" "me" "me" "mí"
|
||||
-- "mi" "mi" "mis" "mis"
|
||||
-- Fem Sg P1 ;
|
||||
-- these8fem_NP = mkNP ["estas"] Fem Pl ;
|
||||
-- they8fem_Pron = mkPronoun
|
||||
-- "ellas" "las" "les" "ellas"
|
||||
-- "su" "su" "sus" "sus"
|
||||
-- Fem Pl P3 ;
|
||||
-- this8fem_NP = pn2np (mkPN ["esta"] Fem) ;
|
||||
-- those8fem_NP = mkNP ["esas"] Fem Pl ;
|
||||
|
||||
-- we8fem_Pron = mkPronoun
|
||||
-- "nosotras" "nos" "nos" "nosotras"
|
||||
-- "nuestro" "nuestra" "nuestros" "nuestras"
|
||||
-- Fem Pl P1 ;
|
||||
-- whoPl8fem_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Fem Pl} ;
|
||||
-- whoSg8fem_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Fem Sg} ;
|
||||
|
||||
-- youSg8fem_Pron = mkPronoun
|
||||
-- "tu" "te" "te" "tí"
|
||||
-- "tu" "tu" "tus" "tus"
|
||||
-- Fem Sg P2 ;
|
||||
-- youPl8fem_Pron = mkPronoun
|
||||
-- "vosotras" "vos" "vos" "vosotras"
|
||||
-- "vuestro" "vuestra" "vuestros" "vuestras"
|
||||
-- Fem Pl P2 ;
|
||||
-- youPol8fem_Pron = mkPronoun
|
||||
-- "usted" "la" "le" "usted"
|
||||
-- "su" "su" "sus" "sus"
|
||||
-- Fem Sg P3 ;
|
||||
|
||||
-- youPolPl_Pron = mkPronoun
|
||||
-- "ustedes" "las" "les" "usted"
|
||||
-- "su" "su" "sus" "sus"
|
||||
-- Masc Pl P3 ;
|
||||
-- youPolPl8fem_Pron = mkPronoun
|
||||
-- "ustedes" "las" "les" "usted"
|
||||
-- "su" "su" "sus" "sus"
|
||||
-- Fem Pl P3 ;
|
||||
|
||||
|
||||
}
|
||||
28
lib/src/catalan/ExtraCatAbs.gf
Normal file
28
lib/src/catalan/ExtraCatAbs.gf
Normal file
@@ -0,0 +1,28 @@
|
||||
-- Structures special for Catalan. These are not implemented in other
|
||||
-- Romance languages.
|
||||
|
||||
abstract ExtraCatAbs = ExtraRomanceAbs ** {
|
||||
|
||||
-- fun
|
||||
|
||||
-- Feminine variants of pronouns (those in $Structural$ are
|
||||
-- masculine, which is the default when gender is unknown).
|
||||
|
||||
-- i8fem_Pron : Pron ;
|
||||
-- these8fem_NP : NP ;
|
||||
-- they8fem_Pron : Pron ;
|
||||
-- this8fem_NP : NP ;
|
||||
-- those8fem_NP : NP ;
|
||||
|
||||
-- we8fem_Pron : Pron ; -- nosotras
|
||||
-- whoPl8fem_IP : IP ;
|
||||
-- whoSg8fem_IP : IP ;
|
||||
|
||||
-- youSg8fem_Pron : Pron ;
|
||||
-- youPl8fem_Pron : Pron ; -- vosotras
|
||||
-- youPol8fem_Pron : Pron ; -- usted
|
||||
|
||||
-- youPolPl_Pron : Pron ; -- ustedes
|
||||
-- youPolPl8fem_Pron : Pron ;
|
||||
|
||||
}
|
||||
2
lib/src/catalan/ExtraRomanceCat.gf
Normal file
2
lib/src/catalan/ExtraRomanceCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ExtraRomanceCat of ExtraRomanceAbs = CatCat ** ExtraRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
22
lib/src/catalan/GrammarCat.gf
Normal file
22
lib/src/catalan/GrammarCat.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarCat of Grammar =
|
||||
NounCat,
|
||||
VerbCat,
|
||||
AdjectiveCat,
|
||||
AdverbCat,
|
||||
NumeralCat,
|
||||
SentenceCat,
|
||||
QuestionCat,
|
||||
RelativeCat,
|
||||
ConjunctionCat,
|
||||
PhraseCat,
|
||||
TextX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond],
|
||||
IdiomCat,
|
||||
StructuralCat
|
||||
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
52
lib/src/catalan/IdiomCat.gf
Normal file
52
lib/src/catalan/IdiomCat.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
concrete IdiomCat of Idiom = CatCat **
|
||||
open MorphoCat, ParadigmsCat, BeschCat, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ExistNP np = mkClause [] True (agrP3 Masc Sg)
|
||||
(insertClit3 "hi" (insertComplement (\\_ => (np.s ! Acc).ton) (predV haver_V))) ;
|
||||
GenericCl vp = mkClause "hom" True (agrP3 Masc Sg) vp ;
|
||||
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
|
||||
|
||||
|
||||
ProgrVP vpr = let vp = useVP vpr in
|
||||
insertComplement
|
||||
(\\agr =>
|
||||
let
|
||||
clpr = <vp.clit1,vp.clit2> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
|
||||
obj = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
|
||||
in
|
||||
(vp.s ! VPGerund).inf ! (aagr agr.g agr.n) ++ clpr.p1 ++ obj
|
||||
)
|
||||
(predV (verbV (estar_54 "estar"))) ;
|
||||
|
||||
----AR, for completeness
|
||||
|
||||
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => rs.s ! Indic ! np.a)
|
||||
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
|
||||
|
||||
|
||||
ExistIP ip = {
|
||||
s = \\t,a,p,_ =>
|
||||
ip.s ! Nom ++
|
||||
(mkClause [] True
|
||||
(agrP3 Masc Sg)
|
||||
(insertClit3 "hi" (insertComplement (\\_ => ip.s ! Acc) (predV haver_V))))
|
||||
.s ! DDir ! t ! a ! p ! Indic
|
||||
} ;
|
||||
|
||||
ImpPl1 vpr = let vp = useVP vpr in {s =
|
||||
(mkImperative False P1 vp).s ! Pos ! {n = Pl ; g = Masc} --- fem
|
||||
} ;
|
||||
|
||||
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
|
||||
(insertComplement (\\_ => ad.s) (predV copula))) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
1121
lib/src/catalan/IrregCat.gf
Normal file
1121
lib/src/catalan/IrregCat.gf
Normal file
File diff suppressed because it is too large
Load Diff
1106
lib/src/catalan/IrregCatAbs.gf
Normal file
1106
lib/src/catalan/IrregCatAbs.gf
Normal file
File diff suppressed because it is too large
Load Diff
10
lib/src/catalan/LangCat.gf
Normal file
10
lib/src/catalan/LangCat.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:../romance:../abstract:../common:../prelude
|
||||
|
||||
concrete LangCat of Lang =
|
||||
GrammarCat,
|
||||
LexiconCat
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
365
lib/src/catalan/LexiconCat.gf
Normal file
365
lib/src/catalan/LexiconCat.gf
Normal file
@@ -0,0 +1,365 @@
|
||||
--# -path=.:../romance:../common:../abstract:../../prelude
|
||||
|
||||
concrete LexiconCat of Lexicon = CatCat ** open
|
||||
(M=MorphoCat), ParadigmsCat, BeschCat in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
oper
|
||||
regFN : Str -> N = \s -> femN (regN s) ;
|
||||
regMN : Str -> N = \s -> regN s ;
|
||||
irregMN : Str -> Str -> N = \pa,pans -> M.mkNounIrreg pa pans masculine ;
|
||||
|
||||
lin
|
||||
airplane_N = regMN "avió" ;
|
||||
|
||||
answer_V2S = mkV2S (verbV (compondre_26 "respondre")) dative ;
|
||||
apartment_N = regMN "pis" ;
|
||||
apple_N = regFN "poma" ;
|
||||
art_N = regMN "art" ;
|
||||
ask_V2Q = mkV2Q (regV "preguntar") dative ;
|
||||
baby_N = regMN "nadó" ;
|
||||
bad_A = mkADeg (regA "dolent") (regA "pitjor") ;
|
||||
bank_N = regMN "banc" ;
|
||||
beautiful_A = prefA (regADeg "bell") ;
|
||||
become_VA = reflV (regV "tornar") ; -- esdevenir
|
||||
beer_N = regFN "cervesa" ;
|
||||
beg_V2V = mkV2V (regV "demanar") accusative dative ;
|
||||
big_A = regADeg "gros" ;
|
||||
bike_N = regFN "bicicleta" ;
|
||||
bird_N = regMN "ocell" ;
|
||||
black_A = compADeg (mkA "negre" "negra" "negres" "negres" "negrament") ;
|
||||
blue_A = compADeg (mkA "blau" "blava" "blaus" "blaves" "blavament") ;
|
||||
boat_N = regFN "barca" ;
|
||||
book_N = regMN "llibre" ;
|
||||
boot_N = regFN "bota" ;
|
||||
boss_N = regMN "cap" ;
|
||||
boy_N = regMN "noi" ;
|
||||
bread_N = irregMN "pa" "pans" ;
|
||||
break_V2 = dirV2 (verbV (trencar_112 "trencar")) ;
|
||||
broad_A = regADeg "ample" ; -- put it in MorphoCat?: like black_A
|
||||
brother_N2 = deN2 (regMN "germà") ;
|
||||
brown_A = compADeg (mkA "marró" "marrona" "marrons" "marrones" "marronament") ;
|
||||
butter_N = regFN "mantega" ;
|
||||
buy_V2 = dirV2 (regV "comprar") ;
|
||||
camera_N = regFN "càmara" ;
|
||||
cap_N = regFN "gorra" ;
|
||||
car_N = regMN "cotxe" ;
|
||||
carpet_N = regFN "catifa" ;
|
||||
cat_N = regMN "gat" ; -- gata
|
||||
ceiling_N = regMN "sostre" ;
|
||||
chair_N = regFN "cadira" ;
|
||||
cheese_N = regMN "formatge" ;
|
||||
child_N = regMN "nen" ; -- nena
|
||||
church_N = regFN "església" ;
|
||||
city_N = regFN "ciutat" ;
|
||||
clean_A = regADeg "net" ;
|
||||
clever_A = regADeg "inteligent" ;
|
||||
close_V2 = dirV2 (verbV (trencar_112 "tancar")) ;
|
||||
coat_N = regMN "abric" ;
|
||||
cold_A = regADeg "fred" ;
|
||||
come_V = verbV (venir_117 "venir") ;
|
||||
computer_N = regMN "ordinador" ;
|
||||
country_N = regMN "país" ; -- masc
|
||||
cousin_N = regMN "cosí" ;
|
||||
cow_N = regFN "vaca" ;
|
||||
die_V = verbV (morir_71 "morir") ;
|
||||
dirty_A = regADeg "brut" ;
|
||||
distance_N3 = mkN3 (regFN "distància") genitive dative ;
|
||||
doctor_N = regMN "metge" ; -- metgessa
|
||||
dog_N = regMN "gos" ; -- gossa
|
||||
door_N = regFN "porta" ;
|
||||
drink_V2 = dirV2 (verbV (beure_11 "beure")) ;
|
||||
easy_A2V = mkA2V (regA "fácil") dative genitive ;
|
||||
eat_V2 = dirV2 (verbV (envejar_48 "menjar")) ;
|
||||
empty_A = compADeg (mkA "buit" "buida" "buits" "buides" "buidament") ;
|
||||
enemy_N = regMN "enemic" ; -- enemiga
|
||||
factory_N = regFN "fàbrica" ;
|
||||
father_N2 = deN2 (regMN "pare") ;
|
||||
fear_VS = mkVS (verbV (témer_107 "témer")) ;
|
||||
find_V2 = dirV2 (regV "trobar") ;
|
||||
fish_N = regMN "peix" ;
|
||||
floor_N = regMN "terra" ; -- sòl
|
||||
forget_V2 = dirV2 (regV "oblidar") ;
|
||||
fridge_N = regFN "nevera" ;
|
||||
friend_N = regMN "amic" ; -- amiga
|
||||
fruit_N = regFN "fruita" ;
|
||||
fun_AV = mkAV (regA "divertit") genitive ;
|
||||
garden_N = regMN "jardí" ;
|
||||
girl_N = regFN "noia" ;
|
||||
glove_N = regMN "guant" ;
|
||||
gold_N = regMN "or" ;
|
||||
good_A = mkADeg (mkA "bó" "bona" "bons" "bones" "bonament") (regA "millor") ; ---- adv?
|
||||
go_V = (verbV (anar_4 "anar")) ;
|
||||
green_A = regADeg "verd" ;
|
||||
harbour_N = regMN "port" ;
|
||||
hate_V2 = dirV2 (verbV (canviar_16 "odiar")) ;
|
||||
hat_N = regMN "barret" ;
|
||||
hear_V2 = mkV2 (regV "escoltar") dative ; -- Must be "oir". Add it to Besch
|
||||
hill_N = regMN "turó" ;
|
||||
hope_VS = mkVS (regV "esperar") ;
|
||||
horse_N = regMN "cavall" ;
|
||||
hot_A = regADeg "calent" ;
|
||||
house_N = regFN "casa" ;
|
||||
important_A = regADeg "important" ;
|
||||
industry_N = regFN "indústria" ;
|
||||
iron_N = regMN "ferro" ;
|
||||
king_N = regMN "rei" ;
|
||||
know_V2 = dirV2 (verbV (saber_99 "saber")) ;
|
||||
lake_N = regMN "llac" ;
|
||||
lamp_N = regFN "làmpada" ;
|
||||
learn_V2 = dirV2 (verbV (aprendre_6 "aprendre")) ;
|
||||
leather_N = regMN "cuiro" ;
|
||||
leave_V2 = dirV2 (regV "partir") ;
|
||||
like_V2 = dirV2 (verbV (canviar_16 "apreciar")) ;
|
||||
listen_V2 = dirV2 (regV "escoltar") ;
|
||||
live_V = verbV (viure_119 "viure") ;
|
||||
long_A = regADeg "llarg" ;
|
||||
lose_V2 = dirV2 (verbV (perdre_83 "perdre")) ;
|
||||
love_N = regMN "amor" ;
|
||||
love_V2 = dirV2 (regV "estimar") ;
|
||||
man_N = regMN "home" ; -- masc
|
||||
married_A2 = mkA2 (regA "casat") dative ;
|
||||
meat_N = regFN "carn" ;
|
||||
milk_N = regFN "llet" ;
|
||||
moon_N = regFN "lluna" ;
|
||||
mother_N2 = deN2 (regFN "mare") ; -- fem
|
||||
mountain_N = regFN "muntanya" ;
|
||||
music_N = regFN "música" ;
|
||||
narrow_A = regADeg "estret" ;
|
||||
new_A = compADeg (mkA "nou" "nova" "nous" "noves" "novament") ;
|
||||
newspaper_N = regMN "diari" ; -- periòdic
|
||||
oil_N = regMN "oli" ;
|
||||
old_A = regADeg "vell" ;
|
||||
open_V2 = dirV2 (verbV (obrir_77 "obrir")) ;
|
||||
paint_V2A = mkV2A (regV "pintar") accusative (mkPrep "en") ;
|
||||
paper_N = regMN "paper" ;
|
||||
paris_PN = mkPN "Paris" masculine ;
|
||||
peace_N = regFN "pau" ;
|
||||
pen_N = regMN "llapis" ;
|
||||
planet_N = regMN "planeta" ;
|
||||
plastic_N = regMN "plàstic" ;
|
||||
play_V2 = dirV2 (verbV (pregar_86 "jugar")) ;
|
||||
policeman_N = regMN "policia" ; -- fem refers to the institution
|
||||
priest_N = regMN "capellà" ; -- masc
|
||||
probable_AS = mkAS (regA "probable") ;
|
||||
queen_N = regN "reina" ;
|
||||
radio_N = regFN "ràdio" ;
|
||||
rain_V0 = mkV0 (verbV (moure_72 "ploure")) ;
|
||||
read_V2 = dirV2 (verbV (servir_101 "llegir")) ;
|
||||
red_A = regADeg "vermell" ;
|
||||
religion_N = mkN "religió" "religions" feminine ;
|
||||
restaurant_N = regMN "restaurant" ;
|
||||
river_N = regMN "riu" ;
|
||||
rock_N = regFN "roca" ;
|
||||
roof_N = regFN "teulada" ;
|
||||
rubber_N = regFN "goma" ;
|
||||
run_V = verbV (córrer_30 "córrer") ;
|
||||
say_VS = mkVS (verbV (dir_41 "dir")) ;
|
||||
school_N = regFN "escola" ;
|
||||
science_N = regFN "ciència" ;
|
||||
sea_N = regMN "mar" ; -- masc & fem
|
||||
seek_V2 = dirV2 (verbV (trencar_112 "buscar")) ;
|
||||
see_V2 = dirV2 (verbV (veure_118 "veure")) ;
|
||||
sell_V3 = dirV3 (verbV (vendre_116 "vendre")) dative ;
|
||||
send_V3 = dirV3 (verbV (canviar_16 "enviar")) dative ;
|
||||
sheep_N = regFN "ovella" ; -- xai
|
||||
ship_N = regMN "vaixell" ;
|
||||
shirt_N = regFN "camisa" ;
|
||||
shoe_N = regFN "sabata" ;
|
||||
shop_N = regFN "botiga" ;
|
||||
short_A = regADeg "curt" ; --- breu
|
||||
silver_N = regFN "plata" ;
|
||||
sister_N = regFN "germana" ;
|
||||
sleep_V = verbV (dormir_44 "dormir") ;
|
||||
small_A = prefA (regADeg "petit") ;
|
||||
snake_N = regFN "serp" ; -- fem
|
||||
sock_N = regMN "mitjó" ;
|
||||
speak_V2 = dirV2 (regV "parlar") ;
|
||||
star_N = regFN "estrella" ;
|
||||
steel_N = regMN "acer" ;
|
||||
stone_N = regFN "pedra" ;
|
||||
stove_N = regMN "forn" ;
|
||||
student_N = regN "estudiant" ; -- used both for fem & masc
|
||||
stupid_A = regADeg "estúpid" ;
|
||||
sun_N = regMN "sol" ;
|
||||
switch8off_V2 = dirV2 (verbV (pregar_86 "apagar")) ;
|
||||
switch8on_V2 = dirV2 (verbV (atendre_8 "encendre")) ;
|
||||
table_N = regFN "taula" ;
|
||||
talk_V3 = mkV3 (regV "parlar") dative genitive ;
|
||||
teacher_N = regMN "mestre" ; -- mestra
|
||||
teach_V2 = dirV2 (regV "ensenyar") ;
|
||||
television_N = mkN "televisió" "televisions" feminine ; -- televisor masc
|
||||
thick_A = compADeg (mkA "gruixut" "gruixuda" "gruixuts" "gruixudes" "gruixudament") ;
|
||||
thin_A = compADeg (mkA "fi" "fina" "fins" "fines" "finament") ;
|
||||
train_N = regMN "tren" ;
|
||||
travel_V = verbV (envejar_48 "viatjar") ;
|
||||
tree_N = regMN "arbre" ;
|
||||
--- trousers_N = regN "pantalón" ; -- masc
|
||||
ugly_A = compADeg (mkA "lleig" "lletja" "lletjos" "lletges" "lletjament") ;
|
||||
understand_V2 = dirV2 (verbV (atendre_8 "entendre")) ;
|
||||
university_N = regFN "universitat" ;
|
||||
village_N = regMN "poble" ;
|
||||
wait_V2 = mkV2 (regV "esperar") dative ;
|
||||
walk_V = regV "caminar" ;
|
||||
warm_A = regADeg "tebi" ;
|
||||
war_N = regFN "guerra" ;
|
||||
watch_V2 = dirV2 (regV "mirar") ;
|
||||
water_N = regFN "aigua" ;
|
||||
white_A = compADeg (mkA "blanc" "blanca" "blancs" "blanques" "blancament") ;
|
||||
window_N = regFN "finestra" ;
|
||||
wine_N = regMN "vi" ;
|
||||
win_V2 = dirV2 (regV "guanyar") ;
|
||||
woman_N = regFN "dona" ;
|
||||
wonder_VQ = mkVQ (reflV (regV "preguntar")) ;
|
||||
wood_N = regFN "fusta" ;
|
||||
write_V2 = dirV2 (verbV (escriure_50 "escriure")) ;
|
||||
yellow_A = compADeg (mkA "groc" "groga" "grocs" "grogues" "grogament") ;
|
||||
young_A = compADeg (mkA "jove" "jove" "joves" "joves" "jovement") ;
|
||||
do_V2 = dirV2 (verbV (fer_56 "fer")) ;
|
||||
now_Adv = mkAdv "ara" ;
|
||||
already_Adv = mkAdv "ja" ;
|
||||
song_N = mkN "cançó" "cançons" feminine ;
|
||||
add_V3 = dirV3 (regV "afegir") dative ; -- also: (regV "sumar")
|
||||
number_N = regMN "número" ;
|
||||
put_V2 = dirV2 (regV "posar") ;
|
||||
stop_V = regV "aturar" ;
|
||||
jump_V = regV "saltar" ;
|
||||
left_Ord = M.mkOrd (regA "esquerra") ;
|
||||
right_Ord = M.mkOrd (regA "dreta") ;
|
||||
far_Adv = mkAdv "lluny" ;
|
||||
correct_A = regA "correcte" ;
|
||||
dry_A = regA "sec" ;
|
||||
dull_A = regA "balb" ;
|
||||
full_A = regA "ple" ;
|
||||
heavy_A = regA "pesat" ;
|
||||
near_A = regA "proper" ;
|
||||
rotten_A = regA "podrit" ;
|
||||
round_A = regA "rodó" ;
|
||||
sharp_A = regA "esmolat" ; -- punxegut
|
||||
smooth_A = regA "llis" ;
|
||||
straight_A = regA "directe" ;
|
||||
wet_A = regA "moll" ;
|
||||
wide_A = regA "extens" ;
|
||||
animal_N = regMN "animal" ; -- masc (sometimes fem when adj)
|
||||
ashes_N = regMN "cendra" ;
|
||||
back_N = regFN "esquena" ;
|
||||
bark_N = regFN "escorça" ;
|
||||
belly_N = regFN "panxa" ;
|
||||
blood_N = regFN "sang" ;
|
||||
bone_N = regMN "os" ;
|
||||
breast_N = regFN "sina" ; -- pit
|
||||
cloud_N = regMN "núvol" ;
|
||||
day_N = regMN "dia" ;
|
||||
dust_N = regFN "pols" ;
|
||||
ear_N = regFN "orella" ;
|
||||
earth_N = regFN "terra" ;
|
||||
egg_N = regMN "ou" ;
|
||||
eye_N = regMN "ull" ;
|
||||
fat_N = regMN "greix" ;
|
||||
feather_N = regFN "pluma" ;
|
||||
fingernail_N = regFN "ungla" ;
|
||||
fire_N = regMN "foc" ;
|
||||
flower_N = regFN "flor" ;
|
||||
fog_N = regFN "boira" ;
|
||||
foot_N = regMN "peu" ;
|
||||
forest_N = regMN "bosc" ;
|
||||
grass_N = regFN "herba" ;
|
||||
guts_N = regMN "budell" ;
|
||||
hair_N = regMN "cabell" ;
|
||||
hand_N = regFN "mà" ;
|
||||
head_N = regMN "cap" ;
|
||||
heart_N = regMN "cor" ;
|
||||
horn_N = regFN "banya" ;
|
||||
husband_N = regMN "marit" ; -- espòs
|
||||
ice_N = regMN "gel" ;
|
||||
knee_N = regMN "genoll" ;
|
||||
leaf_N = regFN "fulla" ;
|
||||
leg_N = regFN "cama" ;
|
||||
liver_N = regMN "fetge" ;
|
||||
louse_N = regMN "poll" ;
|
||||
mouth_N = regFN "boca" ;
|
||||
name_N = regMN "nom" ;
|
||||
neck_N = regMN "coll" ;
|
||||
night_N = regFN "nit" ;
|
||||
nose_N = regMN "nas" ;
|
||||
person_N = regFN "persona" ;
|
||||
rain_N = regFN "pluja" ;
|
||||
road_N = regMN "carrer" ;
|
||||
root_N = regFN "arrel" ;
|
||||
rope_N = regN "corda" ;
|
||||
salt_N = regFN "sal" ;
|
||||
sand_N = regFN "sorra" ;
|
||||
seed_N = regFN "llavor" ;
|
||||
skin_N = regFN "pell" ; -- fem
|
||||
sky_N = regMN "cel" ;
|
||||
smoke_N = regMN "fum" ;
|
||||
snow_N = regFN "neu" ; -- fem
|
||||
stick_N = regMN "bastó" ;
|
||||
tail_N = regFN "cua" ;
|
||||
tongue_N = regFN "llengua" ;
|
||||
tooth_N = regFN "dent" ;
|
||||
wife_N = regFN "esposa" ;
|
||||
wind_N = regMN "vent" ;
|
||||
wing_N = regFN "ala" ;
|
||||
worm_N = regMN "cuc" ;
|
||||
year_N = regMN "any" ;
|
||||
bite_V2 = dirV2 (verbV (pregar_86 "mossegar")) ;
|
||||
blow_V = regV "bufar" ;
|
||||
burn_V = regV "cremar" ;
|
||||
count_V2 = dirV2 (regV "comptar") ;
|
||||
cut_V2 = dirV2 (regV "tallar") ;
|
||||
dig_V = regV "cavar" ;
|
||||
fall_V = verbV (caure_18 "caure") ;
|
||||
fear_V2 = dirV2 (verbV (témer_107 "témer")) ;
|
||||
fight_V2 = dirV2 (regV "lluitar") ;
|
||||
float_V = regV "surar" ;
|
||||
flow_V = verbV (reduir_94 "fluir") ; -- also: regV "circular"
|
||||
fly_V = regV "volar" ;
|
||||
freeze_V = regV "congelar" ;
|
||||
give_V3 = dirdirV3 (verbV (donar_43 "donar")) ;
|
||||
hit_V2 = dirV2 (verbV (trencar_112 "picar")) ;
|
||||
hold_V2 = dirV2 (verbV (obtenir_78 "sostenir")) ;
|
||||
hunt_V2 = dirV2 (verbV (començar_22 "caçar")) ;
|
||||
kill_V2 = dirV2 (regV "matar") ;
|
||||
laugh_V = verbV (riure_96 "riure") ;
|
||||
lie_V = reflV (verbV (jeure_62 "jeure")) ;
|
||||
play_V = verbV (pregar_86 "jugar") ;
|
||||
pull_V2 = dirV2 (regV "tibar") ;
|
||||
push_V2 = dirV2 (verbV (atènyer_59 "empènyer")) ;
|
||||
rub_V2 = dirV2 (verbV (pregar_86 "refregar")) ;
|
||||
scratch_V2 = dirV2 (regV "gratar") ;
|
||||
sew_V = verbV (cosir_31 "cosir") ;
|
||||
sing_V = regV "cantar" ;
|
||||
sit_V = reflV (verbV (seure_102 "seure")) ;
|
||||
smell_V = regV "ensumar" ;
|
||||
spit_V = verbV (escopir_49 "escopir") ;
|
||||
split_V2 = dirV2 (regV "separar") ; -- dividir,) ;
|
||||
squeeze_V2 = dirV2 (verbV (servir_101 "exprimir")) ;
|
||||
stab_V2 = dirV2 (regV "apunyalar") ;
|
||||
stand_V = verbV (estar_54 "estar") ; ---- "estar dret"
|
||||
suck_V2 = dirV2 (regV "xuclar") ;
|
||||
swell_V = regV "inflar" ;
|
||||
swim_V = regV "nedar" ;
|
||||
think_V = regV "pensar" ;
|
||||
throw_V2 = dirV2 (verbV (començar_22 "llençar")) ;
|
||||
tie_V2 = dirV2 (verbV (pregar_86 "lligar")) ;
|
||||
turn_V = regV "girar" ;
|
||||
vomit_V = regV "vomitar" ;
|
||||
wash_V2 = dirV2 (regV "rentar") ;
|
||||
wipe_V2 = dirV2 (verbV (pregar_86 "eixugar")) ;
|
||||
breathe_V = regV "respirar" ;
|
||||
john_PN = mkPN "Joan" masculine ;
|
||||
today_Adv = mkAdv "avui" ;
|
||||
|
||||
grammar_N = regFN "gramàtica" ;
|
||||
language_N = regFN "llengua" ;
|
||||
rule_N = regFN "regla" ;
|
||||
question_N = regFN "pregunta" ;
|
||||
ready_A = regA "preparat" ;
|
||||
reason_N = regFN "raó" ;
|
||||
uncertain_A = regA "incert" ;
|
||||
|
||||
|
||||
} ;
|
||||
137
lib/src/catalan/MorphoCat.gf
Normal file
137
lib/src/catalan/MorphoCat.gf
Normal file
@@ -0,0 +1,137 @@
|
||||
--# -path=.:../romance:../common:../../prelude
|
||||
|
||||
----1 A Simple Catalan Resource Morphology
|
||||
----
|
||||
---- Aarne Ranta 2002 -- 2005
|
||||
----
|
||||
---- This resource morphology contains definitions needed in the resource
|
||||
---- syntax. To build a lexicon, it is better to use $ParadigmsCat$, which
|
||||
---- gives a higher-level access to this module.
|
||||
--
|
||||
resource MorphoCat = CommonRomance, ResCat **
|
||||
open PhonoCat, Prelude, Predef in {
|
||||
--
|
||||
-- flags optimize=all ;
|
||||
--
|
||||
--
|
||||
----2 Nouns
|
||||
----
|
||||
---- The following macro is useful for creating the forms of number-dependent
|
||||
---- tables, such as common nouns.
|
||||
--
|
||||
oper
|
||||
numForms : (_,_ : Str) -> Number => Str = \vi, vins ->
|
||||
table {Sg => vi ; Pl => vins} ;
|
||||
|
||||
-- For example:
|
||||
|
||||
nomHome : Str -> Number => Str = \home ->
|
||||
numForms home (home + "s") ;
|
||||
|
||||
nomDona : Str -> Number => Str = \dona ->
|
||||
numForms dona (init dona + "es") ;
|
||||
|
||||
nomDisc : Str -> Number => Str = \disc ->
|
||||
numForms disc (variants {disc + "s"; disc + "os"}) ;
|
||||
|
||||
-- nomPilar : Str -> Number => Str = \pilar ->
|
||||
-- numForms pilar (pilar + "es") ;
|
||||
--
|
||||
-- nomTram : Str -> Number => Str = \tram ->
|
||||
-- numForms tram tram ;
|
||||
--
|
||||
-- Common nouns are inflected in number and have an inherent gender.
|
||||
|
||||
mkNoun : (Number => Str) -> Gender -> Noun = \noinois,gen ->
|
||||
{s = noinois ; g = gen} ;
|
||||
|
||||
mkNounIrreg : Str -> Str -> Gender -> Noun = \vi,vins ->
|
||||
mkNoun (numForms vi vins) ;
|
||||
|
||||
mkNomReg : Str -> Noun = \noi ->
|
||||
case last noi of {
|
||||
"o" | "e" => mkNoun (nomHome noi) Masc ;
|
||||
"a" => mkNoun (nomDona noi) Fem ;
|
||||
"c" => mkNoun (nomDisc noi) Masc ;
|
||||
--- "u" => mkNounIrreg mec (init mec + "ces") Fem ;
|
||||
_ => mkNoun (nomHome noi) Masc
|
||||
} ;
|
||||
|
||||
----2 Adjectives
|
||||
----
|
||||
-- Adjectives are conveniently seen as gender-dependent nouns.
|
||||
-- Here are some patterns. First one that describes the worst case.
|
||||
|
||||
mkAdj : (_,_,_,_,_ : Str) -> Adj = \petit,petita,petits,petites,petitament ->
|
||||
{s = table {
|
||||
AF Masc n => numForms petit petits ! n ;
|
||||
AF Fem n => numForms petita petites ! n ;
|
||||
AA => petitament
|
||||
}
|
||||
} ;
|
||||
|
||||
---- Then the regular and invariant patterns.
|
||||
--
|
||||
-- adjfort : Str -> Adj = \solo ->
|
||||
-- let
|
||||
-- sol = Predef.tk 1 solo
|
||||
-- in
|
||||
-- mkAdj solo (sol + "a") (sol + "os") (sol + "as") (sol + "amente") ;
|
||||
--
|
||||
adjFort : Str -> Adj = \fort ->
|
||||
mkAdj fort (fort + "a") (fort + "s") (fort + "es") (fort + "ament") ;
|
||||
--
|
||||
-- adjBlu : Str -> Adj = \blu ->
|
||||
-- mkAdj blu blu blu blu blu ; ---
|
||||
--
|
||||
mkAdjReg : Str -> Adj = \fort -> adjFort fort ;
|
||||
{-
|
||||
case last solo of {
|
||||
"o" => adjSolo solo ;
|
||||
--- "e" => adjUtil solo (solo + "s") ;
|
||||
"a" =>
|
||||
_ => adjUtil solo (solo + "es")
|
||||
} ;
|
||||
-}
|
||||
--
|
||||
----2 Personal pronouns
|
||||
----
|
||||
---- All the eight personal pronouns can be built by the following macro.
|
||||
---- The use of "ne" as atonic genitive is debatable.
|
||||
---- We follow the rule that the atonic nominative is empty.
|
||||
--
|
||||
|
||||
mkPronoun : (_,_,_,_,_,_,_,_ : Str) ->
|
||||
Gender -> Number -> Person -> Pronoun =
|
||||
\il,le,lui,Lui,son,sa,ses,see,g,n,p ->
|
||||
let
|
||||
alui : Case -> Str = \x -> prepCase x ++ Lui ;
|
||||
in {
|
||||
s = table {
|
||||
Nom => {c1 = [] ; c2 = [] ; comp = il ; ton = Lui} ;
|
||||
Acc => {c1 = le ; c2 = [] ; comp = [] ; ton = Lui} ;
|
||||
CPrep P_a => {c1 = [] ; c2 = lui ; comp = [] ; ton = alui (CPrep P_a)} ;
|
||||
c => {c1 = [] ; c2 = [] ; comp, ton = alui c}
|
||||
} ;
|
||||
poss = \\n,g => case <n,g> of {
|
||||
<Sg,Masc> => son ;
|
||||
<Sg,Fem> => sa ;
|
||||
<Pl,Masc> => ses ;
|
||||
<Pl,Fem> => see
|
||||
} ;
|
||||
|
||||
a = {g = g ; n = n ; p = p} ;
|
||||
hasClit = True
|
||||
} ;
|
||||
|
||||
|
||||
--
|
||||
--
|
||||
----2 Determiners
|
||||
----
|
||||
---- Determiners, traditionally called indefinite pronouns, are inflected
|
||||
---- in gender and number, like adjectives.
|
||||
--
|
||||
pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! AF g n ;
|
||||
--
|
||||
}
|
||||
2
lib/src/catalan/NounCat.gf
Normal file
2
lib/src/catalan/NounCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete NounCat of Noun = CatCat ** NounRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
170
lib/src/catalan/NumeralCat.gf
Normal file
170
lib/src/catalan/NumeralCat.gf
Normal file
@@ -0,0 +1,170 @@
|
||||
concrete NumeralCat of Numeral = CatCat **
|
||||
open CommonRomance, ResRomance, MorphoCat, Prelude in {
|
||||
|
||||
--
|
||||
-- gcc M3.5.1, M3.5.2
|
||||
--
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
||||
Sub100 = {s : CardOrd => Str ; n : Number} ;
|
||||
Sub1000 = {s : CardOrd => Str ; n : Number} ;
|
||||
Sub1000000 = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
|
||||
-- Auxiliaries
|
||||
|
||||
oper
|
||||
-- Use cardinal for big ordinals [M3.5.2]
|
||||
cent : Number => CardOrd => Str = \\n,co => case n of {
|
||||
Pl => case co of {
|
||||
NCard Masc => "-cents" ;
|
||||
NCard Fem => "-centes" ;
|
||||
_ => "-cents" ---- variants {} ---- AR 23/6/2008
|
||||
} ;
|
||||
Sg => "cent"
|
||||
} ;
|
||||
cardOrd1 : CardOrd -> (_,_,_:Str) -> Str = \co,dos,dues,segon -> case co of {
|
||||
NCard Masc => dos ;
|
||||
NCard Fem => dues ;
|
||||
NOrd Masc Sg => segon ;
|
||||
NOrd Fem Sg => segon + "a" ;
|
||||
NOrd Masc Pl => segon + "s" ;
|
||||
NOrd Fem Pl => segon + "es"
|
||||
} ;
|
||||
|
||||
|
||||
cardOrdReg : CardOrd -> Str -> Str -> Str = \co,sis,si -> case co of {
|
||||
NCard _ => sis ;
|
||||
NOrd Masc Sg => si + "è" ;
|
||||
NOrd Fem Sg => si + "ena" ;
|
||||
NOrd Masc Pl => si + "ens" ;
|
||||
NOrd Fem Pl => si + "enes"
|
||||
} ;
|
||||
|
||||
cardOrd2 : CardOrd -> Str -> Str = \co,sis -> let si = init sis in
|
||||
case (last sis) of {
|
||||
"e" => cardOrdReg co sis si ;
|
||||
"a" => cardOrdReg co sis si ;
|
||||
"u" => cardOrdReg co sis (si + "v") ;
|
||||
_ => cardOrdReg co sis sis
|
||||
} ;
|
||||
|
||||
cardOrd3 : CardOrd -> (m,f:Str) -> Str = \co,dos,dues -> case co of {
|
||||
NCard Masc => dos ;
|
||||
NCard Fem => dues ;
|
||||
NOrd Masc Sg => dos + "è" ;
|
||||
NOrd Fem Sg => dos + "ena" ;
|
||||
NOrd Masc Pl => dos + "ens" ;
|
||||
NOrd Fem Pl => dos + "enes"
|
||||
} ;
|
||||
|
||||
|
||||
digitPl1 : (u,t,d,dp:Str) -> (fem,ord:Str) -> {s: DForm => CardOrd => Str} = \dos,dotze,vint,vinti,dues,segon -> {
|
||||
s = \\df,co =>
|
||||
case df of {
|
||||
unit => cardOrd1 co dos dues segon ;
|
||||
teen => cardOrd2 co dotze ;
|
||||
ten => cardOrd2 co vint ;
|
||||
tenplus => cardOrd2 co vinti ;
|
||||
_ => cardOrd3 co dos dues
|
||||
}
|
||||
} ;
|
||||
|
||||
digitPl2 : (u,t,d,dp:Str) -> {s: DForm => CardOrd => Str} = \sis,setze,seixanta,seixantai -> {
|
||||
s = \\df,co => case df of {
|
||||
unit => cardOrd2 co sis;
|
||||
teen => cardOrd2 co setze ;
|
||||
ten => cardOrd2 co seixanta ;
|
||||
tenplus => cardOrd2 co seixantai ;
|
||||
_ => cardOrd2 co sis
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
|
||||
n2 = digitPl1 "dos" "dotze" "vint" "vint-i-" "dues" "segon" ;
|
||||
n3 = digitPl1 "tres" "tretze" "trenta" "trenta-" "tres" "tercer" ;
|
||||
n4 = digitPl1 "quatre" "catorze" "quaranta" "quaranta-" "quatre" "quart" ;
|
||||
n5 = digitPl1 "cinc" "quinze" "cinquanta" "cinquanta-" "cinc" "quint" ;
|
||||
n6 = digitPl2 "sis" "setze" "seixanta" "seixanta-" ;
|
||||
n7 = digitPl2 "set" "disset" "setanta" "setanta-" ;
|
||||
n8 = digitPl2 "vuit" "divuit" "vuitanta" "vuitanta-" ;
|
||||
n9 = digitPl2 "nou" "dinou" "noranta" "noranta-" ;
|
||||
|
||||
pot01 = {s= \\df,co =>
|
||||
case df of {
|
||||
unit => cardOrd1 co "un" "una" "primer" ;
|
||||
teen => cardOrd2 co "onze" ;
|
||||
ten => cardOrd2 co "deu" ;
|
||||
tenplus => variants {} ;
|
||||
OrdF => cardOrd2 co "un" ;
|
||||
Aunit => []
|
||||
};
|
||||
n= Sg} ;
|
||||
|
||||
pot0 d = d ** {n= Pl} ;
|
||||
pot110 = {s= \\co => cardOrdReg co "deu" "des"; n= Pl} ;
|
||||
pot111 = {s= \\co => cardOrd2 co "onze"; n= Pl} ;
|
||||
pot1to19 d = {s= \\co => d.s ! teen ! co ; n= Pl} ;
|
||||
pot0as1 n = {s= n.s ! unit; n= n.n} ;
|
||||
pot1 d = {s= \\co => d.s ! ten ! co; n= Pl} ;
|
||||
pot1plus d e =
|
||||
{s= \\co => ((d.s ! tenplus ! (NCard Masc)) ++ (e.s ! OrdF ! co)); n= Pl} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = {s= \\co => (d.s ! Aunit ! co) ++ (cent ! (d.n) ! co); n= Pl} ;
|
||||
pot2plus d n = {
|
||||
s= \\co => (d.s ! Aunit ! co) ++ (cent ! (d.n) ! co) ++ (n.s ! co);
|
||||
n= Pl} ;
|
||||
pot2as3 n = n ;
|
||||
pot3 n = {s= \\co => (table {Sg => []; Pl => (n.s ! co) } ! n.n) ++ "mil"; n= Pl} ;
|
||||
pot3plus n m =
|
||||
{s= \\co => (table {Sg => []; Pl => (n.s ! co)} ! n.n) ++ "mil" ++ (m.s !co);
|
||||
n= Pl} ;
|
||||
|
||||
|
||||
param
|
||||
DForm = unit | teen | ten | tenplus | Aunit | OrdF ;
|
||||
|
||||
-- numerals as sequences of digits
|
||||
|
||||
lincat
|
||||
Dig = TDigit ;
|
||||
|
||||
lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
s = \\o => d.s ! NCard Masc ++ i.s ! o ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk3Dig "1" "1:o" Sg ; ---- gender
|
||||
D_2 = mk2Dig "2" "2:o" ;
|
||||
D_3 = mk2Dig "3" "3:o" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":o") ;
|
||||
|
||||
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||
s = table {NCard _ => c ; NOrd _ _ => o} ; ---- gender
|
||||
n = n
|
||||
} ;
|
||||
|
||||
TDigit = {
|
||||
n : Number ;
|
||||
s : CardOrd => Str
|
||||
} ;
|
||||
|
||||
}
|
||||
454
lib/src/catalan/ParadigmsCat.gf
Normal file
454
lib/src/catalan/ParadigmsCat.gf
Normal file
@@ -0,0 +1,454 @@
|
||||
--# -path=.:../romance:../common:../abstract:../../prelude
|
||||
|
||||
--1 Catalan Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2004 - 2006
|
||||
-- Jordi Saludes 2008: Modified from ParadigmsSpa
|
||||
--
|
||||
-- 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 main difference with $MorphoCat.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string arguments of the paradigms.
|
||||
--
|
||||
-- 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$. For
|
||||
-- verbs, there is a fairly complete list of irregular verbs in
|
||||
-- [``IrregCat`` ../../catalan/IrregCat.gf].
|
||||
|
||||
resource ParadigmsCat =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoCat,
|
||||
BeschCat,
|
||||
CatCat in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
-- Prepositions used in many-argument functions are either strings
|
||||
-- (including the 'accusative' empty string) or strings that
|
||||
-- amalgamate with the following word (the 'genitive' "de" and the
|
||||
-- 'dative' "a").
|
||||
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
mkN : overload {
|
||||
|
||||
-- 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. TODO
|
||||
|
||||
mkN : (llum : Str) -> N ;
|
||||
|
||||
-- A different gender can be forced.
|
||||
|
||||
mkN : Str -> Gender -> N ;
|
||||
|
||||
-- The worst case has two forms (singular + plural) and the gender.
|
||||
|
||||
mkN : (disc,discos : Str) -> Gender -> N
|
||||
} ;
|
||||
|
||||
|
||||
--3 Compound nouns
|
||||
--
|
||||
-- Some nouns are ones where the first part is inflected as a noun but
|
||||
-- the second part is not inflected. e.g. "número de telèfon".
|
||||
-- They could be formed in syntax, but we give a shortcut here since
|
||||
-- they are frequent in lexica.
|
||||
|
||||
compN : N -> Str -> N ;
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
--
|
||||
-- Relational nouns ("filla de x") need a case and a preposition.
|
||||
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
|
||||
-- The most common cases are the genitive "de" and the dative "a",
|
||||
-- with the empty preposition.
|
||||
|
||||
deN2 : N -> N2 ;
|
||||
aN2 : N -> N2 ;
|
||||
|
||||
-- Three-place relational nouns ("la connexió de x a y") need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
--
|
||||
-- In some cases, you may want to make a complex $CN$ into a
|
||||
-- relational noun (e.g. "the old town hall of"). However, $N2$ and
|
||||
-- $N3$ are purely lexical categories. But you can use the $AdvCN$
|
||||
-- and $PrepNP$ constructions to build phrases like this.
|
||||
|
||||
--
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names need a string and a gender.
|
||||
-- The default gender is feminine for names ending with "a", otherwise masculine. TODO
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : (Anna : Str) -> PN ;
|
||||
mkPN : (Pilar : Str) -> Gender -> PN
|
||||
} ;
|
||||
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA : overload {
|
||||
|
||||
-- For regular adjectives, all forms are derived from the
|
||||
-- masculine singular. The types of adjectives that are recognized are
|
||||
-- "alto", "fuerte", "util". Comparison is formed by "mas".
|
||||
|
||||
mkA : (sol : Str) -> A ;
|
||||
|
||||
-- One-place adjectives compared with "mas" need five forms in the worst
|
||||
-- case (masc and fem singular, masc plural, adverbial).
|
||||
|
||||
mkA : (fort,forta,forts,fortes,fortament : Str) -> A ;
|
||||
|
||||
-- In the worst case, two separate adjectives are given:
|
||||
-- the positive ("bo"), and the comparative ("millor").
|
||||
|
||||
mkA : (bo : A) -> (millor : A) -> A
|
||||
} ;
|
||||
|
||||
-- The functions above create postfix adjectives. To switch
|
||||
-- them to prefix ones (i.e. ones placed before the noun in
|
||||
-- modification, as in "gran casa"), the following function is
|
||||
-- provided.
|
||||
-- JS: What about vi bó -> bon vi ?
|
||||
|
||||
prefixA : A -> A ;
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
|
||||
|
||||
|
||||
--2 Adverbs
|
||||
|
||||
-- Adverbs are not inflected. Most lexical ones have position
|
||||
-- after the verb.
|
||||
|
||||
mkAdv : Str -> Adv ;
|
||||
|
||||
-- Some appear next to the verb (e.g. "sempre").
|
||||
|
||||
mkAdV : Str -> AdV ;
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
|
||||
|
||||
--2 Verbs
|
||||
|
||||
mkV : overload {
|
||||
|
||||
-- Regular verbs are ones inflected like "cantar", "perdre", "témer", "perdre", "servir", "dormir"
|
||||
-- The regular verb function works for models I, IIa, IIb and IIa
|
||||
-- The module $BeschCat$ gives the complete set of "Bescherelle" conjugations.
|
||||
|
||||
mkV : (cantar : Str) -> V ;
|
||||
|
||||
-- Verbs with vowel alternatition in the stem - easiest to give with
|
||||
-- two forms, e.g. "mostrar"/"muestro". TODO
|
||||
|
||||
--JS: Needed? mkV : (mostrar,muestro : Str) -> V ;
|
||||
|
||||
-- Most irregular verbs are found in $IrregCat$. If this is not enough,
|
||||
-- the module $BeschCat$ gives all the patterns of the "Bescherelle"
|
||||
-- book. To use them in the category $V$, wrap them with the function
|
||||
|
||||
mkV : Verbum -> V
|
||||
} ;
|
||||
|
||||
-- To form reflexive verbs:
|
||||
|
||||
reflV : V -> V ;
|
||||
|
||||
-- Verbs with a deviant passive participle: just give the participle
|
||||
-- in masculine singular form as second argument.
|
||||
|
||||
special_ppV : V -> Str -> V ;
|
||||
|
||||
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs).
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
} ;
|
||||
|
||||
|
||||
-- You can reuse a $V2$ verb in $V$.
|
||||
|
||||
v2V : V2 -> V ;
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- parlar, a, de
|
||||
dirV3 : V -> Prep -> V3 ; -- donar,(accusative),a
|
||||
dirdirV3 : V -> V3 ; -- donar,(dative),(accusative)
|
||||
|
||||
--3 Other complement patterns
|
||||
--
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "vull parlar"
|
||||
deVV : V -> VV ; -- "acabar de parlar"
|
||||
aVV : V -> VV ; -- "aprendre a parlar"
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
|
||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
||||
-- and the second argument is given
|
||||
-- as an adverb. Likewise
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
|
||||
|
||||
--.
|
||||
--2 The definitions of the paradigms
|
||||
--
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
|
||||
Gender = MorphoCat.Gender ;
|
||||
Number = MorphoCat.Number ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
accusative = complAcc ** {lock_Prep = <>} ;
|
||||
genitive = complGen ** {lock_Prep = <>} ;
|
||||
dative = complDat ** {lock_Prep = <>} ;
|
||||
mkPrep p = {s = p ; c = Acc ; isDir = False ; lock_Prep = <>} ;
|
||||
|
||||
|
||||
mk2N x y g = mkNounIrreg x y g ** {lock_N = <>} ;
|
||||
regN x = mkNomReg x ** {lock_N = <>} ;
|
||||
compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ;
|
||||
femN x = {s = x.s ; g = feminine ; lock_N = <>} ;
|
||||
mascN x = {s = x.s ; g = masculine ; lock_N = <>} ;
|
||||
|
||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
|
||||
deN2 n = mkN2 n genitive ;
|
||||
aN2 n = mkN2 n dative ;
|
||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
|
||||
|
||||
mk2PN x g = {s = x ; g = g} ** {lock_PN = <>} ;
|
||||
regPN x = mk2PN x g where {
|
||||
g = case last x of {
|
||||
"a" => feminine ;
|
||||
_ => masculine
|
||||
}
|
||||
} ;
|
||||
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
|
||||
|
||||
mk5A a b c d e =
|
||||
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;
|
||||
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ;
|
||||
prefA a = {s = a.s ; isPre = True ; lock_A = <>} ;
|
||||
|
||||
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
|
||||
|
||||
mkADeg a b =
|
||||
{s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ;
|
||||
isPre = a.isPre ; lock_A = <>} ;
|
||||
compADeg a =
|
||||
{s = table {Posit => a.s ! Posit ; _ => \\f => "más" ++ a.s ! Posit ! f} ;
|
||||
isPre = a.isPre ;
|
||||
lock_A = <>} ;
|
||||
regADeg a = compADeg (regA a) ;
|
||||
|
||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||
|
||||
regV x = -- cantar, perdre, témer, dormir, (servir)
|
||||
let
|
||||
verb = case (Predef.dp 2 x) of {
|
||||
"re" => perdre_83 x ;
|
||||
"er" => témer_107 x ;
|
||||
"ir" => dormir_44 x ; -- JS TODO: Consider "servir"
|
||||
_ => cantar_15 x
|
||||
}
|
||||
in verbBesch verb ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
|
||||
reflV v = {s = v.s ; vtyp = VRefl ; lock_V = <>} ;
|
||||
|
||||
verbV ve = verbBesch ve ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
|
||||
reflVerbV : Verbum -> V = \ve -> reflV (verbV ve) ;
|
||||
|
||||
special_ppV ve pa = {
|
||||
s = table {
|
||||
VPart g n => (adjFort pa).s ! AF g n ;
|
||||
p => ve.s ! p
|
||||
} ;
|
||||
lock_V = <> ;
|
||||
vtyp = VHabere
|
||||
} ;
|
||||
|
||||
-- regAltV x y = verbV (regAlternV x y) ;
|
||||
|
||||
mk2V2 v p = {s = v.s ; vtyp = v.vtyp ; c2 = p ; lock_V2 = <>} ;
|
||||
dirV2 v = mk2V2 v accusative ;
|
||||
v2V v = v ** {lock_V = <>} ;
|
||||
|
||||
mkV3 v p q = {s = v.s ; vtyp = v.vtyp ;
|
||||
c2 = p ; c3 = q ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v accusative p ;
|
||||
dirdirV3 v = dirV3 v dative ;
|
||||
|
||||
V0 : Type = V ;
|
||||
AS, AV : Type = A ;
|
||||
A2S, A2V : Type = A2 ;
|
||||
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
mkVS v = v ** {m = \\_ => Indic ; lock_VS = <>} ; ---- more moods
|
||||
mkV2S v p = mk2V2 v p ** {mn,mp = Indic ; lock_V2S = <>} ;
|
||||
mkVV v = v ** {c2 = complAcc ; lock_VV = <>} ;
|
||||
deVV v = v ** {c2 = complGen ; lock_VV = <>} ;
|
||||
aVV v = v ** {c2 = complDat ; lock_VV = <>} ;
|
||||
mkV2V v p t = mkV3 v p t ** {lock_V2V = <>} ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
mkV2A v p q = mkV3 v p q ** {lock_V2A = <>} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
mkV2Q v p = mk2V2 v p ** {lock_V2Q = <>} ;
|
||||
|
||||
mkAS v = v ** {lock_AS = <>} ; ---- more moods
|
||||
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
||||
mkAV v p = v ** {c = p.p1 ; s2 = p.p2 ; lock_AV = <>} ;
|
||||
mkA2V v p q = mkA2 v p ** {s3 = q.p2 ; c3 = q.p1 ; lock_A2V = <>} ;
|
||||
|
||||
---
|
||||
|
||||
mkN = overload {
|
||||
mkN : (llum : Str) -> N = regN ;
|
||||
mkN : Str -> Gender -> N = \s,g -> {s = (regN s).s ; g = g ; lock_N = <>};
|
||||
mkN : (disc,discos : Str) -> Gender -> N = mk2N
|
||||
} ;
|
||||
regN : Str -> N ;
|
||||
mk2N : (disc,discos : Str) -> Gender -> N ;
|
||||
mascN : N -> N ;
|
||||
femN : N -> N ;
|
||||
|
||||
|
||||
mkPN = overload {
|
||||
mkPN : (Anna : Str) -> PN = regPN ;
|
||||
mkPN : (Pilar : Str) -> Gender -> PN = mk2PN
|
||||
} ;
|
||||
mk2PN : Str -> Gender -> PN ; -- Joan
|
||||
regPN : Str -> PN ; -- feminine for "-a", otherwise masculine
|
||||
|
||||
-- To form a noun phrase that can also be plural,
|
||||
-- you can use the worst-case function.
|
||||
|
||||
makeNP : Str -> Gender -> Number -> NP ;
|
||||
|
||||
mkA = overload {
|
||||
mkA : (util : Str) -> A = regA ;
|
||||
mkA : (fort,forta,forts,fortes,fortament : Str) -> A = mk5A ;
|
||||
mkA : (bo : A) -> (millor : A) -> A = mkADeg ;
|
||||
} ;
|
||||
|
||||
mk5A : (fort,forta,forts,fortes,fortament : Str) -> A ;
|
||||
regA : Str -> A ;
|
||||
mkADeg : A -> A -> A ;
|
||||
compADeg : A -> A ;
|
||||
regADeg : Str -> A ;
|
||||
prefA : A -> A ;
|
||||
prefixA = prefA ;
|
||||
|
||||
mkV = overload {
|
||||
mkV : (cantar : Str) -> V = regV ;
|
||||
--JS mkV : (mostrar,muestro : Str) -> V = regAltV ;
|
||||
mkV : Verbum -> V = verbV
|
||||
} ;
|
||||
regV : Str -> V ;
|
||||
--JS regAltV : (mostrar,muestro : Str) -> V ;
|
||||
verbV : Verbum -> V ;
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
|
||||
mkV2 : V -> V2 = dirV2 ;
|
||||
mkV2 : V -> Prep -> V2 = mk2V2
|
||||
} ;
|
||||
mk2V2 : V -> Prep -> V2 ;
|
||||
dirV2 : V -> V2 ;
|
||||
|
||||
|
||||
|
||||
} ;
|
||||
49
lib/src/catalan/PhonoCat.gf
Normal file
49
lib/src/catalan/PhonoCat.gf
Normal file
@@ -0,0 +1,49 @@
|
||||
--# -path=../common:prelude
|
||||
|
||||
resource PhonoCat = open Prelude in {
|
||||
|
||||
--3 Elision
|
||||
--
|
||||
-- The phonological rule of *elision* can be defined as follows in GF.
|
||||
-- In Catalan it includes both vowels and 'h'.
|
||||
|
||||
---TODO: L'elisi— depŽn de la tonicitat.
|
||||
|
||||
oper
|
||||
vocal : Strs = strs {
|
||||
"a" ; "ˆ" ;
|
||||
"e" ; "<22>" ; "Ž" ; "o" ; "˜" ; "—" ;
|
||||
"i" ; "’" ; "•" ; "u" ; "œ" ; "Ÿ" ; "h"
|
||||
} ;
|
||||
|
||||
vocalForta : Strs = strs {
|
||||
"a" ; "ˆ" ; "ha" ; "hˆ" ;
|
||||
"e" ; "<22>" ; "Ž" ; "he" ; "h<>" ; "hŽ" ;
|
||||
"o" ; "˜" ; "—" ; "ho" ; "h˜" ; "h—" ;
|
||||
"’" ; "œ" ; "h’" ; "hœ" ;
|
||||
} ;
|
||||
|
||||
vocalFeble : Strs = strs {
|
||||
"i" ; "•" ; "u" ; "Ÿ" ;
|
||||
"hi" ; "h•" ; "hu" ; "hŸ" ;
|
||||
} ;
|
||||
|
||||
|
||||
elisDe = pre { "de" ; "d'" / vocal };
|
||||
elisEl = pre { "el" ; "l'" / vocal } ;
|
||||
elisLa = pre { "la" ; "l'" / vocalForta } ;
|
||||
elisEm = pre { "em" ; "m'" / vocal } ;
|
||||
elisEt = pre { "et" ; "t'" / vocal } ;
|
||||
|
||||
-- AR after pre syntax change 25/5/2009
|
||||
elisEs = pre {
|
||||
vocal => "s'" ;
|
||||
"s" => "se" ;
|
||||
_ => "es"
|
||||
} ;
|
||||
|
||||
--elisEs = pre {
|
||||
-- pre { "es" ; "s'" / vocal} ;
|
||||
-- "se" / strs { "s" } } ;
|
||||
|
||||
}
|
||||
2
lib/src/catalan/PhraseCat.gf
Normal file
2
lib/src/catalan/PhraseCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete PhraseCat of Phrase = CatCat ** PhraseRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
2
lib/src/catalan/QuestionCat.gf
Normal file
2
lib/src/catalan/QuestionCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete QuestionCat of Question = CatCat ** QuestionRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
2
lib/src/catalan/RelativeCat.gf
Normal file
2
lib/src/catalan/RelativeCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete RelativeCat of Relative = CatCat ** RelativeRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
13
lib/src/catalan/ResCat.gf
Normal file
13
lib/src/catalan/ResCat.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
--1 Catalan auxiliary operations.
|
||||
--
|
||||
---- This module contains operations that are needed to make the
|
||||
---- resource syntax work. To define everything that is needed to
|
||||
---- implement $Test$, it moreover contains regular lexical
|
||||
---- patterns needed for $Lex$.
|
||||
|
||||
|
||||
instance ResCat of ResRomance = DiffCat ** open CommonRomance, Prelude in {
|
||||
|
||||
flags optimize=noexpand ;
|
||||
|
||||
} ;
|
||||
2
lib/src/catalan/SentenceCat.gf
Normal file
2
lib/src/catalan/SentenceCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete SentenceCat of Sentence = CatCat ** SentenceRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
168
lib/src/catalan/StructuralCat.gf
Normal file
168
lib/src/catalan/StructuralCat.gf
Normal file
@@ -0,0 +1,168 @@
|
||||
concrete StructuralCat of Structural = CatCat **
|
||||
open PhonoCat, MorphoCat, ParadigmsCat, BeschCat, (X = ConstructX), Prelude in {
|
||||
|
||||
flags optimize=all ; coding=utf8 ;
|
||||
|
||||
lin
|
||||
|
||||
above_Prep = mkPrep "sobre" ;
|
||||
after_Prep = {s = ["després"] ; c = MorphoCat.genitive ; isDir = False} ;
|
||||
all_Predet = {
|
||||
s = \\a,c => prepCase c ++ aagrForms "tot" "tota" "tots" "totes" ! a ;
|
||||
c = Nom
|
||||
} ;
|
||||
almost_AdA, almost_AdN = ss (variants {"quasi"; "gairebé"}) ;
|
||||
always_AdV = ss "sempre" ;
|
||||
although_Subj = ss "benché" ** {m = Conjunct} ;
|
||||
and_Conj = {s1 = [] ; s2 = etConj.s ; n = Pl} ;
|
||||
because_Subj = ss "perque" ** {m = Indic} ;
|
||||
before_Prep = {s = "abans" ; c = MorphoCat.genitive ; isDir = False} ;
|
||||
behind_Prep = {s = "darrera" ; c = MorphoCat.genitive ; isDir = False} ;
|
||||
between_Prep = mkPrep "entre" ;
|
||||
both7and_DConj = {s1,s2 = etConj.s ; n = Pl} ;
|
||||
but_PConj = ss "però" ;
|
||||
by8agent_Prep = mkPrep "per" ;
|
||||
by8means_Prep = mkPrep "mitjançant" ;
|
||||
can8know_VV = mkVV (verbV (saber_99 "saber")) ;
|
||||
can_VV = mkVV (verbV (poder_85 "poder")) ;
|
||||
during_Prep = mkPrep "durant" ; ----
|
||||
either7or_DConj = {s1,s2 = "o" ; n = Sg} ;
|
||||
everybody_NP = makeNP ["tothom"] Masc Sg ;
|
||||
every_Det = {s,sp = \\_,_ => "cada" ; n = Sg ; s2 = []} ;
|
||||
everything_NP = pn2np (mkPN ["tot"] Masc) ;
|
||||
everywhere_Adv = ss ["a tot arreu"] ;
|
||||
few_Det = {
|
||||
s,sp = \\g,c => prepCase c ++ genForms "pocs" "poques" ! g ; n = Pl ; s2 = []} ;
|
||||
--- first_Ord = {s = \\ag => (regA "primer").s ! Posit ! AF ag.g ag.n} ;
|
||||
for_Prep = mkPrep ["per a"] ;
|
||||
from_Prep = complGen ; ---
|
||||
he_Pron =
|
||||
mkPronoun
|
||||
"ell" "lo" "el" "ell"
|
||||
["el seu"] ["la seva"] ["els seus"] ["les seves"]
|
||||
Masc Sg P3 ;
|
||||
here_Adv = mkAdv "aquí" ; -- acÌ
|
||||
here7to_Adv = mkAdv ["cap aquí"] ;
|
||||
here7from_Adv = mkAdv ["d'aquí"] ;
|
||||
how_IAdv = ss "com" ;
|
||||
how8many_IDet =
|
||||
{s = \\g,c => prepCase c ++ genForms "quants" "quantes" ! g ; n = Pl} ;
|
||||
if_Subj = ss "si" ** {m = Indic} ;
|
||||
in8front_Prep = {s = "davant" ; c = MorphoCat.genitive ; isDir = False} ;
|
||||
i_Pron =
|
||||
mkPronoun
|
||||
"jo" "em" "em" "mi"
|
||||
["el meu"] ["la meva"] ["els meus"] ["les meves"]
|
||||
Fem Sg P1 ;
|
||||
in_Prep = mkPrep "en" ;
|
||||
it_Pron =
|
||||
mkPronoun
|
||||
"ell" "lo" "el" "ell"
|
||||
["el seu"] ["la seva"] ["els seus"] ["les seves"]
|
||||
Masc Sg P3 ;
|
||||
less_CAdv = X.mkCAdv "menys" conjThan ; ----
|
||||
many_Det = {
|
||||
s,sp = \\g,c => prepCase c ++ genForms "molts" "moltes" ! g ; n = Pl ; s2 = []} ;
|
||||
more_CAdv = X.mkCAdv "més" conjThan ;
|
||||
most_Predet = {s = \\_,c => prepCase c ++ ["la majoria"] ; c = CPrep P_de} ;
|
||||
much_Det = {
|
||||
s,sp = \\g,c => prepCase c ++ genForms "molt" "molta" ! g ; n = Sg ; s2 = []} ;
|
||||
must_VV = mkVV (verbV (haver_59 "haver" True)) ; -- + of_Prep
|
||||
no_Utt = ss "no" ;
|
||||
on_Prep = mkPrep "sobre" ;
|
||||
--- one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "una" ! g} ;
|
||||
only_Predet = {s = \\_,c => prepCase c ++ "nomÈs" ; c = Nom} ;
|
||||
or_Conj = {s1 = [] ; s2 = "o" ; n = Sg} ;
|
||||
otherwise_PConj = ss "altrament" ;
|
||||
part_Prep = complGen ;
|
||||
please_Voc = ss "sisplau" ;
|
||||
possess_Prep = complGen ;
|
||||
quite_Adv = ss "bastant" ;
|
||||
she_Pron =
|
||||
mkPronoun
|
||||
"ella" "la" "la" "ella"
|
||||
["el seu"] ["la seva"] ["els seus"] ["les seves"]
|
||||
Fem Sg P3 ;
|
||||
so_AdA = ss "tan" ;
|
||||
somebody_NP = pn2np (mkPN ["alg˙"] Masc) ;
|
||||
somePl_Det = {s,sp =
|
||||
\\g,c => prepCase c ++ genForms "alguns" "algunes" ! g ; n = Pl ; s2 = []} ;
|
||||
someSg_Det = {
|
||||
s,sp = \\g,c => prepCase c ++ genForms "algun" "alguna" ! g ; n = Sg ; s2 = []} ;
|
||||
something_NP = pn2np (mkPN ["quelcom"] Masc) ;
|
||||
somewhere_Adv = ss ["a algun lloc"] ;
|
||||
that_Quant =
|
||||
let aquell : ParadigmsCat.Number => ParadigmsCat.Gender => Case => Str = table {
|
||||
Sg => \\g,c => prepCase c ++ genForms "aquell" "aquella" ! g ;
|
||||
Pl => \\g,c => prepCase c ++ genForms "aquells" "aquelles" ! g
|
||||
}
|
||||
in {
|
||||
s = \\_ => aquell ;
|
||||
sp = aquell ;
|
||||
s2 = []
|
||||
} ;
|
||||
there_Adv = mkAdv "allà" ; -- all·
|
||||
there7to_Adv = mkAdv ["cap a allà"] ;
|
||||
there7from_Adv = mkAdv ["d'allà"] ;
|
||||
therefore_PConj = ss ["per tant"] ;
|
||||
they_Pron = mkPronoun
|
||||
"elles" "les" "les" "elles"
|
||||
["el seu"] ["la seva"] ["llurs"] ["llurs"]
|
||||
Fem Pl P3 ;
|
||||
|
||||
this_Quant =
|
||||
let aquest : ParadigmsCat.Number => ParadigmsCat.Gender => Case => Str = table {
|
||||
Sg => \\g,c => prepCase c ++ genForms "aquest" "aquesta" ! g ;
|
||||
Pl => \\g,c => prepCase c ++ genForms "aquests" "aquestes" ! g
|
||||
}
|
||||
in {
|
||||
s = \\_ => aquest ;
|
||||
sp = aquest ;
|
||||
s2 = []
|
||||
} ;
|
||||
through_Prep = mkPrep "mitjançant" ;
|
||||
too_AdA = ss "massa" ;
|
||||
to_Prep = complDat ;
|
||||
under_Prep = mkPrep "sota" ;
|
||||
very_AdA = ss "molt" ;
|
||||
want_VV = mkVV (verbV (voler_120 "voler")) ;
|
||||
we_Pron =
|
||||
mkPronoun
|
||||
"nosaltres" "nos" "nos" "nosaltres"
|
||||
["el nostre"] ["la nostra"] ["els nostres"] ["les nostres"]
|
||||
Fem Pl P1 ;
|
||||
whatSg_IP = {s = \\c => prepCase c ++ ["què"] ; a = aagr Masc Sg} ;
|
||||
whatPl_IP = {s = \\c => prepCase c ++ ["què"] ; a = aagr Masc Pl} ; ---
|
||||
when_IAdv = ss "quan" ;
|
||||
when_Subj = ss "quan" ** {m = Indic} ;
|
||||
where_IAdv = ss "on" ;
|
||||
which_IQuant = {s = table {
|
||||
Sg => \\g,c => prepCase c ++ "quin" ; --per fer: femenÌ quina
|
||||
Pl => \\g,c => prepCase c ++ "quins"
|
||||
}
|
||||
} ; --per fer: femenÌ quines
|
||||
whoPl_IP = {s = \\c => prepCase c ++ "qui" ; a = aagr Fem Pl} ;
|
||||
whoSg_IP = {s = \\c => prepCase c ++ "qui" ; a = aagr Fem Sg} ;
|
||||
why_IAdv = ss ["per quË"] ;
|
||||
without_Prep = mkPrep "sense" ;
|
||||
with_Prep = mkPrep "amb" ;
|
||||
yes_Utt = ss "sí" ;
|
||||
youSg_Pron = mkPronoun
|
||||
"tu" "et" "et" "tu"
|
||||
["el teu"] ["la teva"] ["els teus"] ["les teves"]
|
||||
Fem Sg P2 ;
|
||||
youPl_Pron =
|
||||
mkPronoun
|
||||
"vosaltres" "us" "us" "vosaltres"
|
||||
["el vostre"] ["la vostra"] ["els vostres"] ["les vostres"]
|
||||
Fem Pl P2 ;
|
||||
youPol_Pron =
|
||||
mkPronoun
|
||||
"vosté" "li" "li" "vosté"
|
||||
["el seu"] ["la seva"] ["els seus"] ["les seves"]
|
||||
Fem Pl P2 ;
|
||||
have_V2 = dirV2 (verbV (tenir_108 "tenir")) ;
|
||||
oper
|
||||
etConj : {s : Str ; n : MorphoCat.Number} = {s = "i" } ** {n = Pl} ;
|
||||
|
||||
}
|
||||
4
lib/src/catalan/SymbolCat.gf
Normal file
4
lib/src/catalan/SymbolCat.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:romance:abstract:common
|
||||
|
||||
concrete SymbolCat of Symbol = CatCat ** SymbolRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
2
lib/src/catalan/VerbCat.gf
Normal file
2
lib/src/catalan/VerbCat.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete VerbCat of Verb = CatCat ** VerbRomance with
|
||||
(ResRomance = ResCat) ;
|
||||
Reference in New Issue
Block a user