mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-24 18:28:55 -06:00
Catalan added to wide coverage translator. TerminologyCat, ExtensionsCat, ConstructionsCat, and DocumentationCatFunctor need changes of Spanish words to Catalan ones, and also some general checks.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:../romance:../abstract:../common:../prelude
|
--# -path=.:../romance:../abstract:../common:../api
|
||||||
|
|
||||||
concrete AllCat of AllCatAbs =
|
concrete AllCat of AllCatAbs =
|
||||||
LangCat,
|
LangCat,
|
||||||
|
|||||||
147
lib/src/catalan/ConstructionCat.gf
Normal file
147
lib/src/catalan/ConstructionCat.gf
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
--# -path=alltenses:.:../abstract
|
||||||
|
|
||||||
|
concrete ConstructionCat of Construction = CatCat **
|
||||||
|
open SyntaxCat, SymbolicCat, ParadigmsCat,
|
||||||
|
(L = LexiconCat), (E = ExtraCat), (I = IrregCat), (R = ResCat), (C = CommonRomance),
|
||||||
|
Prelude in {
|
||||||
|
flags coding=utf8 ;
|
||||||
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
hungry_VP = E.ComplCN have_V2 (mkCN (mkN "hambre" feminine)) ;
|
||||||
|
thirsty_VP = E.ComplCN have_V2 (mkCN (mkN "sed" feminine)) ;
|
||||||
|
has_age_VP card = mkVP have_V2 (mkNP <lin Card card : Card> L.year_N) ;
|
||||||
|
|
||||||
|
have_name_Cl x y = mkCl x (mkV2 (reflV (mkV "llamar"))) y ;
|
||||||
|
married_Cl x y = mkCl (lin NP x) L.married_A2 (lin NP y) | mkCl (mkNP and_Conj (lin NP x) (lin NP y)) (mkA "casado") ;
|
||||||
|
|
||||||
|
what_name_QCl x = mkQCl how_IAdv (mkCl (lin NP x) (reflV (mkV "llamar"))) ;
|
||||||
|
how_old_QCl x = mkQCl (mkIP how8many_IDet L.year_N) x have_V2 ;
|
||||||
|
---- how_far_QCl x = mkQCl (lin IAdv (ss "a qué distancia")) (mkCl x I.estar_V) ;
|
||||||
|
|
||||||
|
-- some more things
|
||||||
|
---- weather_adjCl ap = mkCl (mkVP (mkVA I.hacer_V) (lin AP ap)) ;
|
||||||
|
|
||||||
|
is_right_VP = E.ComplCN have_V2 (mkCN (mkN "razón")) ;
|
||||||
|
---- is_wrong_VP = mkVP (mkVA I.estar_V) (mkAP (mkA "equivocado")) ;
|
||||||
|
|
||||||
|
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
||||||
|
|
||||||
|
bottle_of_CN np = mkCN (lin N2 (mkN2 (mkN "botella" feminine) part_Prep)) np ;
|
||||||
|
cup_of_CN np = mkCN (lin N2 (mkN2 (mkN "taza") part_Prep)) np ;
|
||||||
|
glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "copa") part_Prep)) np ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
-- spatial deixis and motion verbs
|
||||||
|
|
||||||
|
where_go_QCl np = mkQCl where_IAdv (mkCl np (mkVP L.go_V)) ;
|
||||||
|
where_come_from_QCl np = mkQCl (lin IAdv (ss "d'où")) (mkCl np (mkVP L.go_V)) ;
|
||||||
|
|
||||||
|
go_here_VP = mkVP (mkVP L.go_V) here_Adv ;
|
||||||
|
come_here_VP = mkVP (mkVP L.come_V) here_Adv ;
|
||||||
|
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "d'ici") ;
|
||||||
|
|
||||||
|
go_there_VP = mkVP (mkVP L.go_V) there_Adv ;
|
||||||
|
come_there_VP = mkVP (mkVP L.come_V) there_Adv ;
|
||||||
|
come_from_there_VP = mkVP (mkVP L.come_V) (mkAdv "de là") ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Weekday = N ;
|
||||||
|
Monthday = NP ;
|
||||||
|
Month = N ;
|
||||||
|
Year = NP ;
|
||||||
|
oper
|
||||||
|
noPrep : Prep = mkPrep [] ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
weekdayPunctualAdv w = lin Adv {s = w.s ! C.Sg} ; -- lundi
|
||||||
|
weekdayHabitualAdv w = SyntaxCat.mkAdv noPrep (mkNP the_Det w) ; -- il lunedí ----
|
||||||
|
weekdayLastAdv w = SyntaxCat.mkAdv noPrep (mkNP the_Det (mkCN (mkA "pasado") w)) ; -- il lunedí scorso
|
||||||
|
weekdayNextAdv w = SyntaxCat.mkAdv noPrep (mkNP the_Det (mkCN (mkA "próximo") w)) ; -- il lunedí prossimo
|
||||||
|
|
||||||
|
monthAdv m = lin Adv {s = "en" ++ m.s ! C.Sg} ; -- in mggio
|
||||||
|
yearAdv y = SyntaxCat.mkAdv (mkPrep "en") y ; ----
|
||||||
|
dayMonthAdv d m = ParadigmsCat.mkAdv ("el" ++ (d.s ! R.Nom).comp ++ m.s ! C.Sg) ; -- le 17 mai
|
||||||
|
monthYearAdv m y = lin Adv {s = "en" ++ m.s ! C.Sg ++ (y.s ! R.Nom).comp} ; -- in maggio 2012
|
||||||
|
dayMonthYearAdv d m y = ParadigmsCat.mkAdv ("el" ++ (d.s ! R.Nom).comp ++ m.s ! C.Sg ++ (y.s ! R.Nom).comp) ; -- il 17 maggio 2013
|
||||||
|
|
||||||
|
intYear = symb ;
|
||||||
|
intMonthday = symb ;
|
||||||
|
|
||||||
|
|
||||||
|
lincat Language = PN ;
|
||||||
|
|
||||||
|
lin InLanguage l = SyntaxCat.mkAdv (mkPrep "en") (mkNP l) ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
weekdayN w = w ;
|
||||||
|
|
||||||
|
weekdayPN w = mkPN w ;
|
||||||
|
monthPN m = mkPN m ;
|
||||||
|
|
||||||
|
languagePN l = l ;
|
||||||
|
|
||||||
|
oper mkLanguage : Str -> PN = \s -> mkPN s ;
|
||||||
|
|
||||||
|
----------------------------------------------
|
||||||
|
---- lexicon of special names
|
||||||
|
|
||||||
|
lin monday_Weekday = mkN "lunes" ;
|
||||||
|
lin tuesday_Weekday = mkN "martes" ;
|
||||||
|
lin wednesday_Weekday = mkN "miércoles" ;
|
||||||
|
lin thursday_Weekday = mkN "jueves" ;
|
||||||
|
lin friday_Weekday = mkN "viernes" ;
|
||||||
|
lin saturday_Weekday = mkN "sábado" ;
|
||||||
|
lin sunday_Weekday = mkN "domingo" ;
|
||||||
|
|
||||||
|
lin january_Month = mkN "enero" ;
|
||||||
|
lin february_Month = mkN "febrero" ;
|
||||||
|
lin march_Month = mkN "marzo" ;
|
||||||
|
lin april_Month = mkN "abril" ;
|
||||||
|
lin may_Month = mkN "mayo" ;
|
||||||
|
lin june_Month = mkN "junio" ;
|
||||||
|
lin july_Month = mkN "julio" ;
|
||||||
|
lin august_Month = mkN "agosto" ;
|
||||||
|
lin september_Month = mkN "septiembre" ;
|
||||||
|
lin october_Month = mkN "octubre" ;
|
||||||
|
lin november_Month = mkN "noviembre" ;
|
||||||
|
lin december_Month = mkN "diciembre" ;
|
||||||
|
|
||||||
|
lin afrikaans_Language = mkLanguage "afrikáans" ;
|
||||||
|
lin amharic_Language = mkLanguage "amárico" ;
|
||||||
|
lin arabic_Language = mkLanguage "árabe" ;
|
||||||
|
lin bulgarian_Language = mkLanguage "búlgaro" ;
|
||||||
|
lin catalan_Language = mkLanguage "catalán" ;
|
||||||
|
lin chinese_Language = mkLanguage "chino" ;
|
||||||
|
lin danish_Language = mkLanguage "danés" ;
|
||||||
|
lin dutch_Language = mkLanguage "neerlandés" ;
|
||||||
|
lin english_Language = mkLanguage "inglés" ;
|
||||||
|
lin estonian_Language = mkLanguage "estone" ;
|
||||||
|
lin finnish_Language = mkLanguage "finés" ;
|
||||||
|
lin french_Language = mkLanguage "francés" ;
|
||||||
|
lin german_Language = mkLanguage "alemán" ;
|
||||||
|
lin greek_Language = mkLanguage "griego" ;
|
||||||
|
lin hebrew_Language = mkLanguage "ebreo" ;
|
||||||
|
lin hindi_Language = mkLanguage "hindi" ;
|
||||||
|
lin japanese_Language = mkLanguage "japonés" ;
|
||||||
|
lin italian_Language = mkLanguage "italiano" ;
|
||||||
|
lin latin_Language = mkLanguage "latín" ;
|
||||||
|
lin latvian_Language = mkLanguage "letón" ;
|
||||||
|
lin maltese_Language = mkLanguage "maltés" ;
|
||||||
|
lin nepali_Language = mkLanguage "nepalí" ;
|
||||||
|
lin norwegian_Language = mkLanguage "noruego" ;
|
||||||
|
lin persian_Language = mkLanguage "persa" ;
|
||||||
|
lin polish_Language = mkLanguage "polaco" ;
|
||||||
|
lin punjabi_Language = mkLanguage "punjabi" ;
|
||||||
|
lin romanian_Language = mkLanguage "rumano" ;
|
||||||
|
lin russian_Language = mkLanguage "ruso" ;
|
||||||
|
lin sindhi_Language = mkLanguage "sindhi" ;
|
||||||
|
lin spanish_Language = mkLanguage "español" ;
|
||||||
|
lin swahili_Language = mkLanguage "swahili" ;
|
||||||
|
lin swedish_Language = mkLanguage "sueco" ;
|
||||||
|
lin thai_Language = mkLanguage "tailandés" ;
|
||||||
|
lin turkish_Language = mkLanguage "turco" ;
|
||||||
|
lin urdu_Language = mkLanguage "urdu" ;
|
||||||
|
|
||||||
|
}
|
||||||
6
lib/src/catalan/DocumentationCat.gf
Normal file
6
lib/src/catalan/DocumentationCat.gf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
-- documentation of Catalan in Catalan: the default introduced in LangCat
|
||||||
|
|
||||||
|
concrete DocumentationCat of Documentation = CatCat **
|
||||||
|
DocumentationCatFunctor with (Terminology = TerminologyCat) ;
|
||||||
219
lib/src/catalan/DocumentationCatFunctor.gf
Normal file
219
lib/src/catalan/DocumentationCatFunctor.gf
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
incomplete concrete DocumentationCatFunctor of Documentation = CatCat ** open
|
||||||
|
Terminology, -- the interface to be instantiated
|
||||||
|
ResCat,
|
||||||
|
CommonRomance,
|
||||||
|
ParadigmsCat,
|
||||||
|
(G = GrammarCat),
|
||||||
|
(S = SyntaxCat),
|
||||||
|
(L = LexiconCat),
|
||||||
|
Prelude,
|
||||||
|
HTML
|
||||||
|
in {
|
||||||
|
flags coding=utf8 ;
|
||||||
|
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Inflection = {t : Str; s1,s2 : Str} ;
|
||||||
|
Document = {s : Str} ;
|
||||||
|
Tag = {s : Str} ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
-} --# notpresent
|
||||||
|
|
||||||
|
oper
|
||||||
|
heading : N -> Str = \n -> (nounHeading n).s ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
InflectionN, InflectionN3, InflectionN3 = \noun -> {
|
||||||
|
t = "n" ;
|
||||||
|
s1 = heading1 (heading noun_Category ++
|
||||||
|
case noun.g of {
|
||||||
|
Masc => "("+heading masculine_Parameter+")" ;
|
||||||
|
Fem => "("+heading feminine_Parameter+")"
|
||||||
|
}) ;
|
||||||
|
s2 = frameTable (
|
||||||
|
tr (th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
|
||||||
|
tr (td (noun.s ! Sg) ++ td (noun.s ! Pl))
|
||||||
|
)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionA, InflectionA2 = \adj -> {
|
||||||
|
t = "a" ;
|
||||||
|
s1 = heading1 (nounHeading adjective_Category).s ;
|
||||||
|
s2 = frameTable (
|
||||||
|
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
|
||||||
|
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (AF Masc Sg)) ++ td (adj.s ! Posit ! (AF Masc Pl))) ++
|
||||||
|
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (AF Fem Sg)) ++ td (adj.s ! Posit ! (AF Fem Pl)))
|
||||||
|
)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionAdv adv = {
|
||||||
|
t = "adv" ;
|
||||||
|
s1 = heading1 "Adverbe" ;
|
||||||
|
s2 = paragraph adv.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionPrep p = {
|
||||||
|
t = "prep" ;
|
||||||
|
s1 = heading1 "Préposition" ;
|
||||||
|
s2 = paragraph p.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 (heading verb_Category) ++
|
||||||
|
paragraph (verbExample (S.mkCl S.she_NP v)) ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2 v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 (heading verb_Category) ++
|
||||||
|
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV3 v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 (heading verb_Category) ++
|
||||||
|
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2V v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 (heading verb_Category) ++
|
||||||
|
paragraph (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V)))) ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2S v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 (heading verb_Category) ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2Q v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 (heading verb_Category) ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2A v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVV v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 (heading verb_Category) ++
|
||||||
|
paragraph (verbExample (S.mkCl S.she_NP v (S.mkVP (L.sleep_V)))) ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVS v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVQ v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVA v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
MkDocument b i e = ss (i.s1 ++ paragraph b.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||||
|
MkTag i = ss i.t ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
verbExample : CatCat.Cl -> Str = \cl ->
|
||||||
|
(S.mkUtt cl).s
|
||||||
|
++ ";" ++ (S.mkUtt (S.mkS S.anteriorAnt cl)).s --# notpresent
|
||||||
|
;
|
||||||
|
|
||||||
|
inflVerb : Verb -> Str = \verb ->
|
||||||
|
let
|
||||||
|
vfin : CommonRomance.VF -> Str = \f ->
|
||||||
|
verb.s ! f ;
|
||||||
|
|
||||||
|
ttable : TMood -> Str = \tense ->
|
||||||
|
frameTable (
|
||||||
|
tr (th "" ++
|
||||||
|
th (heading singular_Parameter) ++
|
||||||
|
th (heading plural_Parameter)) ++
|
||||||
|
tr (th "1.p" ++
|
||||||
|
td (vfin (VFin tense Sg P1)) ++
|
||||||
|
td (vfin (VFin tense Pl P1))) ++
|
||||||
|
tr (th "2.p" ++
|
||||||
|
td (vfin (VFin tense Sg P2)) ++
|
||||||
|
td (vfin (VFin tense Pl P2))) ++
|
||||||
|
tr (th "3.p" ++
|
||||||
|
td (vfin (VFin tense Sg P3)) ++
|
||||||
|
td (vfin (VFin tense Pl P3)))
|
||||||
|
) ;
|
||||||
|
|
||||||
|
ttable2 : (Mood -> TMood) -> Str = \f ->
|
||||||
|
frameTable (
|
||||||
|
tr (intagAttr "th" "colspan=2" "" ++
|
||||||
|
th (heading indicative_Parameter) ++
|
||||||
|
th (heading conjunctive_Parameter)) ++
|
||||||
|
tr (intagAttr "th" "rowspan=3" (heading singular_Parameter) ++
|
||||||
|
th "1.p" ++
|
||||||
|
td (vfin (VFin (f Indic) Sg P1)) ++
|
||||||
|
td (vfin (VFin (f Conjunct) Sg P1))) ++
|
||||||
|
tr (th "2.p" ++
|
||||||
|
td (vfin (VFin (f Indic) Sg P2)) ++
|
||||||
|
td (vfin (VFin (f Conjunct) Sg P2))) ++
|
||||||
|
tr (th "3.p" ++
|
||||||
|
td (vfin (VFin (f Indic) Sg P3)) ++
|
||||||
|
td (vfin (VFin (f Conjunct) Sg P3))) ++
|
||||||
|
tr (intagAttr "th" "rowspan=3" (heading plural_Parameter) ++
|
||||||
|
th "1.p" ++
|
||||||
|
td (vfin (VFin (f Indic) Pl P1)) ++
|
||||||
|
td (vfin (VFin (f Conjunct) Pl P1))) ++
|
||||||
|
tr (th "2.p" ++
|
||||||
|
td (vfin (VFin (f Indic) Pl P2)) ++
|
||||||
|
td (vfin (VFin (f Conjunct) Pl P2))) ++
|
||||||
|
tr (th "3.p" ++
|
||||||
|
td (vfin (VFin (f Indic) Pl P3)) ++
|
||||||
|
td (vfin (VFin (f Conjunct) Pl P3)))
|
||||||
|
) ;
|
||||||
|
|
||||||
|
in heading2 (heading present_Parameter) ++
|
||||||
|
ttable2 VPres ++
|
||||||
|
heading2 (heading imperfect_Parameter) ++
|
||||||
|
ttable2 VImperf
|
||||||
|
++ heading2 (heading simple_past_Parameter) ++ --# notpresent
|
||||||
|
ttable VPasse --# notpresent
|
||||||
|
++ heading2 (heading future_Parameter) ++ --# notpresent
|
||||||
|
ttable VFut --# notpresent
|
||||||
|
++ heading2 (heading conditional_Parameter) ++ --# notpresent
|
||||||
|
ttable VCondit --# notpresent
|
||||||
|
++ heading2 (heading infinitive_Parameter) ++
|
||||||
|
paragraph (vfin (VInfin False)) ++
|
||||||
|
heading2 (heading imperative_Parameter) ++
|
||||||
|
frameTable (
|
||||||
|
tr (th "sg.2.p" ++ td (vfin (VImper SgP2))) ++
|
||||||
|
tr (th "pl.1.p" ++ td (vfin (VImper PlP1))) ++
|
||||||
|
tr (th "pl.2.p" ++ td (vfin (VImper PlP2)))
|
||||||
|
) ++
|
||||||
|
heading2 (heading participle_Parameter) ++
|
||||||
|
frameTable (
|
||||||
|
tr (th (heading past_Parameter) ++ td (vfin (VPart Masc Sg))) ++
|
||||||
|
tr (th (heading present_Parameter) ++ td (vfin VGer))
|
||||||
|
) ;
|
||||||
|
|
||||||
|
{- --# notpresent
|
||||||
|
-}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
--# -path=.:../romance:../abstract:../common:../prelude
|
--# -path=.:../romance:../abstract:../common:../api
|
||||||
|
|
||||||
concrete LangCat of Lang =
|
concrete LangCat of Lang =
|
||||||
GrammarCat,
|
GrammarCat,
|
||||||
LexiconCat
|
LexiconCat
|
||||||
|
,DocumentationCat --# notpresent
|
||||||
|
,ConstructionCat
|
||||||
** {
|
** {
|
||||||
|
|
||||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
flags startcat = Phr ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ oper
|
|||||||
|
|
||||||
mkPN : overload {
|
mkPN : overload {
|
||||||
mkPN : (Anna : Str) -> PN ; -- feminine for "-a", otherwise masculine
|
mkPN : (Anna : Str) -> PN ; -- feminine for "-a", otherwise masculine
|
||||||
mkPN : (Pilar : Str) -> Gender -> PN -- force gender
|
mkPN : (Pilar : Str) -> Gender -> PN ; -- force gender
|
||||||
|
mkPN : N -> PN ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -477,7 +478,8 @@ oper
|
|||||||
|
|
||||||
mkPN = overload {
|
mkPN = overload {
|
||||||
mkPN : (Anna : Str) -> PN = regPN ;
|
mkPN : (Anna : Str) -> PN = regPN ;
|
||||||
mkPN : (Pilar : Str) -> Gender -> PN = mk2PN
|
mkPN : (Pilar : Str) -> Gender -> PN = mk2PN ;
|
||||||
|
mkPN : N -> PN = \n -> lin PN {s = n.s ! Sg ; g = n.g} ;
|
||||||
} ;
|
} ;
|
||||||
mk2PN : Str -> Gender -> PN ; -- Joan
|
mk2PN : Str -> Gender -> PN ; -- Joan
|
||||||
regPN : Str -> PN ; -- feminine for "-a", otherwise masculine
|
regPN : Str -> PN ; -- feminine for "-a", otherwise masculine
|
||||||
|
|||||||
68
lib/src/catalan/TerminologyCat.gf
Normal file
68
lib/src/catalan/TerminologyCat.gf
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
|
concrete TerminologyCat of Terminology = CatCat ** open
|
||||||
|
ResCat,
|
||||||
|
CommonRomance,
|
||||||
|
ParadigmsCat,
|
||||||
|
(G = GrammarCat),
|
||||||
|
(S = SyntaxCat),
|
||||||
|
(L = LexiconCat),
|
||||||
|
Prelude
|
||||||
|
|
||||||
|
in {
|
||||||
|
flags coding=utf8 ;
|
||||||
|
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Category = G.N ;
|
||||||
|
ParameterType = G.N ;
|
||||||
|
Parameter = G.N ;
|
||||||
|
|
||||||
|
Heading = {s : Str} ;
|
||||||
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
noun_Category = mkN "sustantivo" ;
|
||||||
|
adjective_Category = mkN "adjetivo" ;
|
||||||
|
verb_Category = mkN "verbo" masculine ;
|
||||||
|
|
||||||
|
gender_ParameterType = mkN "género" masculine ;
|
||||||
|
|
||||||
|
singular_Parameter = mkN "singular" ;
|
||||||
|
plural_Parameter = mkN "plural" ;
|
||||||
|
|
||||||
|
masculine_Parameter = mkN "masculino" ;
|
||||||
|
feminine_Parameter = mkN "femenino" ;
|
||||||
|
neuter_Parameter = mkN "neutro" ;
|
||||||
|
|
||||||
|
nominative_Parameter = mkN "nominativo" ;
|
||||||
|
genitive_Parameter = mkN "genitivo" ;
|
||||||
|
dative_Parameter = mkN "dativo" ;
|
||||||
|
accusative_Parameter = mkN "accusativo" ;
|
||||||
|
|
||||||
|
imperative_Parameter = mkN "imperativo" ;
|
||||||
|
indicative_Parameter = mkN "indicativo" ;
|
||||||
|
conjunctive_Parameter = mkN "subjuntivo" ;
|
||||||
|
infinitive_Parameter = mkN "infinitivo" ;
|
||||||
|
|
||||||
|
present_Parameter = mkN "presente" ;
|
||||||
|
past_Parameter = mkN "pretérito" ;
|
||||||
|
future_Parameter = mkN "futuro" ;
|
||||||
|
conditional_Parameter = mkN "condicional" ;
|
||||||
|
perfect_Parameter = mkN "perfecto compuesto" ; ----
|
||||||
|
imperfect_Parameter = mkN "imperfecto" ;
|
||||||
|
simple_past_Parameter = mkN "perfecto simple" ; ----
|
||||||
|
|
||||||
|
participle_Parameter = mkN "participio" ;
|
||||||
|
aux_verb_Parameter = mkN "auxiliar" ; ----
|
||||||
|
|
||||||
|
positive_Parameter = mkN "positivo" ;
|
||||||
|
comparative_Parameter = mkN "comparativo" ;
|
||||||
|
superlative_Parameter = mkN "superlativo" ;
|
||||||
|
predicative_Parameter = mkN "predicativo" ;
|
||||||
|
|
||||||
|
nounHeading n = ss (n.s ! Sg) ;
|
||||||
|
|
||||||
|
exampleGr_N = mkN "ejemplo" masculine ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,6 +7,6 @@ concrete LangSpa of Lang =
|
|||||||
,ConstructionSpa
|
,ConstructionSpa
|
||||||
** {
|
** {
|
||||||
|
|
||||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
flags startcat = Phr ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
139
lib/src/translator/ExtensionsCat.gf
Normal file
139
lib/src/translator/ExtensionsCat.gf
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
concrete ExtensionsCat of Extensions =
|
||||||
|
CatCat **
|
||||||
|
open
|
||||||
|
PhonoCat, MorphoCat, ResCat, CommonRomance, ParadigmsCat, SyntaxCat, Prelude, (G = GrammarCat), (E = ExtraCat) in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
VPI = E.VPI ;
|
||||||
|
---- ListVPI = E.ListVPI ;
|
||||||
|
VPS = E.VPS ;
|
||||||
|
---- ListVPS = E.ListVPS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
MkVPI = E.MkVPI ;
|
||||||
|
---- ConjVPI = E.ConjVPI ;
|
||||||
|
---- ComplVPIVV = E.ComplVPIVV ;
|
||||||
|
|
||||||
|
MkVPS = E.MkVPS ;
|
||||||
|
---- ConjVPS = E.ConjVPS ;
|
||||||
|
PredVPS = E.PredVPS ;
|
||||||
|
|
||||||
|
---- BaseVPI = E.BaseVPI ;
|
||||||
|
---- ConsVPI = E.ConsVPI ;
|
||||||
|
---- BaseVPS = E.BaseVPS ;
|
||||||
|
---- ConsVPS = E.ConsVPS ;
|
||||||
|
|
||||||
|
---- GenIP = E.GenIP ;
|
||||||
|
---- GenRP = E.GenRP ;
|
||||||
|
|
||||||
|
PassVPSlash = E.PassVPSlash ;
|
||||||
|
PassAgentVPSlash = E.PassAgentVPSlash ;
|
||||||
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
GenNP np =
|
||||||
|
let denp = (np.s ! ResCat.genitive).ton in {
|
||||||
|
s = \\_,_,_,_ => [] ;
|
||||||
|
sp = \\_,_,_ => denp ;
|
||||||
|
s2 = denp ;
|
||||||
|
isNeg = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
EmptyRelSlash slash = mkRCl which_RP (lin ClSlash slash) ;
|
||||||
|
|
||||||
|
that_RP = which_RP ;
|
||||||
|
|
||||||
|
but_Subj = {s = "pero" ; m = Indic} ; ---- strange to have this as Subj
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
CompoundN noun cn = {
|
||||||
|
s = \\n => cn.s ! n ++ "de" ++ noun.s ! Sg ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompoundAP noun adj = {
|
||||||
|
s = \\af => adj.s ! Posit ! af ++ "de" ++ noun.s ! Sg ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
GerundN v = {
|
||||||
|
s = \\n,c => v.s ! VPresPart ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundAP v = {
|
||||||
|
s = \\agr => v.s ! VPresPart ;
|
||||||
|
isPre = True
|
||||||
|
} ;
|
||||||
|
-- }
|
||||||
|
|
||||||
|
PastPartAP v = {
|
||||||
|
s = table {
|
||||||
|
AF g n => v.s ! VPart g n ;
|
||||||
|
_ => v.s ! VPart Masc Sg ---- the adverb form
|
||||||
|
} ;
|
||||||
|
isPre = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--{-
|
||||||
|
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
PositAdVAdj a = {s = a.s ! Posit ! AA} ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
UseQuantPN q pn = {s = \\c => q.s ! False ! Sg ++ pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ;
|
||||||
|
|
||||||
|
SlashV2V v ant p vp = insertObjc (\\a => v.c3 ++ ant.s ++ p.s ++
|
||||||
|
infVP v.typ vp ant.a p.p a)
|
||||||
|
(predVc v) ;
|
||||||
|
|
||||||
|
SlashVPIV2V v p vpi = insertObjc (\\a => p.s ++
|
||||||
|
v.c3 ++
|
||||||
|
vpi.s ! VVAux ! a)
|
||||||
|
(predVc v) ;
|
||||||
|
-}
|
||||||
|
ComplVV v a p vp =
|
||||||
|
insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v) ; ---- a,p
|
||||||
|
|
||||||
|
---- TODO: find proper expressions for OSV and OVS in Cat
|
||||||
|
PredVPosv np vp = mkCl (lin NP np) (lin VP vp) ;
|
||||||
|
PredVPovs np vp = mkCl (lin NP np) (lin VP vp) ;
|
||||||
|
|
||||||
|
|
||||||
|
CompS s = {s = \\_ => "de" ++ "que" ++ s.s ! Indic} ; ---- de ?
|
||||||
|
|
||||||
|
{-
|
||||||
|
CompQS qs = {s = \\_ => qs.s ! QIndir} ;
|
||||||
|
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
|
||||||
|
infVP VVInf vp ant.a p.p a} ;
|
||||||
|
|
||||||
|
VPSlashVS vs vp =
|
||||||
|
insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs) **
|
||||||
|
{c2 = ""; gapInMiddle = False} ;
|
||||||
|
|
||||||
|
PastPartRS ant pol vps = {
|
||||||
|
s = \\agr => vps.ad ++ vps.ptp ++ vps.s2 ! agr ;
|
||||||
|
c = npNom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PresPartRS ant pol vp = {
|
||||||
|
s = \\agr => vp.ad ++ vp.prp ++ vp.s2 ! agr ;
|
||||||
|
c = npNom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ApposNP np1 np2 = {
|
||||||
|
s = \\c => np1.s ! c ++ "," ++ np2.s ! npNom ;
|
||||||
|
a = np1.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdAdV = cc2 ;
|
||||||
|
|
||||||
|
UttAdV adv = adv;
|
||||||
|
-}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
35
lib/src/translator/TranslateCat.gf
Normal file
35
lib/src/translator/TranslateCat.gf
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
--# -path=.:../chunk:alltenses
|
||||||
|
|
||||||
|
concrete TranslateCat of Translate =
|
||||||
|
TenseCat,
|
||||||
|
NounCat - [
|
||||||
|
PPartNP
|
||||||
|
],
|
||||||
|
AdjectiveCat,
|
||||||
|
NumeralCat,
|
||||||
|
SymbolCat [
|
||||||
|
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
|
||||||
|
],
|
||||||
|
ConjunctionCat,
|
||||||
|
VerbCat - [
|
||||||
|
UseCopula,
|
||||||
|
PassV2 -- generalized in Extensions
|
||||||
|
],
|
||||||
|
AdverbCat,
|
||||||
|
PhraseCat,
|
||||||
|
SentenceCat,
|
||||||
|
QuestionCat,
|
||||||
|
RelativeCat,
|
||||||
|
IdiomCat,
|
||||||
|
|
||||||
|
ChunkCat,
|
||||||
|
ExtensionsCat [CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP],
|
||||||
|
|
||||||
|
DictionaryCat **
|
||||||
|
open MorphoCat, ResCat, ParadigmsCat, SyntaxCat, (E = ExtraCat), (G = GrammarCat), Prelude in {
|
||||||
|
|
||||||
|
flags
|
||||||
|
literal=Symb ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user