forked from GitHub/gf-core
interlingua resource
This commit is contained in:
40
lib/resource/interlingua/AdjectiveIna.gf
Normal file
40
lib/resource/interlingua/AdjectiveIna.gf
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
concrete AdjectiveIna of Adjective = CatIna ** open ResIna, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
PositA a = {
|
||||||
|
s = \\_ => a.s ! AAdj Posit ;
|
||||||
|
-- isPre = a.isPre -- TODO: support adjectives that can be optionally placed before.
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComparA a np = {
|
||||||
|
s = \\_ => a.s ! AAdj Compar ++ "que" ++ np.s ! Nom ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
|
ComplA2 a np = {
|
||||||
|
s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflA2 a = {
|
||||||
|
s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
SentAP ap sc = {
|
||||||
|
s = \\a => ap.s ! a++ sc.s ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdAP ada ap = {
|
||||||
|
s = \\a => ada.s ++ ap.s ! a;
|
||||||
|
isPre = ap.isPre
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseA2 a = a ;
|
||||||
|
|
||||||
|
}
|
||||||
22
lib/resource/interlingua/AdverbIna.gf
Normal file
22
lib/resource/interlingua/AdverbIna.gf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
concrete AdverbIna of Adverb = CatIna ** open ResIna, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PositAdvAdj a = {s = a.s ! AAdv} ;
|
||||||
|
PrepNP prep np = {s = prep.s ++ np.s ! Acc} ;
|
||||||
|
|
||||||
|
ComparAdvAdj cadv a np = {
|
||||||
|
s = cadv.s ++ a.s ! AAdv ++ "que" ++ np.s ! Nom
|
||||||
|
} ;
|
||||||
|
ComparAdvAdjS cadv a s = {
|
||||||
|
s = cadv.s ++ a.s ! AAdv ++ "que" ++ s.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
AdAdv = cc2 ;
|
||||||
|
|
||||||
|
SubjS = cc2 ;
|
||||||
|
AdvSC s = s ; --- ??? Not sure what this means
|
||||||
|
|
||||||
|
AdnCAdv cadv = {s = cadv.s ++ "que"} ;
|
||||||
|
|
||||||
|
}
|
||||||
79
lib/resource/interlingua/CatIna.gf
Normal file
79
lib/resource/interlingua/CatIna.gf
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
concrete CatIna of Cat = CommonX ** open ResIna, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
|
||||||
|
-- Tensed/Untensed
|
||||||
|
|
||||||
|
S = {s : Str} ;
|
||||||
|
QS = {s : Order => Str} ; -- order is necessary to embed a "semantical" question into other propositions.
|
||||||
|
RS = {s : Agr => Str} ;
|
||||||
|
SlashS = SS ** {p2 : Str; c2 : Case} ;
|
||||||
|
|
||||||
|
-- Sentence
|
||||||
|
|
||||||
|
Cl = ResIna.Clause;
|
||||||
|
Slash = ResIna.Clause ** {p2 : Str; c2 : Case} ;
|
||||||
|
Imp = {s : Polarity => Number => Str} ;
|
||||||
|
|
||||||
|
-- Question
|
||||||
|
|
||||||
|
QCl = ResIna.Clause;
|
||||||
|
IP = {s : Case => Str; n : Number} ;
|
||||||
|
IComp = {s : Str} ;
|
||||||
|
IDet = {s : Str ; n : Number} ;
|
||||||
|
|
||||||
|
-- Relative
|
||||||
|
|
||||||
|
RCl = {s : ResIna.Tense => Anteriority => Polarity => Agr => Str ; c : Case} ;
|
||||||
|
RP = {s : Case => Str; a : Agr} ; -- number for "tal que / tales que"; person for reflexives
|
||||||
|
|
||||||
|
-- Verb
|
||||||
|
|
||||||
|
VP = ResIna.VP;
|
||||||
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
|
-- Adjective
|
||||||
|
|
||||||
|
AP = {s : Agr => Str ; isPre : Bool} ;
|
||||||
|
|
||||||
|
-- Noun
|
||||||
|
|
||||||
|
CN = {s : Number => Str} ;
|
||||||
|
NP = ResIna.NP;
|
||||||
|
Pron = ResIna.NP ** {possForm : Str};
|
||||||
|
Det = {s : Case => Str ; n : Number} ;
|
||||||
|
Predet, Ord = {s : Str};
|
||||||
|
Num = {s : Str; n : Number } ;
|
||||||
|
Quant = {s : Number => Case => Str} ;
|
||||||
|
|
||||||
|
-- Numeral
|
||||||
|
|
||||||
|
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
Digits = {s : CardOrd => Str ; n : Number ; tail : DTail} ;
|
||||||
|
|
||||||
|
-- Structural
|
||||||
|
|
||||||
|
Conj = {s : Str ; n : Number} ;
|
||||||
|
DConj = {s1,s2 : Str ; n : Number} ;
|
||||||
|
Subj = {s : Str} ;
|
||||||
|
Prep = {c : Case; s : Str} ;
|
||||||
|
|
||||||
|
-- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
|
V, VS, VQ, VA = Verb ;
|
||||||
|
V2 = Verb ** {p2 : Str; c2 : Case} ; -- preposition + case of the complement.
|
||||||
|
V3, V2A = Verb ** {p2, p3 : Str; c2, c3 : Case} ;
|
||||||
|
VV = Verb;
|
||||||
|
|
||||||
|
A = {s : AForm => Str} ; -- TODO: optional pre-adjectives
|
||||||
|
A2 = {s : AForm => Str ; c2 : Str} ;
|
||||||
|
|
||||||
|
N = {s : Number => Str} ;
|
||||||
|
N2 = {s : Number => Str} ** {p2 : Str; c2 : Case} ;
|
||||||
|
N3 = {s : Number => Str} ** {p2,p3 : Str; c2,c3 : Case} ;
|
||||||
|
|
||||||
|
PN = {s : Str} ;
|
||||||
|
|
||||||
|
}
|
||||||
47
lib/resource/interlingua/ConjunctionIna.gf
Normal file
47
lib/resource/interlingua/ConjunctionIna.gf
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
concrete ConjunctionIna of Conjunction =
|
||||||
|
CatIna ** open ResIna, Coordination, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
ConjS = conjunctSS ;
|
||||||
|
DConjS = conjunctDistrSS ;
|
||||||
|
|
||||||
|
ConjAdv = conjunctSS ;
|
||||||
|
DConjAdv = conjunctDistrSS ;
|
||||||
|
|
||||||
|
ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||||
|
isPronoun = False;
|
||||||
|
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||||
|
} ;
|
||||||
|
DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||||
|
isPronoun = False;
|
||||||
|
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjAP conj ss = conjunctTable Agr conj ss ** {
|
||||||
|
isPre = ss.isPre
|
||||||
|
} ;
|
||||||
|
DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
|
||||||
|
isPre = ss.isPre
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- These fun's are generated from the list cat's.
|
||||||
|
|
||||||
|
BaseS = twoSS ;
|
||||||
|
ConsS = consrSS comma ;
|
||||||
|
BaseAdv = twoSS ;
|
||||||
|
ConsAdv = consrSS comma ;
|
||||||
|
BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||||
|
ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||||
|
BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
|
||||||
|
ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
[S] = {s1,s2 : Str} ;
|
||||||
|
[Adv] = {s1,s2 : Str} ;
|
||||||
|
[NP] = {s1,s2 : Case => Str ; a : Agr} ;
|
||||||
|
[AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
|
||||||
|
|
||||||
|
}
|
||||||
52
lib/resource/interlingua/ExtraIna.gf
Normal file
52
lib/resource/interlingua/ExtraIna.gf
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
concrete ExtraIna of ExtraInaAbs = CatIna **
|
||||||
|
open ResIna, Coordination, Prelude in {
|
||||||
|
--
|
||||||
|
-- lin
|
||||||
|
-- GenNP np = {s = \\_ => np.s ! Gen} ;
|
||||||
|
-- ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
|
||||||
|
--
|
||||||
|
-- StrandRelSlash rp slash = {
|
||||||
|
-- s = \\t,a,p,_ => rp.s ! RC Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||||
|
-- c = Acc
|
||||||
|
-- } ;
|
||||||
|
-- EmptyRelSlash rp slash = {
|
||||||
|
-- s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||||
|
-- c = Acc
|
||||||
|
-- } ;
|
||||||
|
--
|
||||||
|
-- StrandQuestSlash ip slash =
|
||||||
|
-- {s = \\t,a,b,q =>
|
||||||
|
-- (mkQuestion (ss (ip.s ! Acc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
||||||
|
-- };
|
||||||
|
--
|
||||||
|
-- lincat
|
||||||
|
-- VPI = {s : VPIForm => Agr => Str} ;
|
||||||
|
-- [VPI] = {s1,s2 : VPIForm => Agr => Str} ;
|
||||||
|
--
|
||||||
|
-- lin
|
||||||
|
-- BaseVPI = twoTable2 VPIForm Agr ;
|
||||||
|
-- ConsVPI = consrTable2 VPIForm Agr comma ;
|
||||||
|
--
|
||||||
|
-- MkVPI vp = {
|
||||||
|
-- s = \\v,a => vp.ad ++ vp.inf ++ vp.s2 ! a
|
||||||
|
-- } ;
|
||||||
|
-- ConjVPI = conjunctTable2 VPIForm Agr ;
|
||||||
|
-- ComplVPIVV vv vpi =
|
||||||
|
-- insertObj (\\a => (if_then_Str vv.isAux [] "to") ++ vpi.s ! VPIInf ! a) (predVV vv) ;
|
||||||
|
--
|
||||||
|
-- UncNegCl t a cl = {s = t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg ! ODir} ;
|
||||||
|
-- UncNegQCl t a cl = {s = \\q => t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg !q} ;
|
||||||
|
-- UncNegRCl t a cl = {
|
||||||
|
-- s = \\r => t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg ! r ;
|
||||||
|
-- c = cl.c
|
||||||
|
-- } ;
|
||||||
|
-- UncNegImpSg imp = {s = imp.s ! neg ! ImpF Sg False} ;
|
||||||
|
-- UncNegImpPl imp = {s = imp.s ! neg ! ImpF Pl False} ;
|
||||||
|
--
|
||||||
|
-- CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c} ;
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- oper
|
||||||
|
-- neg = CNeg False ;
|
||||||
|
--
|
||||||
|
}
|
||||||
21
lib/resource/interlingua/GrammarIna.gf
Normal file
21
lib/resource/interlingua/GrammarIna.gf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
|
concrete GrammarIna of Grammar =
|
||||||
|
NounIna,
|
||||||
|
VerbIna,
|
||||||
|
AdjectiveIna,
|
||||||
|
AdverbIna,
|
||||||
|
NumeralIna,
|
||||||
|
SentenceIna,
|
||||||
|
QuestionIna,
|
||||||
|
RelativeIna,
|
||||||
|
ConjunctionIna,
|
||||||
|
PhraseIna,
|
||||||
|
TextX,
|
||||||
|
StructuralIna,
|
||||||
|
IdiomIna
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
} ;
|
||||||
34
lib/resource/interlingua/IdiomIna.gf
Normal file
34
lib/resource/interlingua/IdiomIna.gf
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
concrete IdiomIna of Idiom = CatIna ** open Prelude, ResIna in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ImpersCl vp = mkClause "il" Sp3 vp ;
|
||||||
|
GenericCl vp = mkClause "on" Sp3 vp ;
|
||||||
|
|
||||||
|
CleftNP np rs = mkClause "lo" Sp3
|
||||||
|
(insertObj [] Acc (mkInvarNP (rs.s ! Sp3))
|
||||||
|
(insertObj [] Acc np
|
||||||
|
(predV esserV)));
|
||||||
|
-- ??? number/case agreement
|
||||||
|
|
||||||
|
CleftAdv ad s = mkClause "lo" Sp3
|
||||||
|
(insertObj [] Acc (mkInvarNP ("que" ++ s.s))
|
||||||
|
(insertObj [] Acc (mkInvarNP (ad.s)) (predV esserV))) ;
|
||||||
|
|
||||||
|
|
||||||
|
ExistNP np =
|
||||||
|
mkClause "il" Sp3 ((insertObj "" Acc np) (predV haberV)) ;
|
||||||
|
-- Il ha colonias que non pote reclamar mesmo un tal origine. (sample text 3)
|
||||||
|
|
||||||
|
ExistIP ip = mkQuestion {s=ip.s ! Acc} (mkClause "il" Sp3 (predV haberV)) ;
|
||||||
|
-- Never seen the above, but we can deduce it exists, since it's
|
||||||
|
-- merely an interrogative form of ExistNP.
|
||||||
|
|
||||||
|
ProgrVP vp = vp; -- progressive tense is the same as present in Interlingua.
|
||||||
|
-- (parag. 80+ of Grammatica de Interlingua)
|
||||||
|
|
||||||
|
ImpPl1 vp = {s = "que" ++ (mkClause "nos" {n = Pl ; p = P1} vp).s ! Pres ! Simul ! Pos ! ODir};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
7
lib/resource/interlingua/IrregIna.gf
Normal file
7
lib/resource/interlingua/IrregIna.gf
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
--# -path=.:prelude:../abstract:../common
|
||||||
|
|
||||||
|
concrete IrregIna of IrregInaAbs = CatIna ** open ParadigmsIna in {
|
||||||
|
|
||||||
|
flags optimize=values ;
|
||||||
|
|
||||||
|
}
|
||||||
2
lib/resource/interlingua/IrregInaAbs.gf
Normal file
2
lib/resource/interlingua/IrregInaAbs.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
abstract IrregInaAbs = Cat ** {
|
||||||
|
}
|
||||||
11
lib/resource/interlingua/LangIna.gf
Normal file
11
lib/resource/interlingua/LangIna.gf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
|
concrete LangIna of Lang =
|
||||||
|
GrammarIna,
|
||||||
|
LexiconIna
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
371
lib/resource/interlingua/LexiconIna.gf
Normal file
371
lib/resource/interlingua/LexiconIna.gf
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
--# -path=.:prelude
|
||||||
|
|
||||||
|
concrete LexiconIna of Lexicon = CatIna **
|
||||||
|
open (R=ResIna), ParadigmsIna, IrregIna, Prelude in {
|
||||||
|
|
||||||
|
flags
|
||||||
|
optimize=values ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
airplane_N = regN "avion";
|
||||||
|
answer_V2S = prepV2 aP (regV "responder");
|
||||||
|
apartment_N = regN "appartamento";
|
||||||
|
apple_N = regN "pomo";
|
||||||
|
art_N = regN "arte" ;
|
||||||
|
ask_V2Q = mkV2Q aP (regV "demandar") ;
|
||||||
|
baby_N = regN "bebe" ;
|
||||||
|
bad_A = regA "mal";
|
||||||
|
bank_N = regN "banca" ;
|
||||||
|
beautiful_A = regA "belle" ;
|
||||||
|
become_VA = mkVA (regV "devenir") ;
|
||||||
|
beer_N = regN "bira" ;
|
||||||
|
beg_V2V = mkV2V noPrep aP (regV "rogar") ;
|
||||||
|
big_A = regA "magne" ;
|
||||||
|
bike_N = regN "bicycletta" ;
|
||||||
|
bird_N = regN "ave" ;
|
||||||
|
black_A = regA "nigre" ;
|
||||||
|
blue_A = regA "blau" ;
|
||||||
|
boat_N = regN "barca" ;
|
||||||
|
book_N = regN "libro" ;
|
||||||
|
boot_N = regN "botta";
|
||||||
|
boss_N = regN "chef" ;
|
||||||
|
boy_N = regN "puero" ;
|
||||||
|
bread_N = regN "pan" ;
|
||||||
|
break_V2 = dirV2 (regV "rumper") ;
|
||||||
|
broad_A = regA "large" ;
|
||||||
|
brother_N2 = regN2 "fratre";
|
||||||
|
brown_A = regA "brun" ;
|
||||||
|
butter_N = regN "butyro" ;
|
||||||
|
buy_V2 = dirV2 (regV "compra");
|
||||||
|
camera_N = compN (regN "apparato" ) ["photographic"] ;
|
||||||
|
cap_N = regN "bonetto" ;
|
||||||
|
car_N = regN "automobile" ;
|
||||||
|
carpet_N = regN "tapete" ;
|
||||||
|
cat_N = regN "catto" ;
|
||||||
|
ceiling_N = regN "tecto" ; -- of room ???
|
||||||
|
chair_N = regN "sede";
|
||||||
|
cheese_N = regN "caseo";
|
||||||
|
child_N = regN "infante" ;
|
||||||
|
church_N = regN "ecclesia" ;
|
||||||
|
city_N = regN "urbe" ; -- ??? citate
|
||||||
|
clean_A = regA "munde" ;
|
||||||
|
clever_A = regA "intelligente" ;
|
||||||
|
close_V2 = dirV2 (regV "clauder") ;
|
||||||
|
coat_N = regN "mantello" ;
|
||||||
|
cold_A = regA "frigide" ;
|
||||||
|
come_V = regV "venir" ;
|
||||||
|
computer_N = regN "computator" ;
|
||||||
|
country_N = regN "pais" ;
|
||||||
|
cousin_N = regN "cosino" ; ---- cosina
|
||||||
|
cow_N = regN "vacca" ;
|
||||||
|
die_V = regV "morir" ;
|
||||||
|
dirty_A = regA "immunde" ;
|
||||||
|
distance_N3 = prepN3 aP (prepN2 deP (regN "distantia")) ; --- ??? wtf
|
||||||
|
doctor_N = regN "medico";
|
||||||
|
dog_N = regN "can";
|
||||||
|
door_N = regN "porta";
|
||||||
|
drink_V2 = dirV2 (regV "biber");
|
||||||
|
easy_A2V = mkA2V (regA "facile") aP ;
|
||||||
|
eat_V2 = dirV2 (regV "eder");
|
||||||
|
empty_A = regA "vacue" ;
|
||||||
|
enemy_N = regN "inimico" ;
|
||||||
|
factory_N = regN "fabrica" ;
|
||||||
|
father_N2 = regN2 "patre" ;
|
||||||
|
fear_VS = mkVS (regV "timer") ;
|
||||||
|
find_V2 = dirV2 (regV "trovar") ;
|
||||||
|
fish_N = regN "pisce" ;
|
||||||
|
floor_N = regN "pavimento" ;
|
||||||
|
forget_V2 = dirV2 (regV "oblidar");
|
||||||
|
fridge_N = regN "refrigerator";
|
||||||
|
friend_N = regN "amico" ;
|
||||||
|
fruit_N = regN "fructo" ;
|
||||||
|
fun_AV = mkAV (regA "famusante") ;
|
||||||
|
garden_N = regN "horto" ;
|
||||||
|
girl_N = regN "puera" ;
|
||||||
|
glove_N = regN "guanto" ;
|
||||||
|
go_V = regV "ir";
|
||||||
|
gold_N = regN "auro" ;
|
||||||
|
good_A = R.mkAdjective "bon" "melior" "optime";
|
||||||
|
green_A = regA "verde" ;
|
||||||
|
harbour_N = regN "porto" ;
|
||||||
|
hate_V2 = dirV2 (regV "detestar0") ;
|
||||||
|
hat_N = regN "cappello" ;
|
||||||
|
have_V2 = dirV2 (R.haberV ** {lock_V = <>});
|
||||||
|
hear_V2 = dirV2 (regV "audir");
|
||||||
|
hill_N = regN "monticulo" ;
|
||||||
|
hope_VS = mkVS (regV "sperar") ;
|
||||||
|
horse_N = regN "cavallo" ;
|
||||||
|
hot_A = regA "calide" ;
|
||||||
|
house_N = regN "domo" ;
|
||||||
|
important_A = regA "importante" ;
|
||||||
|
industry_N = regN "industria" ;
|
||||||
|
iron_N = regN "ferro" ;
|
||||||
|
king_N = regN "rege" ;
|
||||||
|
know_V2 = dirV2 (regV "cognoscer") ; -- ???
|
||||||
|
lake_N = regN "laco" ;
|
||||||
|
lamp_N = regN "lampa" ;
|
||||||
|
learn_V2 = dirV2 (regV "apprender") ;
|
||||||
|
leather_N = regN "corio" ;
|
||||||
|
leave_V2 = prepV2 deP (regV "partir");
|
||||||
|
like_V2 = dirV2 (regV "amar") ;
|
||||||
|
listen_V2 = dirV2 (regV "ascoltar") ;
|
||||||
|
live_V = (regV "vive") ;
|
||||||
|
long_A = regA "longe" ;
|
||||||
|
lose_V2 = dirV2 (regV "perder");
|
||||||
|
love_N = regN "amor" ;
|
||||||
|
love_V2 = dirV2 (regV "adorar") ;
|
||||||
|
man_N = regN "viro";
|
||||||
|
married_A2 = mkA2 (regA "sponsate") aP ;
|
||||||
|
meat_N = regN "carne" ;
|
||||||
|
milk_N = regN "lacte" ;
|
||||||
|
moon_N = regN "luna" ;
|
||||||
|
mother_N2 = regN2 "matre" ;
|
||||||
|
mountain_N = regN "montania" ;
|
||||||
|
music_N = regN "musica" ;
|
||||||
|
narrow_A = regA "stricte" ;
|
||||||
|
new_A = regA "nove" ;
|
||||||
|
newspaper_N = regN "jornal" ;
|
||||||
|
oil_N = regN "oleo" ;
|
||||||
|
old_A = regA "vetule" ;
|
||||||
|
open_V2 = dirV2 (regV "operir") ;
|
||||||
|
paint_V2A = mkV2A noPrep inP (regV "pinger") ; -- ??? preposition might be wrong. (did not find a sample usage)
|
||||||
|
paper_N = regN "papiro" ;
|
||||||
|
paris_PN = regPN "Paris" ;
|
||||||
|
peace_N = regN "pace" ;
|
||||||
|
pen_N = regN "penna" ;
|
||||||
|
planet_N = regN "planeta" ;
|
||||||
|
plastic_N = regN "plastico" ;
|
||||||
|
play_V2 = dirV2 (regV "sonar") ; -- ??? eg. play the piano
|
||||||
|
policeman_N = regN "policero" ;
|
||||||
|
priest_N = regN "prestre" ;
|
||||||
|
probable_AS = mkAS (regA "probabile") ;
|
||||||
|
queen_N = regN "regina" ;
|
||||||
|
radio_N = regN "radio" ;
|
||||||
|
rain_V0 = mkV0 (regV "pluvar") ;
|
||||||
|
read_V2 = dirV2 (regV "leger");
|
||||||
|
red_A = regA "rubie" ;
|
||||||
|
religion_N = regN "religion" ;
|
||||||
|
restaurant_N = regN "restaurant" ;
|
||||||
|
river_N = regN "riviera" ;
|
||||||
|
rock_N = regN "rocca" ;
|
||||||
|
roof_N = regN "tecto" ;
|
||||||
|
rubber_N = regN "cauchu" ;
|
||||||
|
run_V = regV "currer";
|
||||||
|
say_VS = mkVS (regV "dicer");
|
||||||
|
school_N = regN "schola" ;
|
||||||
|
science_N = regN "scientia";
|
||||||
|
sea_N = regN "mar" ;
|
||||||
|
seek_V2 = dirV2 (regV "cercar");
|
||||||
|
see_V2 = dirV2 (regV "vider");
|
||||||
|
sell_V3 = prepV3 aP (dirV2 (regV "vender"));
|
||||||
|
send_V3 = prepV3 aP (dirV2 (regV "inviar"));
|
||||||
|
sheep_N = regN "ove";
|
||||||
|
ship_N = regN "nave" ;
|
||||||
|
shirt_N = regN "camisa" ;
|
||||||
|
shoe_N = regN "scapra" ;
|
||||||
|
shop_N = regN "boteca" ;
|
||||||
|
short_A = regA "curte" ;
|
||||||
|
silver_N = regN "argento" ;
|
||||||
|
sister_N = regN "soror" ;
|
||||||
|
sleep_V = regV "dormir";
|
||||||
|
small_A = regA "parve" ; -- !!! This one should be preferably a prefix adjective
|
||||||
|
snake_N = regN "serpente" ;
|
||||||
|
sock_N = regN "calcetta" ;
|
||||||
|
speak_V2 = dirV2 (regV "parlar") ;-- ???
|
||||||
|
star_N = regN "stella" ;
|
||||||
|
steel_N = regN "aciero" ;
|
||||||
|
stone_N = regN "petra" ;
|
||||||
|
stove_N = regN "estufa" ;
|
||||||
|
student_N = regN "studente" ;
|
||||||
|
stupid_A = regA "nescie" ;
|
||||||
|
sun_N = regN "sol" ;
|
||||||
|
switch8off_V2 = dirV2 (regV "extinguer");
|
||||||
|
switch8on_V2 = dirV2 (regV "accender") ;
|
||||||
|
table_N = regN "tablula" ;
|
||||||
|
talk_V3 = (prepV3 deP (prepV2 aP (regV "parlar"))) ;
|
||||||
|
teacher_N = regN "professor" ;
|
||||||
|
teach_V2 = dirV2 (regV "inseniar"); -- ??? aP (preposition is what?)
|
||||||
|
television_N = regN "television" ;
|
||||||
|
thick_A = regA "spisse" ;
|
||||||
|
thin_A = regA "magre" ;
|
||||||
|
train_N = regN "convoyo" ; -- ???
|
||||||
|
travel_V = regV "viagiar" ;
|
||||||
|
tree_N = regN "tarbore" ;
|
||||||
|
---- trousers_N = regN "pantalon" ; --- ??? funky plural in the Abstract lexicon...
|
||||||
|
ugly_A = regA "ugly" ;
|
||||||
|
understand_V2 = dirV2 (regV "comprender");
|
||||||
|
university_N = regN "universitate" ;
|
||||||
|
village_N = regN "village" ;
|
||||||
|
wait_V2 = dirV2 (regV "wait") ;
|
||||||
|
walk_V = (regV "ambular") ;
|
||||||
|
warm_A = regA "calde" ;
|
||||||
|
war_N = regN "guerra" ;
|
||||||
|
watch_V2 = dirV2 (regV "spectar") ;
|
||||||
|
water_N = regN "aqua" ;
|
||||||
|
white_A = regA "albe" ;
|
||||||
|
window_N = regN "fenestra" ;
|
||||||
|
wine_N = regN "vino" ;
|
||||||
|
win_V2 = dirV2 (regV "ganiar");
|
||||||
|
woman_N = regN "femina";
|
||||||
|
wonder_VQ = mkVQ (reflV (regV "demandar")) ;
|
||||||
|
wood_N = regN "ligno"; -- or silva ...
|
||||||
|
write_V2 = dirV2 (regV "scriber");
|
||||||
|
yellow_A = regA "jalne" ;
|
||||||
|
young_A = regA "juvene" ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
do_V2 = dirV2 (regV "facer");
|
||||||
|
add_V3 = prepV3 aP (dirV2 (regV "additionar"));
|
||||||
|
already_Adv = mkAdv "jam" ;
|
||||||
|
animal_N = regN "animal" ;
|
||||||
|
ashes_N = regN "cinere" ; -- plural only???
|
||||||
|
back_N = regN "dorso" ;
|
||||||
|
bark_N = regN "cortice" ;
|
||||||
|
belly_N = regN "ventre" ;
|
||||||
|
bite_V2 = dirV2 (regV "morder");
|
||||||
|
blood_N = regN "sanguine" ;
|
||||||
|
blow_V = regV "sufflar";
|
||||||
|
bone_N = regN "osso" ;
|
||||||
|
breast_N = regN "pectore" ;
|
||||||
|
breathe_V = dirV2 (regV "respirar") ;
|
||||||
|
burn_V = regV "arder";
|
||||||
|
cloud_N = regN "nube" ;
|
||||||
|
correct_A = (regA "correcte") ;
|
||||||
|
count_V2 = dirV2 (regV "numerar") ;
|
||||||
|
cut_V2 = dirV2 (regV "secar");
|
||||||
|
day_N = regN "die" ;
|
||||||
|
dig_V = regV "fossar";
|
||||||
|
dry_A = regA "sic" ;
|
||||||
|
dull_A = regA "enoiose" ;
|
||||||
|
dust_N = regN "pulvere" ;
|
||||||
|
ear_N = regN "aure" ;
|
||||||
|
earth_N = regN "terra" ;
|
||||||
|
egg_N = regN "ovo" ;
|
||||||
|
eye_N = regN "oculo" ;
|
||||||
|
fall_V = regV "cader" ;
|
||||||
|
far_Adv = mkAdv "lontano" ;
|
||||||
|
fat_N = regN "grasse" ;
|
||||||
|
fear_V2 = dirV2 (regV "timer") ;
|
||||||
|
feather_N = regN "pluma" ;
|
||||||
|
fight_V2 = dirV2 (regV "combattar");
|
||||||
|
fingernail_N = regN "ungual";
|
||||||
|
fire_N = regN "foco" ;
|
||||||
|
float_V = regV "flottar" ;
|
||||||
|
flow_V = regV "flucto" ;
|
||||||
|
flower_N = regN "flore" ;
|
||||||
|
fly_V = regV "volar" ;
|
||||||
|
fog_N = regN "bruma" ;
|
||||||
|
foot_N = regN "pede";
|
||||||
|
forest_N = regN "silva" ;
|
||||||
|
freeze_V = regV "gelar";
|
||||||
|
full_A = regA "plen" ;
|
||||||
|
give_V3 = prepV3 aP (dirV2 (regV "dar")) ;
|
||||||
|
grammar_N = regN "grammatica" ;
|
||||||
|
grass_N = regN "herba" ;
|
||||||
|
guts_N = regN "tripas" ; -- !!!: no singular
|
||||||
|
hair_N = regN "pilo" ;
|
||||||
|
hand_N = regN "mano" ;
|
||||||
|
head_N = regN "capite" ;
|
||||||
|
heart_N = regN "corde" ;
|
||||||
|
heavy_A = regA "pesante" ;
|
||||||
|
hit_V2 = dirV2 (regV "frappar") ;
|
||||||
|
hold_V2 = dirV2 (regV "retener") ;
|
||||||
|
horn_N = regN "corno" ;
|
||||||
|
hunt_V2 = dirV2 (regV "chassar") ;
|
||||||
|
husband_N = regN "sposo";
|
||||||
|
ice_N = regN "glacie" ;
|
||||||
|
john_PN = regPN "John" ;
|
||||||
|
jump_V = regV "saltar" ;
|
||||||
|
kill_V2 = dirV2 (regV "occider") ;
|
||||||
|
knee_N = regN "genu" ;
|
||||||
|
language_N = regN "linguage" ;
|
||||||
|
laugh_V = regV "rider" ;
|
||||||
|
leaf_N = regN "folio" ;
|
||||||
|
left_Ord = ss "leve" ;
|
||||||
|
leg_N = regN "gamba" ;
|
||||||
|
lie_V = regV "mentir";
|
||||||
|
liver_N = regN "hepate" ;
|
||||||
|
louse_N = regN "pediculo";
|
||||||
|
mouth_N = regN "bucca" ;
|
||||||
|
name_N = regN "nomine" ;
|
||||||
|
near_A = regA "proxime" ;
|
||||||
|
neck_N = regN "collo" ;
|
||||||
|
night_N = regN "nocte" ;
|
||||||
|
nose_N = regN "naso" ;
|
||||||
|
now_Adv = mkAdv "nunc" ;
|
||||||
|
number_N = regN "numero" ;
|
||||||
|
person_N = regN "homine" ;
|
||||||
|
play_V = regV "jocar" ;
|
||||||
|
pull_V2 = dirV2 (regV "traher") ;
|
||||||
|
push_V2 = dirV2 (regV "pulsar") ;
|
||||||
|
put_V2 = dirV2 (regV "placar");
|
||||||
|
question_N = regN "question" ;
|
||||||
|
rain_N = regN "pluvia" ;
|
||||||
|
ready_A = regA "preste" ;
|
||||||
|
reason_N = regN "ration" ;
|
||||||
|
right_Ord = ss "dextra" ;
|
||||||
|
road_N = regN "via" ;
|
||||||
|
root_N = regN "radice" ;
|
||||||
|
rope_N = regN "corda" ;
|
||||||
|
rotten_A = (regA "corrupte") ;
|
||||||
|
round_A = regA "ronde" ;
|
||||||
|
rub_V2 = dirV2 (regV "fircar") ;
|
||||||
|
rule_N = regN "regula" ;
|
||||||
|
salt_N = regN "sal" ;
|
||||||
|
sand_N = regN "sablo" ;
|
||||||
|
scratch_V2 = dirV2 (regV "grattar") ;
|
||||||
|
seed_N = regN "semine" ;
|
||||||
|
sew_V = regV "suer";
|
||||||
|
sharp_A = regA "trenchante" ;
|
||||||
|
sing_V = regV "cantar";
|
||||||
|
sit_V = regV "seder";
|
||||||
|
skin_N = regN "pelle" ;
|
||||||
|
sky_N = regN "celo" ;
|
||||||
|
smell_V = regV "oler" ;
|
||||||
|
smoke_N = regN "fumar" ;
|
||||||
|
smooth_A = regA "lisie" ;
|
||||||
|
snow_N = regN "niva" ;
|
||||||
|
song_N = regN "canto" ;
|
||||||
|
spit_V = regV "sputar";
|
||||||
|
split_V2 = dirV2 (regV "finder");
|
||||||
|
squeeze_V2 = dirV2 (regV "comprimer") ;
|
||||||
|
stab_V2 = dirV2 (regV "dagar") ;
|
||||||
|
stand_V = regV "star";
|
||||||
|
stick_N = regN "baston" ;
|
||||||
|
stop_V = regV "stoppar" ;
|
||||||
|
straight_A = regA "directe" ;
|
||||||
|
suck_V2 = dirV2 (regV "suger") ;
|
||||||
|
swell_V = (regV "turger");
|
||||||
|
swim_V = (regV "natada");
|
||||||
|
tail_N = regN "cauda" ;
|
||||||
|
think_V = regV "pensar";
|
||||||
|
throw_V2 = dirV2 (regV "jectar") ;
|
||||||
|
tie_V2 = dirV2 (regV "ligar") ;
|
||||||
|
today_Adv = mkAdv "hodie" ;
|
||||||
|
tongue_N = regN "lingua" ;
|
||||||
|
tooth_N = regN "dente";
|
||||||
|
turn_V = regV "tornar" ;
|
||||||
|
uncertain_A = regA "incerte" ;
|
||||||
|
vomit_V = regV "vomir" ;
|
||||||
|
wash_V2 = dirV2 (regV "abluer") ;
|
||||||
|
wet_A = regA "humid" ; ----
|
||||||
|
wide_A = regA "large" ;
|
||||||
|
wife_N = regN "sposa";
|
||||||
|
wind_N = regN "vento" ;
|
||||||
|
wing_N = regN "ala" ;
|
||||||
|
wipe_V2 = dirV2 (regV "essugar") ;
|
||||||
|
worm_N = regN "verme" ;
|
||||||
|
year_N = regN "anno" ;
|
||||||
|
-- other_A = regA "altere" ;
|
||||||
|
---- added 4/6/2007
|
||||||
|
--
|
||||||
|
oper
|
||||||
|
-- aboutP = mkPrep "about" ;
|
||||||
|
-- atP = mkPrep "at" ;
|
||||||
|
-- forP = mkPrep "for" ;
|
||||||
|
-- fromP = mkPrep "from" ;
|
||||||
|
inP = mkPrep "in" accusative;
|
||||||
|
-- onP = mkPrep "on" ;
|
||||||
|
aP = mkPrep "" dative; -- can generate clitics, fuses with the def. det. "le"
|
||||||
|
deP = mkPrep "" ablative; -- can not generate clitics, fuses with the def. det. "le", pronoun form: "de mi".
|
||||||
|
} ;
|
||||||
64
lib/resource/interlingua/MorphoIna.gf
Normal file
64
lib/resource/interlingua/MorphoIna.gf
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
--# -path=.:../../prelude
|
||||||
|
|
||||||
|
--1 A Simple Interlingua Resource Morphology
|
||||||
|
--
|
||||||
|
-- Aarne Ranta 2003--2005
|
||||||
|
-- JP Bernardy 2007
|
||||||
|
--
|
||||||
|
-- This resource morphology contains definitions needed in the resource
|
||||||
|
-- syntax. To build a lexicon, it is better to use $ParadigmsIna$, which
|
||||||
|
-- gives a higher-level access to this module.
|
||||||
|
|
||||||
|
resource MorphoIna = ResIna ** open Prelude, (Predef=Predef) in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
|
--2 Nouns
|
||||||
|
--
|
||||||
|
-- For conciseness and abstraction, we define a worst-case macro for
|
||||||
|
-- noun inflection. It is used for defining special case that
|
||||||
|
-- only need one string as argument.
|
||||||
|
|
||||||
|
oper
|
||||||
|
CommonNoun : Type = {s : Number => Str}; -- nouns are inflected in number
|
||||||
|
|
||||||
|
nounGen : Str -> Str -> CommonNoun = \mec,mecs ->
|
||||||
|
{s = table {Sg => mec;
|
||||||
|
Pl => mecs
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nounReg : Str -> CommonNoun = \cas ->
|
||||||
|
let s = case last cas of {
|
||||||
|
"a" | "e" | "i" | "o" | "u" => "s" ;
|
||||||
|
"c" => "hes";
|
||||||
|
_ => "es"
|
||||||
|
}
|
||||||
|
in nounGen cas (cas + s) ;
|
||||||
|
|
||||||
|
--2 Determiners
|
||||||
|
|
||||||
|
mkDeterminer : Number -> Str -> {s : Case => Str ; n : Number} = \n,s ->
|
||||||
|
{s = \\c=>casePrep "" c ++ s ; n = n} ;
|
||||||
|
|
||||||
|
mkIDeterminer : Number -> Str -> {s : Str ; n : Number} = \n,s ->
|
||||||
|
{s = s ; n = n} ;
|
||||||
|
|
||||||
|
--2 Adjectives
|
||||||
|
--
|
||||||
|
-- To form the adjectival and the adverbial forms, 3 strings are needed
|
||||||
|
-- in the worst case. (bon, melior, optime)
|
||||||
|
|
||||||
|
Adjective = {s : AForm => Str} ;
|
||||||
|
|
||||||
|
-- However, most adjectives can be inflected using the final character.
|
||||||
|
|
||||||
|
regAdjective : Str -> Adjective = \clar ->
|
||||||
|
mkAdjective clar ("plus" ++ clar) ("le" ++ "plus" ++ clar) ;
|
||||||
|
|
||||||
|
--3 Verbs
|
||||||
|
|
||||||
|
-- defined in resina
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
100
lib/resource/interlingua/NounIna.gf
Normal file
100
lib/resource/interlingua/NounIna.gf
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
concrete NounIna of Noun = CatIna ** open ResIna, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
DetCN det cn = {
|
||||||
|
s = \\c => det.s!c ++ cn.s ! det.n ;
|
||||||
|
a = agrP3 det.n ;
|
||||||
|
isPronoun = False
|
||||||
|
}; -- iste pizza
|
||||||
|
|
||||||
|
UsePN pn = {
|
||||||
|
s = \\_ => pn.s;
|
||||||
|
a = agrP3 Sg;
|
||||||
|
isPronoun = False
|
||||||
|
};
|
||||||
|
|
||||||
|
UsePron p = p; -- io, tu, ille, etc.
|
||||||
|
|
||||||
|
PredetNP pred np = {
|
||||||
|
s = \\c => pred.s ++ np.s ! c ;
|
||||||
|
isPronoun = False;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PPartNP np v2 = {
|
||||||
|
s = \\c => np.s ! c ++ v2.s ! VPPart ;
|
||||||
|
isPronoun = False;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvNP np adv = {
|
||||||
|
isPronoun = False;
|
||||||
|
s = \\c => np.s ! c ++ adv.s ;
|
||||||
|
a = Sp3;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetSg quant ord = {
|
||||||
|
s = \\c=>quant.s ! Sg ! c ++ ord.s ;
|
||||||
|
n = Sg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetPl quant num ord = {
|
||||||
|
s = \\c=>(quant.s ! num.n !c) ++ num.s ++ ord.s ;
|
||||||
|
n = num.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PossPron p = {s = \\_,c => casePrep [] c ++ p.possForm} ;
|
||||||
|
|
||||||
|
NoNum = {s = []; n = Pl } ;
|
||||||
|
NoOrd = {s = []} ;
|
||||||
|
|
||||||
|
NumDigits n = {s = n.s ! NCard ; n = n.n} ;
|
||||||
|
NumInt n = {s = n.s ; n = Pl} ;
|
||||||
|
|
||||||
|
OrdInt n = {s = n.s ++ "e"} ; --- DEPRECATED
|
||||||
|
OrdDigits n = {s = n.s ! NOrd} ;
|
||||||
|
|
||||||
|
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
||||||
|
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||||
|
|
||||||
|
AdNum adn num = {s = adn.s ++ num.s; n = num.n } ;
|
||||||
|
|
||||||
|
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||||
|
|
||||||
|
DefArt = {s = \\_ => table {
|
||||||
|
Dat => "al";
|
||||||
|
Gen | Abl => "del";
|
||||||
|
_ => "le"}} ;
|
||||||
|
|
||||||
|
IndefArt = {s =
|
||||||
|
\\n,c => casePrep [] c ++ case n of {
|
||||||
|
Sg => "un" ;
|
||||||
|
Pl => []
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
MassDet = {s = \\_,_ => []} ;
|
||||||
|
|
||||||
|
UseN n = n ;
|
||||||
|
UseN2 n = n ;
|
||||||
|
UseN3 n = n ;
|
||||||
|
|
||||||
|
ComplN2 f x = {s = \\n => f.s ! n ++ f.p2 ++ x.s ! f.c2} ;
|
||||||
|
ComplN3 f x = {s = \\n => f.s ! n ++ f.p2 ++ x.s ! f.c2 ; c2 = f.c3; p2 = f.p3} ;
|
||||||
|
|
||||||
|
AdjCN ap cn = {
|
||||||
|
s = \\n => preOrPost ap.isPre (ap.s ! agrP3 n) (cn.s ! n)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelCN cn rs = {s = \\n => cn.s ! n ++ rs.s ! agrP3 n} ;
|
||||||
|
AdvCN cn ad = {s = \\n => cn.s ! n ++ ad.s} ;
|
||||||
|
|
||||||
|
SentCN cn sc = {s = \\n => cn.s ! n ++ sc.s} ;
|
||||||
|
|
||||||
|
ApposCN cn np = {s = \\n => cn.s ! n ++ np.s ! Nom} ;
|
||||||
|
--- ??? The use of the Nom case is somewhat strange here. The
|
||||||
|
--- abstract rule is dubious anyway, so ...
|
||||||
|
|
||||||
|
}
|
||||||
94
lib/resource/interlingua/NumeralIna.gf
Normal file
94
lib/resource/interlingua/NumeralIna.gf
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
concrete NumeralIna of Numeral = CatIna ** open ResIna in {
|
||||||
|
|
||||||
|
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} ;
|
||||||
|
|
||||||
|
lin num x = x ;
|
||||||
|
|
||||||
|
lin n2 = mkNum "duo" "secunde" "vinti" "vintesime";
|
||||||
|
lin n3 = mkNum "tres" "tertie" "trenta" "trentesime";
|
||||||
|
lin n4 = mkNum "quatro" "quarte" "quaranta" "quarantesime";
|
||||||
|
lin n5 = regNum "cinque" "quinte" ;
|
||||||
|
lin n6 = regNum "sex" "sexte" ;
|
||||||
|
lin n7 = regNum "septe" "septime" ;
|
||||||
|
lin n8 = regNum "octo" "octave" ;
|
||||||
|
lin n9 = regNum "novem" "none" ;
|
||||||
|
|
||||||
|
lin pot01 = mkNum "un" "prime" "dece" "decime" ** {n = Sg} ;
|
||||||
|
lin pot0 d = d ** {n = Pl} ;
|
||||||
|
lin pot110 = regCardOrd "dece" ** {n = Pl} ;
|
||||||
|
lin pot111 = regCardOrd ["dece-un"] ** {n = Pl} ;
|
||||||
|
lin pot1to19 d = {s = \\c => "dece" ++ "-" ++ d.s ! unit ! c} ** {n = Pl} ;
|
||||||
|
lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
||||||
|
lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||||
|
lin pot1plus d e = {
|
||||||
|
s = \\c => d.s ! ten ! NCard ++ "-" ++ e.s ! unit ! c ; n = Pl} ;
|
||||||
|
lin pot1as2 n = n ;
|
||||||
|
lin pot2 d = {s = \\c => d.s ! unit ! NCard ++ mkCard c "cento"} ** {n = Pl} ;
|
||||||
|
lin pot2plus d e = {
|
||||||
|
s = \\c => d.s ! unit ! NCard ++ "cento" ++ e.s ! c ; n = Pl} ;
|
||||||
|
lin pot2as3 n = n ;
|
||||||
|
lin pot3 n = {
|
||||||
|
s = \\c => n.s ! NCard ++ mkCard c "mille" ; n = Pl} ;
|
||||||
|
lin pot3plus n m = {
|
||||||
|
s = \\c => n.s ! NCard ++ "mille" ++ m.s ! c ; n = Pl} ;
|
||||||
|
|
||||||
|
-- numerals as sequences of digits
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Dig = TDigit ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
IDig d = d ** {tail = T1} ;
|
||||||
|
|
||||||
|
IIDig d i = {
|
||||||
|
s = \\o => d.s ! NCard ++ commaIf i.tail ++ i.s ! o ;
|
||||||
|
n = Pl ;
|
||||||
|
tail = inc i.tail
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- I don't know the convention (and could not find it in the
|
||||||
|
-- grammar) so I just affix "e" to all numbers to indicate the
|
||||||
|
-- ordinal
|
||||||
|
|
||||||
|
D_0 = mkDig "0" ;
|
||||||
|
D_1 = mkDig "1" ;
|
||||||
|
D_2 = mkDig "2" ;
|
||||||
|
D_3 = mkDig "3" ;
|
||||||
|
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
|
||||||
|
commaIf : DTail -> Str = \t -> case t of {
|
||||||
|
T3 => "," ;
|
||||||
|
_ => []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
inc : DTail -> DTail = \t -> case t of {
|
||||||
|
T1 => T2 ;
|
||||||
|
T2 => T3 ;
|
||||||
|
T3 => T1
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard => c ; NOrd => o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : CardOrd => Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
1
lib/resource/interlingua/OverloadIna.gf
Normal file
1
lib/resource/interlingua/OverloadIna.gf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
resource OverloadIna = Overload with (Grammar = GrammarIna) ;
|
||||||
314
lib/resource/interlingua/ParadigmsIna.gf
Normal file
314
lib/resource/interlingua/ParadigmsIna.gf
Normal file
@@ -0,0 +1,314 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude:../common
|
||||||
|
|
||||||
|
--1 Interlingua Lexical Paradigms
|
||||||
|
--
|
||||||
|
-- Aarne Ranta 2003--2005
|
||||||
|
-- JP Bernardy 2007
|
||||||
|
--
|
||||||
|
-- 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 $MorphoIna.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$.
|
||||||
|
-- However, this function should only seldom be needed: we have a
|
||||||
|
-- separate module [``IrregIna`` ../../english/IrregIna.gf],
|
||||||
|
-- which covers irregular verbss.
|
||||||
|
|
||||||
|
resource ParadigmsIna = open
|
||||||
|
(Predef=Predef),
|
||||||
|
Prelude,
|
||||||
|
MorphoIna,
|
||||||
|
CatIna
|
||||||
|
in {
|
||||||
|
--2 Parameters
|
||||||
|
--
|
||||||
|
-- To abstract over gender names, we define the following identifiers.
|
||||||
|
|
||||||
|
oper
|
||||||
|
-- Gender : Type ;
|
||||||
|
-- There is no grammatical gender in interlingua.
|
||||||
|
|
||||||
|
---- To abstract over number names, we define the following.
|
||||||
|
--
|
||||||
|
-- Number : Type ;
|
||||||
|
--
|
||||||
|
-- singular : Number ;
|
||||||
|
-- plural : Number ;
|
||||||
|
|
||||||
|
-- To abstract over case names, we define the following.
|
||||||
|
|
||||||
|
nominative : Case ;
|
||||||
|
accusative : Case ;
|
||||||
|
genitive : Case ;
|
||||||
|
dative : Case ;
|
||||||
|
ablative : Case ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Prepositions are used in many-argument functions for rection.
|
||||||
|
-- The resource category $Prep$ is used.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--2 Nouns
|
||||||
|
--
|
||||||
|
|
||||||
|
-- All nouns are regular, so one should use $regN$ to construct them.
|
||||||
|
|
||||||
|
--3 Relational nouns
|
||||||
|
--
|
||||||
|
-- Relational nouns ("daughter of x") need a preposition.
|
||||||
|
|
||||||
|
-- The most common preposition is "of", and the following is a
|
||||||
|
-- shortcut for regular relational nouns with "of".
|
||||||
|
|
||||||
|
regN2 : Str -> N2 ;
|
||||||
|
|
||||||
|
--2 Adjectives
|
||||||
|
|
||||||
|
-- All adjectives are regular, so on should use $regA$ to construct them.
|
||||||
|
|
||||||
|
--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. Some can be preverbal (e.g. "always").
|
||||||
|
|
||||||
|
mkAdv : Str -> Adv ;
|
||||||
|
mkAdV : Str -> AdV ;
|
||||||
|
|
||||||
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
|
mkAdA : Str -> AdA ;
|
||||||
|
|
||||||
|
--2 Prepositions
|
||||||
|
--
|
||||||
|
-- A preposition as used for rection in the lexicon, as well as to
|
||||||
|
-- build $PP$s in the resource API, just requires a string and an expected case.
|
||||||
|
|
||||||
|
mkPrep : Str -> Case -> Prep ;
|
||||||
|
noPrep : Prep ;
|
||||||
|
|
||||||
|
--2 Verbs
|
||||||
|
--
|
||||||
|
-- Regular verbs should be constructed with $regV$. The 3 irregular verbs
|
||||||
|
-- esser, haber and vader are available separately.
|
||||||
|
|
||||||
|
|
||||||
|
---- Reflexive verbs.
|
||||||
|
---- By default, verbs are not reflexive; this function makes them that.
|
||||||
|
--
|
||||||
|
reflV : V -> V ;
|
||||||
|
reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ;
|
||||||
|
|
||||||
|
|
||||||
|
--3 2 and many-place verbs
|
||||||
|
|
||||||
|
|
||||||
|
-- I decided to provide the following combinators for forming verbs with
|
||||||
|
-- complex grammar rules:
|
||||||
|
|
||||||
|
prepV2 : Prep -> V -> V2 ;
|
||||||
|
prepV3 : Prep -> V2 -> V3 ;
|
||||||
|
dirV2 : V -> V2 ;
|
||||||
|
|
||||||
|
|
||||||
|
mkV0 : V -> V0 ;
|
||||||
|
mkVS : V -> VS ;
|
||||||
|
-- mkV2S : V -> Prep -> V2S ;
|
||||||
|
-- mkVV : V -> VV ;
|
||||||
|
mkV2V : Prep -> Prep -> V -> V2V ;
|
||||||
|
mkVA : V -> VA ;
|
||||||
|
mkV2A : Prep -> Prep -> V -> V2A ;
|
||||||
|
mkVQ : V -> VQ ;
|
||||||
|
mkV2Q : Prep -> V -> V2Q ;
|
||||||
|
|
||||||
|
mkAS : A -> AS ;
|
||||||
|
-- mkA2S : A -> Prep -> A2S ;
|
||||||
|
mkAV : A -> AV ;
|
||||||
|
mkA2V : A -> Prep -> A2V ;
|
||||||
|
--
|
||||||
|
---- Notice: categories $V2S, V2V, V2Q$ are in v 1.0 treated
|
||||||
|
---- just as synonyms of $V2$, and the second argument is given
|
||||||
|
---- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$.
|
||||||
|
---- $V0$ is just $V$.
|
||||||
|
--
|
||||||
|
V0, V2S, V2V, V2Q : Type ;
|
||||||
|
AS, A2S, AV, A2V : Type ;
|
||||||
|
--
|
||||||
|
----.
|
||||||
|
----2 Definitions of paradigms
|
||||||
|
----
|
||||||
|
---- The definitions should not bother the user of the API. So they are
|
||||||
|
---- hidden from the document.
|
||||||
|
nominative = Nom ;
|
||||||
|
accusative = Acc ;
|
||||||
|
genitive = Gen ;
|
||||||
|
dative = Dat ;
|
||||||
|
ablative = Abl ;
|
||||||
|
|
||||||
|
regN s = nounReg s ** {lock_N = <>};
|
||||||
|
|
||||||
|
compN : N -> Str -> N;
|
||||||
|
compN n s = {s = \\x => n.s ! x ++ s; lock_N = <>} ;
|
||||||
|
|
||||||
|
|
||||||
|
prepN2 : Prep -> N -> N2;
|
||||||
|
prepN3 : Prep -> N2 -> N3;
|
||||||
|
prepN2 = \p,n -> n ** {lock_N2 = <> ; p2 = p.s; c2 = p.c} ;
|
||||||
|
prepN3 = \p,n -> n ** {lock_N3 = <> ; p3 = p.s; c3 = p.c} ;
|
||||||
|
regN2 n = prepN2 (mkPrep [] genitive) (regN n) ** {lock_N2 = <>};
|
||||||
|
|
||||||
|
----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").
|
||||||
|
--
|
||||||
|
-- cnN2 : CN -> Prep -> N2 ;
|
||||||
|
-- cnN3 : CN -> Prep -> Prep -> N3 ;
|
||||||
|
--
|
||||||
|
---- This is obsolete.
|
||||||
|
-- cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||||
|
-- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||||
|
--
|
||||||
|
regPN n = regGenPN n;
|
||||||
|
regGenPN n = {s = n; lock_PN = <>} ;
|
||||||
|
-- nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
|
||||||
|
--
|
||||||
|
-- mk2A a b = mkAdjective a a a b ** {lock_A = <>} ;
|
||||||
|
regA a = regAdjective a ** {lock_A = <>} ;
|
||||||
|
|
||||||
|
mkA2 a p = a ** {c2 = casePrep p.s p.c ; lock_A2 = <>} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||||
|
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||||
|
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||||
|
|
||||||
|
mkPrep p c = ss p ** {c = c; lock_Prep = <>} ;
|
||||||
|
noPrep = mkPrep [] accusative ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Verb-formation combinators.
|
||||||
|
regV : Str -> V;
|
||||||
|
regV s = mkVerb s ** {lock_V = <>};
|
||||||
|
|
||||||
|
prepV2 p v = v ** {c2 = p.c; p2 = p.s ; lock_V2 = <>} ;
|
||||||
|
prepV3 p v = v ** {c3 = p.c; p3 = p.s ; lock_V3 = <>} ;
|
||||||
|
dirV2 = prepV2 noPrep ;
|
||||||
|
|
||||||
|
mkVS v = v ** {lock_VS = <>} ;
|
||||||
|
-- mkVV v = {
|
||||||
|
-- s = table {VVF vf => v.s ! vf ; _ => variants {}} ;
|
||||||
|
-- isAux = False ; lock_VV = <>
|
||||||
|
-- } ;
|
||||||
|
mkVQ v = v ** {lock_VQ = <>} ;
|
||||||
|
|
||||||
|
V0 : Type = V ;
|
||||||
|
V2S, V2V, V2Q : Type = V2 ;
|
||||||
|
AS, A2S, AV : Type = A ;
|
||||||
|
A2V : Type = A2 ;
|
||||||
|
--
|
||||||
|
mkV0 v = v ** {lock_V = <>} ;
|
||||||
|
-- mkV2S v p = prepV2 v p ** {lock_V2 = <>} ;
|
||||||
|
mkV2V p t v = prepV2 p v ** {s4 = t ; lock_V2 = <>} ;
|
||||||
|
mkVA v = v ** {lock_VA = <>} ;
|
||||||
|
mkV2A p2 p3 v = (prepV3 p3 (prepV2 p2 v)) ** {lock_V2A = <>} ;
|
||||||
|
mkV2Q p v = prepV2 p v ** {lock_V2 = <>} ;
|
||||||
|
mkAS v = v ** {lock_A = <>} ;
|
||||||
|
-- mkA2S v p = mkA2 v p ** {lock_A = <>} ;
|
||||||
|
mkAV v = v ** {lock_A = <>} ;
|
||||||
|
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- pre-overload API and overload definitions
|
||||||
|
regN : Str -> N ;
|
||||||
|
-- mk2N : (man,men : Str) -> N ;
|
||||||
|
-- genderN : Gender -> N -> N ;
|
||||||
|
-- compN : Str -> N -> N ;
|
||||||
|
--
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- mk2A : (free,freely : Str) -> A ;
|
||||||
|
regA : Str -> A ;
|
||||||
|
--
|
||||||
|
-- mkA = overload {
|
||||||
|
-- mkA : Str -> A = regA ;
|
||||||
|
-- mkA : (fat,fatter : Str) -> A = \fat,fatter ->
|
||||||
|
-- mkAdjective fat fatter (init fatter + "st") (fat + "ly") ** {lock_A = <>} ;
|
||||||
|
-- mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
|
||||||
|
-- mkAdjective a b c d ** {lock_A = <>}
|
||||||
|
-- } ;
|
||||||
|
--
|
||||||
|
-- compoundA = compoundADeg ;
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- mk5V : (go, goes, went, gone, going : Str) -> V ;
|
||||||
|
-- regV : (cry : Str) -> V ;
|
||||||
|
-- reg2V : (stop, stopped : Str) -> V;
|
||||||
|
-- irregV : (drink, drank, drunk : Str) -> V ;
|
||||||
|
-- irreg4V : (run, ran, run, running : Str) -> V ;
|
||||||
|
--
|
||||||
|
-- -- Use reg2V instead
|
||||||
|
-- regDuplV : Str -> V ;
|
||||||
|
-- -- Use irreg4V instead
|
||||||
|
-- irregDuplV : (get, got, gotten : Str) -> V ;
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
------ obsolete
|
||||||
|
--
|
||||||
|
---- Comparison adjectives may two more forms.
|
||||||
|
--
|
||||||
|
-- ADeg : Type ;
|
||||||
|
--
|
||||||
|
-- mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||||
|
--
|
||||||
|
---- The regular pattern recognizes two common variations:
|
||||||
|
---- "-e" ("rude" - "ruder" - "rudest") and
|
||||||
|
---- "-y" ("happy - happier - happiest - happily")
|
||||||
|
--
|
||||||
|
-- regADeg : Str -> ADeg ; -- long, longer, longest
|
||||||
|
--
|
||||||
|
---- However, the duplication of the final consonant is nor predicted,
|
||||||
|
---- but a separate pattern is used:
|
||||||
|
--
|
||||||
|
-- duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
||||||
|
--
|
||||||
|
---- If comparison is formed by "more", "most", as in general for
|
||||||
|
---- long adjective, the following pattern is used:
|
||||||
|
--
|
||||||
|
-- compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||||
|
--
|
||||||
|
---- From a given $ADeg$, it is possible to get back to $A$.
|
||||||
|
--
|
||||||
|
-- adegA : ADeg -> A ;
|
||||||
|
--
|
||||||
|
--
|
||||||
|
regPN : Str -> PN ;
|
||||||
|
regGenPN : Str -> PN ; -- John, John's
|
||||||
|
--
|
||||||
|
---- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
||||||
|
--
|
||||||
|
-- nounPN : N -> PN ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
24
lib/resource/interlingua/PhraseIna.gf
Normal file
24
lib/resource/interlingua/PhraseIna.gf
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
concrete PhraseIna of Phrase = CatIna ** open Prelude, ResIna in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||||
|
|
||||||
|
UttS s = s ;
|
||||||
|
UttQS qs = {s = qs.s ! OQuest};
|
||||||
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ;
|
||||||
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
||||||
|
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
||||||
|
|
||||||
|
UttIP ip = {s = ip.s ! Nom} ; -- ??? Dat, Abl also...
|
||||||
|
UttIAdv iadv = iadv ;
|
||||||
|
UttNP np = {s = np.s ! Nom} ;
|
||||||
|
UttVP vp = {s = infVP vp} ;
|
||||||
|
UttAdv adv = adv ;
|
||||||
|
|
||||||
|
NoPConj = {s = []} ;
|
||||||
|
PConjConj conj = conj ;
|
||||||
|
|
||||||
|
NoVoc = {s = []} ;
|
||||||
|
VocNP np = {s = "," ++ np.s ! Nom} ;
|
||||||
|
|
||||||
|
}
|
||||||
42
lib/resource/interlingua/QuestionIna.gf
Normal file
42
lib/resource/interlingua/QuestionIna.gf
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
concrete QuestionIna of Question = CatIna ** open ResIna, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
QuestCl cl = {
|
||||||
|
s = \\t,a,p =>
|
||||||
|
let cls = cl.s ! t ! a ! p
|
||||||
|
in table {
|
||||||
|
OQuest => cls ! OQuest ;
|
||||||
|
ODir => "an" ++ cls ! ODir
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
QuestVP qp vp =
|
||||||
|
let cl = mkClause (qp.s ! Nom) Sp3 vp
|
||||||
|
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
|
||||||
|
|
||||||
|
QuestSlash ip slash =
|
||||||
|
mkQuestion (ss (slash.p2 ++ ip.s ! slash.c2)) slash ;
|
||||||
|
|
||||||
|
QuestIAdv iadv cl = mkQuestion iadv cl ;
|
||||||
|
|
||||||
|
QuestIComp icomp np =
|
||||||
|
mkQuestion icomp (mkClause (np.s ! Nom) np.a (predV esserV)) ;
|
||||||
|
|
||||||
|
|
||||||
|
PrepIP p ip = {s = p.s ++ ip.s ! Nom} ;
|
||||||
|
|
||||||
|
AdvIP ip adv = {
|
||||||
|
s = \\c => ip.s ! c ++ adv.s ;
|
||||||
|
n = ip.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IDetCN idet num ord cn = {
|
||||||
|
s = \\c => casePrep [] c ++ idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n;
|
||||||
|
n = idet.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompIAdv a = a ;
|
||||||
|
|
||||||
|
}
|
||||||
53
lib/resource/interlingua/RelativeIna.gf
Normal file
53
lib/resource/interlingua/RelativeIna.gf
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
concrete RelativeIna of Relative = CatIna ** open ResIna in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
RelCl cl = {
|
||||||
|
s = \\t,a,p,agr =>
|
||||||
|
(case agr.n of {Sg => "tal"; Pl => "tales"}) ++
|
||||||
|
"que" ++ cl.s ! t ! a ! p ! ODir ;
|
||||||
|
c = Nom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelVP rp vp = {
|
||||||
|
s = \\t,a,p,agr => (mkClause (rp.s!Nom) agr vp).s ! t ! a ! p ! ODir;
|
||||||
|
c = Nom
|
||||||
|
} ;
|
||||||
|
-- !!! person agreement is probably bad here; see below.
|
||||||
|
|
||||||
|
---- Pied piping: "a que tu invia flores"
|
||||||
|
|
||||||
|
RelSlash rp slash = {
|
||||||
|
s = \\t,a,p,agr => slash.p2 ++ rp.s ! slash.c2 ++ slash.s ! t ! a ! p ! ODir ;
|
||||||
|
c = slash.c2;
|
||||||
|
} ;
|
||||||
|
-- !!! In the above The agreement feature of the RP does not match
|
||||||
|
-- the the (parametric!) agreement of the resulting clause.
|
||||||
|
-- Is it a bug? I believe there is the same behaviour in the english grammar.
|
||||||
|
|
||||||
|
FunRP p np rp = {
|
||||||
|
s = \\c => np.s ! Acc ++ p.s ++ rp.s ! p.c ;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
IdRP = {
|
||||||
|
-- TODO: variant: "le qual"
|
||||||
|
a = {p = P3; n = variants {Sg; Pl}};
|
||||||
|
s = table {
|
||||||
|
Nom => quique; -- Le ultime traino que pote portar me ibi a tempore parti in cinque minutas
|
||||||
|
Gen => "cuje"; -- Le documentos cuje importantia esseva dubitose incriminava le spia
|
||||||
|
Acc => "que"; -- Le documentos que le spia portava con se esseva multo importante
|
||||||
|
Dat => "a" ++ quique;
|
||||||
|
Abl => "de" ++ quique
|
||||||
|
}} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
quique = variants {"qui"; -- !!! Only for humans, only after a preposition.
|
||||||
|
-- This is extremely strange, because it does not match any Romance language I know.
|
||||||
|
-- For now just be lax and make it a variant of "que"
|
||||||
|
"que"};
|
||||||
|
|
||||||
|
}
|
||||||
335
lib/resource/interlingua/ResIna.gf
Normal file
335
lib/resource/interlingua/ResIna.gf
Normal file
@@ -0,0 +1,335 @@
|
|||||||
|
--# -path=.:../abstract:../common:../../prelude
|
||||||
|
|
||||||
|
--1 Interlingua 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$.
|
||||||
|
|
||||||
|
resource ResIna = ParamX ** open Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Some parameters, such as $Number$, are inherited from $ParamX$.
|
||||||
|
|
||||||
|
--2 For $Noun$
|
||||||
|
|
||||||
|
-- This is the worst-case $Case$ needed for pronouns.
|
||||||
|
|
||||||
|
param
|
||||||
|
Case = Nom | Acc | Gen | Dat | Abl ;
|
||||||
|
-- Why do we need so many cases?
|
||||||
|
-- Interlingua has (optional) contractions:
|
||||||
|
-- "a le" -> "al"
|
||||||
|
-- "de le" -> "del"
|
||||||
|
-- so, we can't get away with mere prepositions "a" and "de"
|
||||||
|
-- but use Dative and Ablative to represent those.
|
||||||
|
-- Pronouns have different forms in Nominative and Accusative.
|
||||||
|
-- Genitive is used for possesives (which can also be pronominalized)
|
||||||
|
|
||||||
|
oper
|
||||||
|
casePrep : Str -> Case -> Str = \prep,cas -> case cas of {
|
||||||
|
Dat => "a";
|
||||||
|
Gen | Abl => "de";
|
||||||
|
_ => prep
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
--2 For $Verb$
|
||||||
|
|
||||||
|
-- These 7 forms are more than we need. (esser is irregular
|
||||||
|
-- only in pres, past, fut, cond so we could do with 5, but it makes
|
||||||
|
-- easy to reason about what happens.)
|
||||||
|
|
||||||
|
param
|
||||||
|
VForm
|
||||||
|
= VInf
|
||||||
|
| VPres
|
||||||
|
| VPPart
|
||||||
|
| VPresPart
|
||||||
|
| VPast --# notpresent
|
||||||
|
| VFut --# notpresent
|
||||||
|
| VCond --# notpresent
|
||||||
|
;
|
||||||
|
|
||||||
|
param
|
||||||
|
VVariant
|
||||||
|
= VMono -- "creava"
|
||||||
|
| VSplit -- "ha create" -- !!! This is not implemented. One reason is that the split forms overlap with aux verb + participle as ajective. (Anterior form)
|
||||||
|
;
|
||||||
|
|
||||||
|
-- The order of sentence is needed already in $VP$.
|
||||||
|
Order = ODir | OQuest ;
|
||||||
|
|
||||||
|
--2 For $Adjective$
|
||||||
|
|
||||||
|
AForm = AAdj Degree | AAdv ;
|
||||||
|
|
||||||
|
--2 For $Relative$
|
||||||
|
|
||||||
|
-- RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
||||||
|
-- RCase = RPrep | RC Case ;
|
||||||
|
|
||||||
|
--2 For $Numeral$
|
||||||
|
|
||||||
|
CardOrd = NCard | NOrd ;
|
||||||
|
DForm = unit | ten ;
|
||||||
|
|
||||||
|
--2 Transformations between parameter types
|
||||||
|
|
||||||
|
oper
|
||||||
|
Agr = {n : Number ; p : Person} ;
|
||||||
|
-- This is the agreement record for verb phrases, which is needed only for reflexive verbs.
|
||||||
|
|
||||||
|
agrP3 : Number -> Agr = \n ->
|
||||||
|
{n = n ; p = P3} ;
|
||||||
|
|
||||||
|
conjAgr : Agr -> Agr -> Agr = \a,b -> {
|
||||||
|
n = conjNumber a.n b.n ;
|
||||||
|
p = conjPerson a.p b.p
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- For each lexical category, here are the worst-case constructors.
|
||||||
|
mkAdjective : (_,_,_ : Str) -> {s : AForm => Str} =
|
||||||
|
\bon,melior,optime ->
|
||||||
|
let mente = case last bon of
|
||||||
|
{"c" => "amente";
|
||||||
|
_ => "mente"
|
||||||
|
}
|
||||||
|
in {
|
||||||
|
s = table {
|
||||||
|
AAdj Posit => bon ;
|
||||||
|
AAdj Compar => melior ;
|
||||||
|
AAdj Superl => optime ;
|
||||||
|
AAdv => bon + mente
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
mkVerb : Str -> Verb = \crear->
|
||||||
|
let crea = init crear
|
||||||
|
in {isRefl = False;
|
||||||
|
s = table {
|
||||||
|
VInf => crear;
|
||||||
|
VPres => crea;
|
||||||
|
VPast => crea + "va";
|
||||||
|
VFut => crear + "a";
|
||||||
|
VCond => crear + "ea";
|
||||||
|
VPPart => case crear of {
|
||||||
|
rid + "er" => rid + "ite";
|
||||||
|
_ => crea + "te"
|
||||||
|
};
|
||||||
|
VPresPart => case crear of {
|
||||||
|
aud + "ir" => aud + "iente";
|
||||||
|
_ => crea + "nte"
|
||||||
|
}}};
|
||||||
|
|
||||||
|
-- + The 3 (optionally) irregular verbs. (we only need haberV in this module)
|
||||||
|
esserV : Verb =
|
||||||
|
let reg = mkVerb "esser"
|
||||||
|
in {isRefl = False;
|
||||||
|
s = \\form=> case form of {
|
||||||
|
VPres => variants {"es"; "esse"};
|
||||||
|
VFut => variants {"sera"; "essera"};
|
||||||
|
VCond => variants {"serea"; "esserea"};
|
||||||
|
VPast => variants {"era"; "esseva"};
|
||||||
|
_ => reg.s!form}};
|
||||||
|
|
||||||
|
haberV : Verb =
|
||||||
|
let reg = mkVerb "haber"
|
||||||
|
in {isRefl = False;
|
||||||
|
s = \\form=> case form of {
|
||||||
|
VPres => variants {"ha"; "habe"};
|
||||||
|
_ => reg.s!form}};
|
||||||
|
|
||||||
|
vaderV : Verb =
|
||||||
|
let reg = mkVerb "vader"
|
||||||
|
in {isRefl = False;
|
||||||
|
s = \\form=> case form of {
|
||||||
|
VPres => variants {"va"; "vade"};
|
||||||
|
_ => reg.s!form}};
|
||||||
|
|
||||||
|
|
||||||
|
mkIP : Str -> Number -> {s : Case => Str ; n : Number} = \qui,n -> {s = \\c=>casePrep [] c ++ qui; n = n};
|
||||||
|
|
||||||
|
mkPron : (io,me,mi : Str) -> Agr -> NP ** {possForm : Str} =
|
||||||
|
\io,me,mi,a ->
|
||||||
|
let mie = case last mi of {
|
||||||
|
"e" => mi;
|
||||||
|
_ => mi + "e"
|
||||||
|
} in
|
||||||
|
{
|
||||||
|
a = a;
|
||||||
|
s = table {
|
||||||
|
Nom => io ;
|
||||||
|
Gen => mie ;
|
||||||
|
_ => me
|
||||||
|
} ;
|
||||||
|
possForm = mi;
|
||||||
|
isPronoun = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
Sp1 : Agr = {n = Sg ; p = P1};
|
||||||
|
Sp2 : Agr = {n = Sg ; p = P2};
|
||||||
|
Sp3 : Agr = {n = Sg ; p = P3};
|
||||||
|
Pp1 : Agr = {n = Pl ; p = P1};
|
||||||
|
Pp2 : Agr = {n = Pl ; p = P2};
|
||||||
|
Pp3 : Agr = {n = Pl ; p = P3};
|
||||||
|
|
||||||
|
-- make an invariant NP (not inflected)
|
||||||
|
mkInvarNP : Str -> NP = \str -> {a = Sp3; isPronoun = False; s = \\_=> str};
|
||||||
|
|
||||||
|
regNP : Str -> NP = mkInvarNP;
|
||||||
|
|
||||||
|
artIndef = "un";
|
||||||
|
artDef = "le" ;
|
||||||
|
|
||||||
|
-- For $Verb$.
|
||||||
|
Verb : Type = {
|
||||||
|
s : VForm => Str ;
|
||||||
|
isRefl : Bool
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- Dependency on Agr is there only because of reflexive pronouns!
|
||||||
|
VP : Type = {
|
||||||
|
s : Anteriority => Tense => {fin, inf : Str} ;
|
||||||
|
rest : Agr => Str; -- comes after the infinite part
|
||||||
|
clitics : Agr => Str; -- can be placed just before the finite or right after the infinite
|
||||||
|
prp : Str ; -- present participle (unused at the moment ???)
|
||||||
|
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
||||||
|
} ;
|
||||||
|
NP : Type = {
|
||||||
|
isPronoun : Bool;
|
||||||
|
s : Case => Str;
|
||||||
|
a : Agr;
|
||||||
|
};
|
||||||
|
-- Noun phrase that can be declined in person and number. (for reflexive pronouns)
|
||||||
|
NP' : Type = {
|
||||||
|
isPronoun : Bool;
|
||||||
|
s : Agr => Case => Str;
|
||||||
|
};
|
||||||
|
|
||||||
|
predV : Verb -> VP = \verb -> {
|
||||||
|
clitics = \\_ => [];
|
||||||
|
rest = \\_ => [];
|
||||||
|
s = table
|
||||||
|
{Simul => \\t=> {fin = verb.s ! (tenseToVFrom!t); inf = []};
|
||||||
|
Anter => \\t=> {fin = haberV.s ! (tenseToVFrom!t); inf = verb.s!VPPart}
|
||||||
|
};
|
||||||
|
prp = verb.s ! VPresPart;
|
||||||
|
inf = verb.s ! VInf;
|
||||||
|
};
|
||||||
|
|
||||||
|
tenseToVFrom = table {
|
||||||
|
Pres => VPres;
|
||||||
|
Past => VPast;
|
||||||
|
Fut => VFut;
|
||||||
|
Cond => VCond
|
||||||
|
};
|
||||||
|
|
||||||
|
insertInvarObj : Str -> VP -> VP = \obj -> insertObj "" Acc (mkInvarNP obj);
|
||||||
|
|
||||||
|
insertObj : Str -> Case -> NP -> VP -> VP
|
||||||
|
= \prep,c,obj,vp -> insertReflObj prep c {isPronoun = obj.isPronoun; s = \\agr => obj.s} vp;
|
||||||
|
|
||||||
|
insertReflObj : Str -> Case -> NP' -> VP -> VP = \prep,c,obj,vp -> case obj.isPronoun of
|
||||||
|
{
|
||||||
|
-- !!! if the preposition is not empty, or
|
||||||
|
-- if the case is not [Dat, Acc]
|
||||||
|
-- then the pronoun cannot be inserted as a clitic.
|
||||||
|
True => {
|
||||||
|
inf = vp.inf;
|
||||||
|
prp = vp.prp;
|
||||||
|
s = vp.s;
|
||||||
|
clitics = \\agr => obj.s!agr!c ++ vp.clitics!agr; -- clitics are inserted in reverse order.
|
||||||
|
rest = vp.rest};
|
||||||
|
False => {
|
||||||
|
inf = vp.inf;
|
||||||
|
prp = vp.prp;
|
||||||
|
s = vp.s;
|
||||||
|
clitics = vp.clitics;
|
||||||
|
rest = \\agr => vp.rest!agr ++ prep ++ obj.s!agr!c;
|
||||||
|
} };
|
||||||
|
|
||||||
|
infVP : VP -> Str = \vp -> variants {
|
||||||
|
vp.clitics ! Sp3 ++ vp.inf ++ vp.rest ! Sp3 ;
|
||||||
|
vp.inf ++ vp.clitics ! Sp3 ++ vp.rest ! Sp3 ;
|
||||||
|
};
|
||||||
|
|
||||||
|
posneg : Polarity -> Str = \b -> case b of {
|
||||||
|
Pos => [] ;
|
||||||
|
Neg => "non"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
reflPron : Agr => Str = table {
|
||||||
|
{n = Sg ; p = P1} => "me" ;
|
||||||
|
{n = Sg ; p = P2} => "te" ;
|
||||||
|
{n = Sg ; p = P3} => "se" ;
|
||||||
|
{n = Pl ; p = P1} => "nos" ;
|
||||||
|
{n = Pl ; p = P2} => "vos" ;
|
||||||
|
{n = Pl ; p = P3} => "se"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---- For $Sentence$.
|
||||||
|
--
|
||||||
|
Clause = {s : Tense => Anteriority => Polarity => Order => Str} ;
|
||||||
|
|
||||||
|
mkClause : Str -> Agr -> VP -> Clause =
|
||||||
|
\subj,agr,vp ->
|
||||||
|
{
|
||||||
|
s = \\t,anter,b =>let v = vp.s!anter!t
|
||||||
|
in table {
|
||||||
|
ODir => variants {
|
||||||
|
subj ++ posneg b ++ v.fin ++ v.inf ++ vp.clitics!agr ++ vp.rest!agr;
|
||||||
|
subj ++ posneg b ++ vp.clitics!agr ++ v.fin ++ v.inf ++ vp.rest!agr
|
||||||
|
};
|
||||||
|
OQuest => variants {
|
||||||
|
posneg b ++ v.fin ++ subj ++ v.inf ++ vp.clitics!agr ++ vp.rest!agr;
|
||||||
|
posneg b ++ vp.clitics!agr ++ v.fin ++ subj ++ v.inf ++ vp.rest!agr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
mkQuestion :
|
||||||
|
{s : Str} -> Clause -> Clause = \qu,cl ->
|
||||||
|
{s=\\t,a,p,o => qu.s ++ cl.s ! t ! a ! p ! o};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- For $Numeral$.
|
||||||
|
|
||||||
|
oper mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
|
||||||
|
\duo,vinti,secunde,vintesime->
|
||||||
|
{s = table { unit => table {
|
||||||
|
NCard => duo ;
|
||||||
|
NOrd => secunde};
|
||||||
|
ten => table {
|
||||||
|
NCard => vinti;
|
||||||
|
NOrd => vintesime}}} ;
|
||||||
|
|
||||||
|
oper regNum : Str -> Str -> {s : DForm => CardOrd => Str} =
|
||||||
|
\cinque,quinte ->
|
||||||
|
let cinqu : Str = case cinque of {
|
||||||
|
nov + "em"=> nov;
|
||||||
|
cinq_ + "e" => cinq_;
|
||||||
|
cinq_ + "o" => cinq_;
|
||||||
|
sex => sex}
|
||||||
|
in mkNum cinque quinte (cinqu + "anta") (cinqu + "esime");
|
||||||
|
|
||||||
|
regOrd : Str -> Str = \cent -> case cent of {
|
||||||
|
mill + "e" => mill + "esime";
|
||||||
|
_ => cent + "esime"};
|
||||||
|
|
||||||
|
regCardOrd : Str -> {s : CardOrd => Str} = \ten ->
|
||||||
|
{s = table {NCard => ten ; NOrd => regOrd ten}} ;
|
||||||
|
|
||||||
|
mkCard : CardOrd -> Str -> Str = \c,ten ->
|
||||||
|
(regCardOrd ten).s ! c ;
|
||||||
|
|
||||||
|
}
|
||||||
63
lib/resource/interlingua/ResIna2.gf
Normal file
63
lib/resource/interlingua/ResIna2.gf
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
--# -path=.:../abstract:../common:../../prelude
|
||||||
|
|
||||||
|
--1 Interlingua 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$.
|
||||||
|
|
||||||
|
resource ResIna2 = ParamX ** open Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Some parameters, such as $Number$, are inherited from $ParamX$.
|
||||||
|
|
||||||
|
--2 For $Noun$
|
||||||
|
|
||||||
|
-- This is the worst-case $Case$ needed for pronouns.
|
||||||
|
|
||||||
|
|
||||||
|
param
|
||||||
|
VForm
|
||||||
|
= VInf
|
||||||
|
| VPres
|
||||||
|
| VPPart
|
||||||
|
| VPresPart
|
||||||
|
| VPast --# notpresent
|
||||||
|
| VFut --# notpresent
|
||||||
|
| VCond --# notpresent
|
||||||
|
;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mkVerb : Str -> Verb = \crear->
|
||||||
|
let crea = init crear
|
||||||
|
in {s = table {
|
||||||
|
VInf => crear;
|
||||||
|
VPres => crea;
|
||||||
|
VPast => crea + "va";
|
||||||
|
VFut => crear + "a";
|
||||||
|
VCondit => crear + "ea";
|
||||||
|
VPPart => case crear of {
|
||||||
|
rid + "er" => rid + "ite";
|
||||||
|
_ => crea + "te"
|
||||||
|
};
|
||||||
|
VPresPart => case crear of {
|
||||||
|
aud + "ir" => aud + "iente";
|
||||||
|
_ => crea + "nte"
|
||||||
|
}}};
|
||||||
|
|
||||||
|
|
||||||
|
---- For $Verb$.
|
||||||
|
--
|
||||||
|
Verb : Type = {
|
||||||
|
s : VForm => Str ;
|
||||||
|
-- isRefl : Bool
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
57
lib/resource/interlingua/SentenceIna.gf
Normal file
57
lib/resource/interlingua/SentenceIna.gf
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
concrete SentenceIna of Sentence = CatIna ** open Prelude, ResIna in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
|
||||||
|
|
||||||
|
PredSCVP sc vp = mkClause sc.s Sp3 vp ;
|
||||||
|
|
||||||
|
ImpVP vp = {s = \\pol,n=> (mkClause [] {n = n; p = P2} vp).s!Pres!Simul!pol!ODir};
|
||||||
|
|
||||||
|
SlashV2 np v2 = mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2; p2 = v2.p2} ;
|
||||||
|
|
||||||
|
|
||||||
|
SlashVVV2 np vv v2 =
|
||||||
|
mkClause (np.s ! Nom) np.a
|
||||||
|
(insertInvarObj (infVP (predV v2)) (predV vv)) **
|
||||||
|
{c2 = v2.c2; p2 = v2.p2} ;
|
||||||
|
|
||||||
|
AdvSlash slash adv = {
|
||||||
|
s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ;
|
||||||
|
c2 = slash.c2;
|
||||||
|
p2 = slash.p2
|
||||||
|
} ;
|
||||||
|
|
||||||
|
SlashPrep cl prep = cl ** {c2 = prep.c; p2 = prep.s} ;
|
||||||
|
|
||||||
|
SlashVS np vs slash =
|
||||||
|
mkClause (np.s ! Nom) np.a
|
||||||
|
(insertInvarObj ("que" ++ slash.s) (predV vs)) **
|
||||||
|
{c2 = slash.c2; p2 = slash.p2} ;
|
||||||
|
|
||||||
|
|
||||||
|
EmbedS s = {s = "que" ++ s.s} ;
|
||||||
|
EmbedQS qs = {s = qs.s ! ODir} ;
|
||||||
|
EmbedVP vp = {s = infVP vp} ;
|
||||||
|
|
||||||
|
UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! ODir} ;
|
||||||
|
UseQCl t a p cl = {s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o} ;
|
||||||
|
UseRCl t a p cl = {s = \\agr => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! agr};
|
||||||
|
UseSlash t a p cl={s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! ODir;
|
||||||
|
c2 = cl.c2;
|
||||||
|
p2 = cl.p2} ;
|
||||||
|
|
||||||
|
AdvS a s = {s = a.s ++ "," ++ s.s} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
{-
|
||||||
|
--- todo: tense of embedded Slash
|
||||||
|
|
||||||
|
SlashVSS np vs s =
|
||||||
|
mkClause (np.s ! Nom) np.a
|
||||||
|
(insertObj (\\_ => conjThat ++ s.s) (predV vs)) **
|
||||||
|
{c2 = s.c2} ;
|
||||||
|
-}
|
||||||
113
lib/resource/interlingua/StructuralIna.gf
Normal file
113
lib/resource/interlingua/StructuralIna.gf
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
concrete StructuralIna of Structural = CatIna **
|
||||||
|
open MorphoIna, (P = ParadigmsIna), Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkPrep = P.mkPrep;
|
||||||
|
pp : Str -> Prep = \s-> mkPrep s Acc;
|
||||||
|
lin
|
||||||
|
above_Prep = pp "supra";
|
||||||
|
after_Prep = pp "post" ;
|
||||||
|
all_Predet = ss "omne" ;
|
||||||
|
almost_AdA, almost_AdN = ss "quasi" ;
|
||||||
|
although_Subj = ss "quamquam" ;
|
||||||
|
always_AdV = ss "sempre" ;
|
||||||
|
and_Conj = ss "e" ** {n = Pl} ;
|
||||||
|
because_Subj = ss "proque" ;
|
||||||
|
before_Prep = pp "ante";
|
||||||
|
behind_Prep = pp "detra" ;
|
||||||
|
between_Prep = pp "inter" ;
|
||||||
|
both7and_DConj = sd2 "e" "e" ** {n = Pl} ;
|
||||||
|
but_PConj = ss "sed" ;
|
||||||
|
by8agent_Prep = pp "per" ;
|
||||||
|
by8means_Prep = pp "per" ;
|
||||||
|
can_VV = P.regV "poter";
|
||||||
|
can8know_VV = P.regV "saper";
|
||||||
|
during_Prep = pp "durante" ;
|
||||||
|
either7or_DConj = sd2 "o" "o" ** {n = Sg} ;
|
||||||
|
everybody_NP = regNP "totos" ;
|
||||||
|
every_Det = mkDeterminer Sg "tote" ;
|
||||||
|
everything_NP = regNP "toto" ;
|
||||||
|
everywhere_Adv = ss "ubique" ;
|
||||||
|
few_Det = mkDeterminer Pl "qualque" ;
|
||||||
|
for_Prep = pp "por" ;
|
||||||
|
from_Prep = pp "ex" ;
|
||||||
|
he_Pron = mkPron "ille" "le" "su" Sp3;
|
||||||
|
here_Adv = ss "hic" ;
|
||||||
|
here7to_Adv = ss "hac" ;
|
||||||
|
here7from_Adv = mkPrep ["de ci"] Dat;
|
||||||
|
how_IAdv = ss "como" ;
|
||||||
|
how8many_IDet = mkIDeterminer Pl ["quante"] ;
|
||||||
|
if_Subj = ss "ii" ;
|
||||||
|
in8front_Prep = pp "avante";
|
||||||
|
i_Pron = mkPron "io" "me" "mi" Sp1;
|
||||||
|
in_Prep = pp "in" ;
|
||||||
|
it_Pron = mkPron "illo" "lo" "su" Sp3;
|
||||||
|
less_CAdv = ss "minus" ;
|
||||||
|
many_Det = mkDeterminer Pl "multe" ;
|
||||||
|
more_CAdv = ss "plus" ;
|
||||||
|
most_Predet = ss ("le"++"plus");
|
||||||
|
much_Det = mkDeterminer Sg "tanto" ;
|
||||||
|
must_VV = P.regV "deber";
|
||||||
|
no_Phr = ss "no" ;
|
||||||
|
on_Prep = mkPrep "super" Acc;
|
||||||
|
only_Predet = ss "unic" ;
|
||||||
|
or_Conj = ss "o" ** {n = Sg} ;
|
||||||
|
otherwise_PConj = ss "alias" ;
|
||||||
|
part_Prep = mkPrep [] Abl; -- de ...
|
||||||
|
please_Voc = ss ("per"++"favor") ;
|
||||||
|
possess_Prep = mkPrep [] Gen; -- the possesive preposition can not generate clitics, and fuses with the definite determiner "le". Pronoun form: "mie", "sue", etc.
|
||||||
|
quite_Adv = ss "assi" ;
|
||||||
|
she_Pron = mkPron "illa" "la" "su" Sp3;
|
||||||
|
so_AdA = ss "tam" ;
|
||||||
|
somebody_NP = regNP (variants {"alicuno"; "alcuno"}) ;
|
||||||
|
someSg_Det = mkDeterminer Sg (variants {"alicun"; "alcun"});
|
||||||
|
somePl_Det = mkDeterminer Pl (variants {"alicun"; "alcun"});
|
||||||
|
something_NP = regNP ("alcun"++"cosa") ; -- very many variants
|
||||||
|
somewhere_Adv = ss "alicubi" ; -- variants
|
||||||
|
that_Quant = mkQuant "ille" "ille" ;
|
||||||
|
that_NP = regNP "illo" ; -- Also exsits gender variants!
|
||||||
|
there_Adv = ss "ibi"; -- la
|
||||||
|
there7to_Adv = ss "ibi" ;
|
||||||
|
there7from_Adv = ss "ibi";
|
||||||
|
therefore_PConj = ss "ergo" ;
|
||||||
|
these_NP = regNP "istes" ;
|
||||||
|
they_Pron = mkPron "illos" "los" "lor" Pp3;
|
||||||
|
this_Quant = mkQuant "iste" "istes" ;
|
||||||
|
this_NP = regNP "isto" ;
|
||||||
|
those_NP = regNP "illos" ; -- Also exsits gender variants!
|
||||||
|
through_Prep = mkPrep "per" Acc;
|
||||||
|
too_AdA = ss "alsi" ;
|
||||||
|
to_Prep = mkPrep "" Dat;
|
||||||
|
under_Prep = pp "infra" ;
|
||||||
|
very_AdA = ss "multo" ;
|
||||||
|
want_VV = P.regV "want" ;
|
||||||
|
we_Pron = mkPron "nos" "nos" "nostre" Pp1;
|
||||||
|
whatPl_IP = mkIP "que" Pl ;
|
||||||
|
whatSg_IP = mkIP "que" Sg ;
|
||||||
|
when_IAdv = ss "quando" ;
|
||||||
|
when_Subj = ss "quando" ;
|
||||||
|
where_IAdv = ss "ubi" ;
|
||||||
|
whichPl_IDet = mkIDeterminer Pl ["qual"] ;
|
||||||
|
whichSg_IDet = mkIDeterminer Sg ["quales"] ;
|
||||||
|
whoSg_IP = mkIP "qui" Sg ;
|
||||||
|
whoPl_IP = mkIP "qui" Pl ;
|
||||||
|
why_IAdv = ss "proque" ;
|
||||||
|
without_Prep = mkPrep "sin" Acc;
|
||||||
|
with_Prep = mkPrep "con" Acc ;
|
||||||
|
yes_Phr = ss "itaque" ; -- ita?
|
||||||
|
youSg_Pron = mkPron "tu" "te" "tu" Sp2;
|
||||||
|
youPl_Pron = mkPron "vos" "vos" "vostre" Pp2;
|
||||||
|
youPol_Pron = mkPron "vos" "vos" "vostre" Pp2;
|
||||||
|
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkQuant : Str -> Str -> {s : Number => Case => Str} = \x,y -> {
|
||||||
|
s = \\n,c=> case n of {
|
||||||
|
Sg => x;
|
||||||
|
Pl => y
|
||||||
|
}} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
49
lib/resource/interlingua/VerbIna.gf
Normal file
49
lib/resource/interlingua/VerbIna.gf
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
concrete VerbIna of Verb = CatIna ** open ResIna, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
UseV = predV ;
|
||||||
|
ComplV2 v np = insertObj v.p2 v.c2 np (predV v) ;
|
||||||
|
|
||||||
|
ComplV3 v np np2 = insertObj v.p3 v.c3 np2
|
||||||
|
(insertObj v.p2 v.c2 np
|
||||||
|
(predV v)) ;
|
||||||
|
|
||||||
|
ComplVV v vp = insertInvarObj (infVP vp) (predV v) ;
|
||||||
|
|
||||||
|
ComplVS v s = insertInvarObj ("que" ++ s.s) (predV v) ;
|
||||||
|
ComplVQ v q = insertInvarObj (q.s ! ODir) (predV v) ;
|
||||||
|
|
||||||
|
|
||||||
|
ComplVA v ap = insertInvarObj (ap.s ! Sp3) (predV v) ;
|
||||||
|
-- !!! Agr should agree with the subject; however this is a quite useless sentence:
|
||||||
|
-- You are greater than yourself... etc.
|
||||||
|
|
||||||
|
ComplV2A v np ap = insertInvarObj (casePrep v.p3 v.c3 ++ (ap.s ! Sp3))
|
||||||
|
(insertObj v.p2 v.c2 np
|
||||||
|
(predV v)) ;
|
||||||
|
|
||||||
|
-- This is not described by the interlingua grammar.
|
||||||
|
-- eg. "peint en rouge"
|
||||||
|
|
||||||
|
UseComp comp = insertInvarObj (comp.s ! Sp3) (predV esserV) ;
|
||||||
|
-- !!! as above
|
||||||
|
|
||||||
|
AdvVP vp adv = insertInvarObj (adv.s) vp ;
|
||||||
|
|
||||||
|
AdVVP adv vp = insertInvarObj adv.s vp ;
|
||||||
|
-- ??? The grammar is quite unclear about where the adverbs should go.
|
||||||
|
|
||||||
|
|
||||||
|
ReflV2 v = insertReflObj v.p2 v.c2 {isPronoun = True; s = \\agr,c => reflPron!agr} (predV v) ;
|
||||||
|
|
||||||
|
PassV2 v = insertInvarObj (v.s ! VPPart) (predV esserV);
|
||||||
|
|
||||||
|
UseVS, UseVQ = \vv -> {s = vv.s ; p2 = []; c2 = Acc; isRefl = vv.isRefl};
|
||||||
|
|
||||||
|
CompAP ap = ap ;
|
||||||
|
CompNP np = {s = \\_ => np.s ! Acc} ;
|
||||||
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user