mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-10-25 09:13:18 -06:00
extensions by Codex
This commit is contained in:
1 parent
d05b640ee6
commit
96c22468f4
15 files changed
+465
-42
No files matched your search
@@ -59,6 +59,11 @@ concrete AdjectiveRon of Adjective =
|
||||
isPre = ap.isPre
|
||||
} ;
|
||||
|
||||
AdvAP ap adv = {
|
||||
s = \\a => ap.s ! a ++ adv.s ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
UseA2 a = {
|
||||
s = a.s ;
|
||||
isPre = False
|
||||
|
||||
@@ -2,6 +2,8 @@ concrete AdverbRon of Adverb =
|
||||
CatRon ** open ResRon, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdAAdj a = {s = a.s ! AA} ;
|
||||
|
||||
PositAdvAdj a = {
|
||||
s = a.s ! AA
|
||||
} ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--# -path=.:../Romance:../common:../abstract:../common:prelude
|
||||
--# -coding=latin1
|
||||
--# -coding=utf8
|
||||
|
||||
concrete CatRon of Cat =
|
||||
CommonX - [CAdv,Temp,Tense]
|
||||
@@ -65,6 +65,10 @@ concrete CatRon of Cat =
|
||||
sp : Gender => NCase => Str ;
|
||||
size : Str ; --because of the numerals
|
||||
hasRef : Bool };
|
||||
|
||||
DAP = {s : Gender => NCase => Str ; n : Number ;
|
||||
isDef : Bool ; post : Gender => NCase => Str ;
|
||||
sp : Gender => NCase => Str ; size : Str ; hasRef : Bool} ;
|
||||
|
||||
Predet = {s : AAgr => ACase => Str ; c : NCase} ;
|
||||
|
||||
@@ -162,8 +166,8 @@ oper
|
||||
|
||||
--Conjuctions
|
||||
|
||||
conjThan : Str = "decât" ;
|
||||
conjThat : Str = "cã" ;
|
||||
conjThan : Str = "decât" ;
|
||||
conjThat : Str = "că" ;
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,11 @@ concrete ConjunctionRon of Conjunction =
|
||||
ConjAP conj ss = conjunctDistrTable AForm conj ss ** {
|
||||
isPre = ss.isPre
|
||||
} ;
|
||||
|
||||
ConjCN conj ss = {
|
||||
s = \\n,sp,c => conj.s1 ++ ss.s1 ! n ! sp ! c ++ conj.s2 ++ ss.s2 ! n ! sp ! c ;
|
||||
g = ss.g ; a = ss.a ; needsRefForm = ss.needsRefForm ; isComp = True
|
||||
} ;
|
||||
|
||||
ConjRS conj ss = conjunctDistrTable2 Mood Agr conj ss ** {
|
||||
c = ss.c
|
||||
@@ -53,11 +58,23 @@ concrete ConjunctionRon of Conjunction =
|
||||
BaseRS x y = twoTable2 Mood Agr x y ** {c = y.c} ;
|
||||
ConsRS xs x = consrTable2 Mood Agr comma xs x ** {c = xs.c} ;
|
||||
|
||||
BaseCN x y = {
|
||||
s1 = x.s ; s2 = y.s ; g = x.g ; a = x.a ;
|
||||
needsRefForm = orB x.needsRefForm y.needsRefForm
|
||||
} ;
|
||||
ConsCN x xs = {
|
||||
s1 = \\n,sp,c => x.s ! n ! sp ! c ++ comma ++ xs.s1 ! n ! sp ! c ;
|
||||
s2 = xs.s2 ; g = x.g ; a = x.a ;
|
||||
needsRefForm = orB x.needsRefForm xs.needsRefForm
|
||||
} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Mood => Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : NCase => Str ; a : Agr; nForm : NForm} ;
|
||||
[AP] = {s1,s2 : AForm => Str ; isPre : Bool} ;
|
||||
[RS] = {s1,s2 : Mood => Agr => Str ; c : NCase} ;
|
||||
[CN] = {s1,s2 : Number => Species => ACase => Str ;
|
||||
g : NGender ; a : Animacy ; needsRefForm : Bool} ;
|
||||
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
--# -path=alltenses:.:../abstract:../api
|
||||
|
||||
concrete ConstructionRon of Construction = CatRon **
|
||||
open SyntaxRon, SymbolicRon, ParadigmsRon,
|
||||
LexiconRon, ResRon, Prelude in {
|
||||
|
||||
flags coding=utf8 ;
|
||||
|
||||
lincat
|
||||
Weekday = N ;
|
||||
Month = N ;
|
||||
Monthday = NP ;
|
||||
Year = NP ;
|
||||
|
||||
lin
|
||||
hungry_VP = mkVP (mkA "flămând") ;
|
||||
thirsty_VP = mkVP (mkA "însetat") ;
|
||||
tired_VP = mkVP (mkA "obosit") ;
|
||||
scared_VP = mkVP (mkA "speriat") ;
|
||||
ill_VP = mkVP (mkA "bolnav") ;
|
||||
ready_VP = mkVP (mkA "gata") ;
|
||||
|
||||
has_age_VP card = mkVP (dirV2 (mkV "avea"))
|
||||
(SyntaxRon.mkNP <lin Card card : Card> (mkN "an")) ;
|
||||
|
||||
is_right_VP = mkVP (mkA "corect") ;
|
||||
is_wrong_VP = mkVP (mkA "greșit") ;
|
||||
|
||||
n_units_AP card cn a =
|
||||
mkAP (lin AdA (mkUtt (SyntaxRon.mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
||||
|
||||
n_units_of_NP card cn np =
|
||||
let unit : NP = SyntaxRon.mkNP <lin Card card : Card> (lin CN cn)
|
||||
in heavyNP {
|
||||
s = \\c => (unit.s ! c).comp ++ "din" ++ (np.s ! c).comp ;
|
||||
a = unit.a ; hasClit = HasRef False ; ss = unit.indForm ++ "din" ++ np.indForm
|
||||
} ;
|
||||
|
||||
bottle_of_CN np = mkCN (mkN2 (mkN "sticlă") (mkPrep "de" Ac)) np ;
|
||||
cup_of_CN np = mkCN (mkN2 (mkN "ceașcă") (mkPrep "de" Ac)) np ;
|
||||
glass_of_CN np = mkCN (mkN2 (mkN "pahar") (mkPrep "de" Ac)) np ;
|
||||
|
||||
weekdayPunctualAdv w = {s = w.s ! Sg ! Indef ! ANomAcc} ;
|
||||
weekdayHabitualAdv w = {s = "în fiecare" ++ w.s ! Sg ! Indef ! ANomAcc} ;
|
||||
weekdayLastAdv w = {s = w.s ! Sg ! Indef ! ANomAcc ++ "trecută"} ;
|
||||
weekdayNextAdv w = {s = w.s ! Sg ! Indef ! ANomAcc ++ "viitoare"} ;
|
||||
|
||||
monthAdv m = {s = "în" ++ m.s ! Sg ! Indef ! ANomAcc} ;
|
||||
yearAdv y = {s = "în" ++ (y.s ! No).comp} ;
|
||||
dayMonthAdv d m = {s = "la" ++ (d.s ! No).comp ++ m.s ! Sg ! Indef ! ANomAcc} ;
|
||||
monthYearAdv m y = {s = "în" ++ m.s ! Sg ! Indef ! ANomAcc ++ (y.s ! No).comp} ;
|
||||
dayMonthYearAdv d m y = {
|
||||
s = "la" ++ (d.s ! No).comp ++ m.s ! Sg ! Indef ! ANomAcc ++ (y.s ! No).comp
|
||||
} ;
|
||||
|
||||
intYear = symb ;
|
||||
intMonthday = symb ;
|
||||
|
||||
weekdayN w = w ;
|
||||
monthN m = m ;
|
||||
weekdayPN w = {s = \\_ => w.s ! Sg ! Indef ! ANomAcc ;
|
||||
g = Fem ; n = Sg ; a = Inanimate} ;
|
||||
monthPN m = {s = \\_ => m.s ! Sg ! Indef ! ANomAcc ;
|
||||
g = Masc ; n = Sg ; a = Inanimate} ;
|
||||
|
||||
monday_Weekday = mkN "luni" ;
|
||||
tuesday_Weekday = mkN "marți" ;
|
||||
wednesday_Weekday = mkN "miercuri" ;
|
||||
thursday_Weekday = mkN "joi" ;
|
||||
friday_Weekday = mkN "vineri" ;
|
||||
saturday_Weekday = mkN "sâmbătă" ;
|
||||
sunday_Weekday = mkN "duminică" ;
|
||||
|
||||
january_Month = mkN "ianuarie" ;
|
||||
february_Month = mkN "februarie" ;
|
||||
march_Month = mkN "martie" ;
|
||||
april_Month = mkN "aprilie" ;
|
||||
may_Month = mkN "mai" ;
|
||||
june_Month = mkN "iunie" ;
|
||||
july_Month = mkN "iulie" ;
|
||||
august_Month = mkN "august" ;
|
||||
september_Month = mkN "septembrie" ;
|
||||
october_Month = mkN "octombrie" ;
|
||||
november_Month = mkN "noiembrie" ;
|
||||
december_Month = mkN "decembrie" ;
|
||||
}
|
||||
+168
-2
@@ -1,10 +1,29 @@
|
||||
--# -path=.:../common:../abstract
|
||||
|
||||
concrete ExtendRon of Extend =
|
||||
CatRon ** ExtendFunctor - [PassVPSlash]
|
||||
CatRon ** ExtendFunctor - [
|
||||
PassVPSlash, PassAgentVPSlash, PastPartAP, PastPartAgentAP, PresPartAP,
|
||||
CompoundN, CompoundAP, GerundCN, GerundNP, GerundAdv, ByVP, InOrderToVP,
|
||||
ApposNP, PositAdVAdj, ProgrVPSlash,
|
||||
RNP, ReflRNP, ReflPron, ReflPoss, PredetRNP, AdvRNP, AdvRVP, AdvRAP,
|
||||
ReflA2RNP, PossPronRNP,
|
||||
VPS, BaseVPS, ConsVPS, MkVPS, ConjVPS, PredVPS,
|
||||
VPI, BaseVPI, ConsVPI, MkVPI, ConjVPI, ComplVPIVV,
|
||||
BaseComp, ConsComp, ConjComp,
|
||||
BaseImp, ConsImp, ConjImp,
|
||||
UseDAP, UseDAPFem, UseDAPMasc]
|
||||
with
|
||||
(Grammar = GrammarRon) **
|
||||
open ResRon in {
|
||||
open ResRon, Prelude, Coordination, GrammarRon in {
|
||||
|
||||
lincat
|
||||
RNP = {s : Agr => NCase => Str ; isPron : Bool} ;
|
||||
VPS = {s : Mood => Agr => Str} ;
|
||||
[VPS] = {s1,s2 : Mood => Agr => Str} ;
|
||||
VPI = {s : Agr => Str} ;
|
||||
[VPI] = {s1,s2 : Agr => Str} ;
|
||||
[Comp] = {s1,s2 : Agr => Str} ;
|
||||
[Imp] = {s1,s2 : Polarity => ImpForm => Gender => Str} ;
|
||||
|
||||
lin iFem_Pron = mkPronoun "eu" "mine" "mie" [] [] "meu" "mea" "mei" "mele" Fem Sg P1 ;
|
||||
youFem_Pron = mkPronoun "tu" "tine" "ţie" [] "tu" "tău" "ta" "tăi" "tale" Fem Sg P2 ;
|
||||
@@ -17,4 +36,151 @@ lin iFem_Pron = mkPronoun "eu" "mine" "mie" [] [] "meu" "mea" "mei" "mele" Fem S
|
||||
-- KA: derived from PassV2, objects are ignored
|
||||
lin PassVPSlash vps = insertSimpObj (\\a => vps.s ! PPasse a.g a.n Indef ANomAcc) auxPassive ** {lock_VP = <>};
|
||||
|
||||
PassAgentVPSlash vps np =
|
||||
insertSimpObj (\\a => vps.s ! PPasse a.g a.n Indef ANomAcc ++
|
||||
vps.comp ! a ++ "de" ++ (np.s ! No).comp)
|
||||
auxPassive ** {lock_VP = <>} ;
|
||||
|
||||
PastPartAP vps = {
|
||||
s = \\af => case af of {
|
||||
AF g n sp c => vps.s ! PPasse g n sp c ++ vps.comp ! agrP3 g n ;
|
||||
AA => vps.s ! PPasse Masc Sg Indef ANomAcc ++ vps.comp ! agrP3 Masc Sg
|
||||
} ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
PastPartAgentAP vps np = {
|
||||
s = \\af => case af of {
|
||||
AF g n sp c => vps.s ! PPasse g n sp c ++ vps.comp ! agrP3 g n ++ "de" ++ (np.s ! No).comp ;
|
||||
AA => vps.s ! PPasse Masc Sg Indef ANomAcc ++ vps.comp ! agrP3 Masc Sg ++ "de" ++ (np.s ! No).comp
|
||||
} ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
PresPartAP vp = {
|
||||
s = \\af => case af of {
|
||||
AF g n _ _ => vp.s ! Ger ++ vp.comp ! agrP3 g n ++ vp.ext ! Pos ;
|
||||
AA => vp.s ! Ger ++ vp.comp ! agrP3 Masc Sg ++ vp.ext ! Pos
|
||||
} ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
ProgrVPSlash vps = vps ;
|
||||
|
||||
CompoundN n1 n2 = {
|
||||
s = \\n,sp,c => n2.s ! n ! sp ! c ++ "de" ++ n1.s ! Sg ! Indef ! ANomAcc ;
|
||||
g = n2.g ; a = n2.a
|
||||
} ;
|
||||
|
||||
CompoundAP n a = {
|
||||
s = \\af => a.s ! af ++ "de" ++ n.s ! Sg ! Indef ! ANomAcc ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
GerundCN vp = {
|
||||
s = \\_,_,_ => "faptul de a" ++ vp.s ! Inf ++ vp.comp ! agrP3 Masc Sg ++ vp.ext ! Pos ;
|
||||
g = NNeut ; a = Inanimate ; isComp = True ; needsRefForm = False
|
||||
} ;
|
||||
|
||||
GerundNP vp = heavyNP {
|
||||
s = \\_ => "faptul de a" ++ vp.s ! Inf ++ vp.comp ! agrP3 Masc Sg ++ vp.ext ! Pos ;
|
||||
a = agrP3 Masc Sg ; hasClit = HasRef False ;
|
||||
ss = "faptul de a" ++ vp.s ! Inf ++ vp.comp ! agrP3 Masc Sg ++ vp.ext ! Pos
|
||||
} ;
|
||||
|
||||
GerundAdv vp = {s = vp.s ! Ger ++ vp.comp ! agrP3 Masc Sg ++ vp.ext ! Pos} ;
|
||||
ByVP vp = {s = "prin" ++ vp.s ! Ger ++ vp.comp ! agrP3 Masc Sg ++ vp.ext ! Pos} ;
|
||||
InOrderToVP vp = {s = "pentru a" ++ vp.s ! Inf ++ vp.comp ! agrP3 Masc Sg ++ vp.ext ! Pos} ;
|
||||
PositAdVAdj a = {s = a.s ! AA} ;
|
||||
|
||||
ApposNP np1 np2 = heavyNP {
|
||||
s = \\c => (np1.s ! c).comp ++ SOFT_BIND ++ "," ++ (np2.s ! No).comp ;
|
||||
a = np1.a ; hasClit = np1.nForm ;
|
||||
ss = np1.indForm ++ SOFT_BIND ++ "," ++ np2.indForm
|
||||
} ;
|
||||
|
||||
ReflPron = {
|
||||
s = \\agr,c => reflPron agr.n agr.p (convCase c) ++ reflPronHard agr.g agr.n agr.p ;
|
||||
isPron = True
|
||||
} ;
|
||||
|
||||
ReflPoss num cn = {
|
||||
s = \\agr,c => cn.s ! num.n ! Def ! convCase c ++ possDet agr num.n (agrGender cn.g num.n) (convCase c) ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
PredetRNP pred rnp = {
|
||||
s = \\agr,c => pred.s ! aagr agr.g agr.n ! convCase c ++ rnp.s ! agr ! pred.c ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
AdvRNP np prep rnp = {
|
||||
s = \\agr,c => (np.s ! c).comp ++ prep.s ++ rnp.s ! agr ! prep.c ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
AdvRVP vp prep rnp = insertSimpObj (\\a => prep.s ++ rnp.s ! a ! prep.c) vp ;
|
||||
AdvRAP ap prep rnp = ap ** {
|
||||
s = \\af => case af of {
|
||||
AF g n _ _ => ap.s ! af ++ prep.s ++ rnp.s ! agrP3 g n ! prep.c ;
|
||||
AA => ap.s ! af ++ prep.s ++ rnp.s ! agrP3 Masc Sg ! prep.c
|
||||
} ; isPre = False
|
||||
} ;
|
||||
ReflA2RNP ap rnp = ap ** {
|
||||
s = \\af => case af of {
|
||||
AF g n _ _ => ap.s ! af ++ ap.c2.s ++ rnp.s ! agrP3 g n ! ap.c2.c ;
|
||||
AA => ap.s ! af ++ ap.c2.s ++ rnp.s ! agrP3 Masc Sg ! ap.c2.c
|
||||
} ; isPre = False
|
||||
} ;
|
||||
ReflRNP vps rnp = insertSimpObjPre (\\a => vps.c2.s ++ rnp.s ! a ! vps.c2.c) vps ;
|
||||
|
||||
PossPronRNP pron num cn rnp = heavyNP {
|
||||
s = \\c => cn.s ! num.n ! Def ! convCase c ++ pron.poss ! num.n ! (agrGender cn.g num.n) ! convCase c ++
|
||||
"de" ++ rnp.s ! pron.a ! No ;
|
||||
a = agrP3 (agrGender cn.g num.n) num.n ; hasClit = HasRef False ;
|
||||
ss = cn.s ! num.n ! Def ! ANomAcc ++ pron.poss ! num.n ! (agrGender cn.g num.n) ! ANomAcc ++
|
||||
"de" ++ rnp.s ! pron.a ! No
|
||||
} ;
|
||||
|
||||
UseDAP dap = heavyNP {
|
||||
s = dap.sp ! Masc ; a = agrP3 Masc dap.n ; hasClit = HasRef False ;
|
||||
ss = dap.sp ! Masc ! No
|
||||
} ;
|
||||
UseDAPMasc dap = heavyNP {
|
||||
s = dap.sp ! Masc ; a = agrP3 Masc dap.n ; hasClit = HasRef False ;
|
||||
ss = dap.sp ! Masc ! No
|
||||
} ;
|
||||
UseDAPFem dap = heavyNP {
|
||||
s = dap.sp ! Fem ; a = agrP3 Fem dap.n ; hasClit = HasRef False ;
|
||||
ss = dap.sp ! Fem ! No
|
||||
} ;
|
||||
|
||||
BaseVPS x y = {s1 = x.s ; s2 = y.s} ;
|
||||
ConsVPS x xs = {s1 = \\m,a => x.s ! m ! a ++ comma ++ xs.s1 ! m ! a ; s2 = xs.s2} ;
|
||||
MkVPS t p vp = {s = \\m,a => t.s ++ p.s ++ (mkClause "" False a vp).s ! DDir ! t.t ! t.a ! p.p ! m} ;
|
||||
ConjVPS conj xs = {s = \\m,a => conj.s1 ++ xs.s1 ! m ! a ++ conj.s2 ++ xs.s2 ! m ! a} ;
|
||||
PredVPS np vps = {s = \\m => (np.s ! No).comp ++ vps.s ! m ! np.a} ;
|
||||
|
||||
BaseVPI x y = {s1 = x.s ; s2 = y.s} ;
|
||||
ConsVPI x xs = {s1 = \\a => x.s ! a ++ comma ++ xs.s1 ! a ; s2 = xs.s2} ;
|
||||
MkVPI vp = {s = \\a => "a" ++ vp.s ! Inf ++ vp.comp ! a ++ vp.ext ! Pos} ;
|
||||
ConjVPI conj xs = {s = \\a => conj.s1 ++ xs.s1 ! a ++ conj.s2 ++ xs.s2 ! a} ;
|
||||
ComplVPIVV vv vpi = insertSimpObj vpi.s (useVerb vv) ;
|
||||
|
||||
BaseComp x y = {s1 = x.s ; s2 = y.s} ;
|
||||
ConsComp x xs = {s1 = \\a => x.s ! a ++ comma ++ xs.s1 ! a ; s2 = xs.s2} ;
|
||||
ConjComp conj xs = {s = \\a => conj.s1 ++ xs.s1 ! a ++ conj.s2 ++ xs.s2 ! a} ;
|
||||
|
||||
BaseImp x y = {s1 = x.s ; s2 = y.s} ;
|
||||
ConsImp x xs = {s1 = \\p,f,g => x.s ! p ! f ! g ++ comma ++ xs.s1 ! p ! f ! g ; s2 = xs.s2} ;
|
||||
ConjImp conj xs = {s = \\p,f,g => conj.s1 ++ xs.s1 ! p ! f ! g ++ conj.s2 ++ xs.s2 ! p ! f ! g} ;
|
||||
|
||||
oper
|
||||
possDet : Agr -> Number -> Gender -> ACase -> Str = \agr,n,g,c ->
|
||||
case <agr.n,agr.p> of {
|
||||
<Sg,P1> => i_Pron.poss ! n ! g ! c ; <Sg,P2> => youSg_Pron.poss ! n ! g ! c ;
|
||||
<Sg,P3> => he_Pron.poss ! n ! g ! c ; <Pl,P1> => we_Pron.poss ! n ! g ! c ;
|
||||
<Pl,P2> => youPl_Pron.poss ! n ! g ! c ; <Pl,P3> => they_Pron.poss ! n ! g ! c
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -14,7 +14,10 @@ in {
|
||||
GenericCl vp = mkClause "cineva" False (agrP3 Masc Sg) vp ; -- an exact correspondent does not exist !
|
||||
|
||||
ExistNP np =
|
||||
mkClause "" False np.a (insertSimpObj (\\ag => (np.s ! No ).comp) (useVerb (v_besch20 "existã"))) ;
|
||||
mkClause "" False np.a (insertSimpObj (\\ag => (np.s ! No ).comp) (useVerb (v_besch20 "exista"))) ;
|
||||
ExistNPAdv np adv =
|
||||
mkClause "" False np.a
|
||||
(insertAdv adv.s (insertSimpObj (\\_ => (np.s ! No).comp) (useVerb (v_besch20 "exista")))) ;
|
||||
-- v_besch20 "exista"
|
||||
|
||||
ExistIP ip = {
|
||||
@@ -37,7 +40,7 @@ in {
|
||||
ProgrVP vp = vp; -- for the moment, since there is no particular way to express continuous action, except for the imperfect, which wouldn't work for all tenses
|
||||
|
||||
ImpPl1 vp = let a = {p = P1 ; n = Pl ; g = Masc} in
|
||||
{ s = "sã" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos };
|
||||
{ s = "să" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos };
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
concrete LangRon of Lang =
|
||||
GrammarRon,
|
||||
LexiconRon
|
||||
, ConstructionRon --# notpresent
|
||||
, DocumentationRon --# notpresent
|
||||
** {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
concrete NamesRon of Names = CatRon ** open ResRon, Prelude in {
|
||||
|
||||
lin GivenName, MaleSurname, FemaleSurname = \pn -> -- KA: guessed
|
||||
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \pn -> -- KA: guessed
|
||||
let
|
||||
g = pn.g ;
|
||||
n = pn.n ;
|
||||
@@ -46,4 +46,10 @@ lin UseLN pn = let
|
||||
indForm = pn.s ! No
|
||||
} ;
|
||||
|
||||
lin InLN ln = {s = "în" ++ ln.s ! No} ;
|
||||
PlainLN ln = UseLN ln ;
|
||||
AdjLN ap ln = ln ** {
|
||||
s = \\c => ln.s ! c ++ ap.s ! AF ln.g ln.n Indef (convCase c)
|
||||
} ;
|
||||
|
||||
}
|
||||
+61
-17
@@ -87,25 +87,31 @@ concrete NounRon of Noun =
|
||||
ss = (np.s ! No).comp ++adv.s ;
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = let n = num.n
|
||||
ExtAdvNP np adv = heavyNP {
|
||||
s = \\c => (np.s ! c).comp ++ SOFT_BIND ++ "," ++ adv.s ;
|
||||
a = np.a ;
|
||||
hasClit = np.nForm ;
|
||||
ss = (np.s ! No).comp ++ SOFT_BIND ++ "," ++ adv.s
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = let n = num.n
|
||||
in {
|
||||
s = \\g,c => let s1 = if_then_Str quant.isDef (ord.s ! n ! g ! c) (ord.s ! n ! g ! No);
|
||||
s2 = if_then_Str quant.isPost "" (quant.s ! num.isNum ! n ! g ! (convCase c) ++ s1)
|
||||
|
||||
in
|
||||
s2 ++ num.s ! g ;
|
||||
sp = \\g,c => let
|
||||
s1 = if_then_Str quant.isDef (ord.s ! n ! g ! c) (ord.s ! n ! g ! No) ;
|
||||
s3 = if_then_Str quant.isPost (s1 ++ num.sp ! g ++ quant.sp ! n ! g ! ANomAcc) (quant.sp ! n ! g ! (convCase c) ++ s1 ++ num.sp ! g)
|
||||
|
||||
in
|
||||
s3 ;
|
||||
post = \\g,c => let s1 = ord.s ! n ! g ! No;
|
||||
s2 = if_then_Str quant.isPost (quant.s ! num.isNum ! n ! g ! (convCase c) ++ s1) ""
|
||||
in
|
||||
s2 ;
|
||||
s = \\g,c => let
|
||||
s1 = if_then_Str quant.isDef
|
||||
(ord.s ! n ! g ! c) (ord.s ! n ! g ! No) ;
|
||||
s2 = if_then_Str quant.isPost s1
|
||||
(quant.s ! num.isNum ! n ! g ! (convCase c) ++ s1)
|
||||
in s2 ++ num.s ! g ;
|
||||
sp = \\g,c => let
|
||||
s1 = if_then_Str quant.isDef
|
||||
(ord.s ! n ! g ! c) (ord.s ! n ! g ! No)
|
||||
in if_then_Str quant.isPost
|
||||
(s1 ++ num.sp ! g ++ quant.sp ! n ! g ! (convCase c))
|
||||
(quant.sp ! n ! g ! (convCase c) ++ s1 ++ num.sp ! g) ;
|
||||
post = \\g,c => if_then_Str quant.isPost
|
||||
(quant.sp ! n ! g ! (convCase c)) "" ;
|
||||
n = num.n ;
|
||||
isDef = quant.hasRef;
|
||||
isDef = False ;
|
||||
size = num.size;
|
||||
hasRef = quant.hasRef
|
||||
|
||||
@@ -144,6 +150,12 @@ in {
|
||||
ss = det.sp ! g ! No
|
||||
} ;
|
||||
|
||||
DetDAP det = det ;
|
||||
AdjDAP dap ap = dap ** {
|
||||
s = \\g,c => dap.s ! g ! c ++ ap.s ! AF g dap.n Indef (convCase c) ;
|
||||
sp = \\g,c => dap.sp ! g ! c ++ ap.s ! AF g dap.n Indef (convCase c)
|
||||
} ;
|
||||
|
||||
-- assume that it refers to people
|
||||
|
||||
PossPron p = {
|
||||
@@ -192,6 +204,12 @@ in {
|
||||
isPre = True;
|
||||
};
|
||||
|
||||
OrdNumeralSuperl numeral adj = {
|
||||
s = \\n,g,c => numeral.s ! (convCase c) ! NOrd g ! Formal ++
|
||||
"cel mai" ++ adj.s ! AF g n Indef (convCase c) ;
|
||||
isPre = True
|
||||
} ;
|
||||
|
||||
DefArt = {
|
||||
s = \\b,n,g,c => [] ;
|
||||
sp = \\n,g,c => [] ;
|
||||
@@ -308,4 +326,30 @@ in {
|
||||
isComp = True
|
||||
} ;
|
||||
|
||||
PossNP cn np = {
|
||||
s = \\n,sp,c => cn.s ! n ! sp ! c ++
|
||||
if_then_Str cn.isComp (artPos (agrGender cn.g n) n c) "" ++
|
||||
(np.s ! Ge).comp ;
|
||||
g = cn.g ; a = cn.a ; needsRefForm = cn.needsRefForm ; isComp = True
|
||||
} ;
|
||||
|
||||
PartNP cn np = {
|
||||
s = \\n,sp,c => cn.s ! n ! sp ! c ++ "de" ++ (np.s ! No).comp ;
|
||||
g = cn.g ; a = cn.a ; needsRefForm = cn.needsRefForm ; isComp = True
|
||||
} ;
|
||||
|
||||
CountNP det np = heavyNP {
|
||||
s = \\c => det.s ! np.a.g ! c ++ "dintre" ++ (np.s ! c).comp ;
|
||||
a = agrP3 np.a.g det.n ; hasClit = HasRef False ;
|
||||
ss = det.s ! np.a.g ! No ++ "dintre" ++ np.indForm
|
||||
} ;
|
||||
|
||||
QuantityNP decimal mu =
|
||||
let s = case mu.isPre of {
|
||||
True => mu.s ++ decimal.s ! NCard Masc ;
|
||||
False => decimal.s ! NCard Masc ++ mu.s
|
||||
}
|
||||
in heavyNP {s = \\_ => s ; a = agrP3 Masc Sg ;
|
||||
hasClit = HasRef False ; ss = s} ;
|
||||
|
||||
};
|
||||
@@ -171,6 +171,14 @@ lin pot1plus d e =
|
||||
|
||||
lin pot1as2 n = n ;
|
||||
|
||||
lin pot21 = {
|
||||
s = table {
|
||||
NCard g => \\_,_ => "o sută" ;
|
||||
NOrd g => \\_,_ => mkOrdinalForm "sută" g
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot2 d =
|
||||
{s = table {
|
||||
NCard g => \\_,_ => d.s ! (NCard Fem) ! unit ! indep ++ (mksute d.size) ;
|
||||
@@ -183,6 +191,14 @@ lin pot2plus d e =
|
||||
size = e.size} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
|
||||
lin pot31 = {
|
||||
s = table {
|
||||
NCard g => \\_,_ => "o mie" ;
|
||||
NOrd g => \\_,_ => mkOrdinalForm "mie" g
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot3 n =
|
||||
{s = table {
|
||||
@@ -198,9 +214,67 @@ lin pot3plus n m =
|
||||
size = m.size
|
||||
};
|
||||
|
||||
lin pot3decimal d = {
|
||||
s = \\c,_,_ => d.s ! NCard Masc ++ "mii" ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot3as4 n = n ;
|
||||
|
||||
lin pot41 = {
|
||||
s = table {
|
||||
NCard g => \\_,_ => "un milion" ;
|
||||
NOrd g => \\_,_ => mkOrdinalForm "milion" g
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot4 n = {
|
||||
s = table {
|
||||
NCard g => \\f,_ => n.s ! NCard Masc ! f ! indep ++ "milioane" ;
|
||||
NOrd g => \\f,_ => n.s ! NCard Masc ! f ! indep ++ mkOrdinalForm "milion" g
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot4plus n m = {
|
||||
s = \\c,f,_ => (pot4 n).s ! c ! f ! indep ++ m.s ! c ! f ! attr ;
|
||||
size = m.size
|
||||
} ;
|
||||
|
||||
lin pot4decimal d = {
|
||||
s = \\_,_,_ => d.s ! NCard Masc ++ "milioane" ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot4as5 n = n ;
|
||||
|
||||
lin pot51 = {
|
||||
s = table {
|
||||
NCard g => \\_,_ => "un miliard" ;
|
||||
NOrd g => \\_,_ => mkOrdinalForm "miliard" g
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot5 n = {
|
||||
s = table {
|
||||
NCard g => \\f,_ => n.s ! NCard Masc ! f ! indep ++ "miliarde" ;
|
||||
NOrd g => \\f,_ => n.s ! NCard Masc ! f ! indep ++ mkOrdinalForm "miliard" g
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
lin pot5plus n m = {
|
||||
s = \\c,f,_ => (pot5 n).s ! c ! f ! indep ++ m.s ! c ! f ! attr ;
|
||||
size = m.size
|
||||
} ;
|
||||
|
||||
lin pot5decimal d = {
|
||||
s = \\_,_,_ => d.s ! NCard Masc ++ "miliarde" ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
oper mksute : Size -> Str = \sz -> table {sg => "sută" ; _ => "sute" } ! sz ;
|
||||
oper mkSute : Size -> Gender -> Str = \sz, g ->
|
||||
table {sg => mkOrdinalForm "sută" g ;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = {s = (np.s ! No).comp} ;
|
||||
UttVP vp = let a = agrP3 Masc Sg in
|
||||
{s = "sã" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos} ;
|
||||
{s = "să" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos} ;
|
||||
UttAdv adv = adv ;
|
||||
UttCN cn = {s = cn.s ! Sg ! Indef ! ANomAcc} ;
|
||||
UttAP ap = {s = ap.s ! AF Masc Sg Indef ANomAcc} ;
|
||||
|
||||
+13
-9
@@ -375,6 +375,10 @@ oper
|
||||
Imperative => mma
|
||||
}};
|
||||
|
||||
bindAfterHyphen : Str -> Str = \s -> s ++ BIND ;
|
||||
|
||||
bindBeforeHyphen : Str -> Str = \s -> BIND ++ s ;
|
||||
|
||||
genCliticsCase : Agr -> NCase -> {s : Clitics => Str} = \agr, c ->
|
||||
case c of
|
||||
{Da => cliticsDa agr.g agr.n agr.p ;
|
||||
@@ -384,29 +388,29 @@ oper
|
||||
|
||||
aRefl : Agr -> RAgr = \a ->
|
||||
case <a.g,a.n,a.p> of
|
||||
{<_,_,P3> => {s = (genClit "se" "s-" "se" "").s } ;
|
||||
{<_,_,P3> => {s = (genClit "se" (bindAfterHyphen "s-") "se" "").s } ;
|
||||
_ => {s = (cliticsAc a.g a.n a.p).s }
|
||||
};
|
||||
|
||||
dRefl : Agr -> RAgr = \a ->
|
||||
case <a.g,a.n,a.p> of
|
||||
{<_,_,P3> => {s = (genClit "îşi" "-şi" "şi" "").s } ;
|
||||
{<_,_,P3> => {s = (genClit "îşi" (bindBeforeHyphen "-şi") "şi" "").s } ;
|
||||
_ => {s = (cliticsDa a.g a.n a.p).s }
|
||||
};
|
||||
|
||||
cliticsAc : Gender -> Number -> Person -> {s: Clitics => Str} = \g,n,p ->
|
||||
case <g,n,p> of
|
||||
{<_,Sg,P1> => genClit "mă" "m-" "mă" "-mă"; <_,Pl,P1> => genClit "ne" "ne-" "ne" "-ne";
|
||||
<_,Sg,P2> => genClit "te" "te-" "te" "-te"; <_,Pl,P2> => genClit "vă" "v-" "vă" "-vă";
|
||||
<Masc,Sg,P3> => genClit "îl" "l-" "-l" "-l"; <Masc,Pl,P3> => genClit "îi" "i-" "-i" "-i";
|
||||
<Fem,Sg,P3> => genClit "o" "-o" "-o" "-o"; <Fem,Pl,P3> => genClit "le" "le-" "le" "-le"
|
||||
{<_,Sg,P1> => genClit "mă" (bindAfterHyphen "m-") "mă" (bindBeforeHyphen "-mă"); <_,Pl,P1> => genClit "ne" (bindAfterHyphen "ne-") "ne" (bindBeforeHyphen "-ne");
|
||||
<_,Sg,P2> => genClit "te" (bindAfterHyphen "te-") "te" (bindBeforeHyphen "-te"); <_,Pl,P2> => genClit "vă" (bindAfterHyphen "v-") "vă" (bindBeforeHyphen "-vă");
|
||||
<Masc,Sg,P3> => genClit "îl" (bindAfterHyphen "l-") (bindBeforeHyphen "-l") (bindBeforeHyphen "-l"); <Masc,Pl,P3> => genClit "îi" (bindAfterHyphen "i-") (bindBeforeHyphen "-i") (bindBeforeHyphen "-i");
|
||||
<Fem,Sg,P3> => genClit "o" (bindBeforeHyphen "-o") (bindBeforeHyphen "-o") (bindBeforeHyphen "-o"); <Fem,Pl,P3> => genClit "le" (bindAfterHyphen "le-") "le" (bindBeforeHyphen "-le")
|
||||
};
|
||||
|
||||
cliticsDa : Gender -> Number -> Person -> {s : Clitics => Str} = \g,n,p ->
|
||||
case <g,n,p> of
|
||||
{<_,Sg,P1> => genClit "îmi" "mi-" "mi" "-mi"; <_,Pl,P1> => genClit "ne" "ne-" "ni" "-ne";
|
||||
<_,Sg,P2> => genClit "îţi" "ţi-" "ţi" "-ţi"; <_,Pl,P2> => genClit "vă" "v-" "vi" "-vă";
|
||||
<_,Sg,P3> => genClit "îi" "i-" "i" "-i"; <_,Pl,P3> => genClit "le" "le-" "li" "-le"
|
||||
{<_,Sg,P1> => genClit "îmi" (bindAfterHyphen "mi-") "mi" (bindBeforeHyphen "-mi"); <_,Pl,P1> => genClit "ne" (bindAfterHyphen "ne-") "ni" (bindBeforeHyphen "-ne");
|
||||
<_,Sg,P2> => genClit "îţi" (bindAfterHyphen "ţi-") "ţi" (bindBeforeHyphen "-ţi"); <_,Pl,P2> => genClit "vă" (bindAfterHyphen "v-") "vi" (bindBeforeHyphen "-vă");
|
||||
<_,Sg,P3> => genClit "îi" (bindAfterHyphen "i-") "i" (bindBeforeHyphen "-i"); <_,Pl,P3> => genClit "le" (bindAfterHyphen "le-") "li" (bindBeforeHyphen "-le")
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
_ => vpr.s ! Imper PlP2 ++ vpr.comp ! agPl ++ vpr.ext ! Pos
|
||||
};
|
||||
<Pos, ImpF n True> => case n of
|
||||
{Sg => "sã" ++ clNegSg ++ conjVP vpr agSg ++ vpr.comp ! agSg ++ vpr.ext ! Pos;
|
||||
Pl => "sã" ++ clNegPl ++ conjVP vpr agPl ++ vpr.comp ! agPl ++ vpr.ext ! Pos
|
||||
{Sg => "să" ++ clNegSg ++ conjVP vpr agSg ++ vpr.comp ! agSg ++ vpr.ext ! Pos;
|
||||
Pl => "să" ++ clNegPl ++ conjVP vpr agPl ++ vpr.comp ! agPl ++ vpr.ext ! Pos
|
||||
};
|
||||
<Neg, ImpF n b> => case n of
|
||||
{Sg => "nu" ++ clNegSg ++ vpr.s ! Inf ++ vpr.comp ! agSg ++ vpr.ext ! Pos;
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
EmbedVP vp = let a = agrP3 Masc Sg in
|
||||
{ s= "sã" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos };
|
||||
{ s= "să" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos };
|
||||
|
||||
UseCl t p cl = {
|
||||
s = \\o => t.s ++ p.s ++ cl.s ! DDir ! t.t ! t.a ! p.p ! o
|
||||
@@ -99,6 +99,9 @@
|
||||
s = \\o => s.s ! o ++ "," ++ r.s ! Indic ! agrP3 Masc Sg
|
||||
} ;
|
||||
|
||||
SSubjS s1 subj s2 = {s = \\m => s1.s ! m ++ subj.s ++ s2.s ! m} ;
|
||||
AdvImp adv imp = {s = \\p,f,g => adv.s ++ imp.s ! p ! f ! g} ;
|
||||
|
||||
oper putClit : Agr -> ParClit -> VP -> VP = \ag, pc, vp -> let nrC = nextClit vp.nrClit pc
|
||||
in
|
||||
case pc of
|
||||
|
||||
+12
-4
@@ -7,7 +7,7 @@ concrete VerbRon of Verb =
|
||||
lin
|
||||
UseV = useVerb ;
|
||||
|
||||
ComplVV v vp =insertSimpObj (\\a => "sã" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos) (useVerb v) ;
|
||||
ComplVV v vp =insertSimpObj (\\a => "să" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++vp.comp ! a ++ vp.ext ! Pos) (useVerb v) ;
|
||||
|
||||
|
||||
ComplVS v s = insertExtrapos (\\b => conjThat ++ s.s ! (v.m ! b)) (predV v) ;
|
||||
@@ -69,7 +69,7 @@ concrete VerbRon of Verb =
|
||||
-- needs fixing - agreement for the added verb must be made accordingly to what we add in ComplSlash !!!
|
||||
-- fixed with extra parameter !
|
||||
|
||||
SlashV2V v vp = (insertSimpObj (\\a => "sã" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++ vp.comp ! a ++ vp.ext ! Pos) (useVerb v)) ** {needAgr = True ; needClit = True ;c2 = v.c2} ;
|
||||
SlashV2V v vp = (insertSimpObj (\\a => "să" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++ vp.comp ! a ++ vp.ext ! Pos) (useVerb v)) ** {needAgr = True ; needClit = True ;c2 = v.c2} ;
|
||||
|
||||
|
||||
SlashV2S v s = (insertExtrapos (\\b => conjThat ++ s.s ! Indic) (useVerb v)) ** {needAgr = False; needClit = True ;c2 = v.c2};
|
||||
@@ -141,7 +141,7 @@ concrete VerbRon of Verb =
|
||||
|
||||
|
||||
SlashVV v vp =
|
||||
insertObjc (\\a => "sã" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++ vp.comp ! a ++ vp.ext ! Pos) ((useVerb v) **{c2=vp.c2; needAgr= vp.needAgr ; needClit = False; lock_VPSlash = <>}) ;
|
||||
insertObjc (\\a => "să" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp a ++ vp.comp ! a ++ vp.ext ! Pos) ((useVerb v) **{c2=vp.c2; needAgr= vp.needAgr ; needClit = False; lock_VPSlash = <>}) ;
|
||||
|
||||
SlashV2VNP v np vp = let s1 = v.c2.s ++(np.s ! (v.c2.c)).comp ;
|
||||
ss = case np.nForm of
|
||||
@@ -178,6 +178,14 @@ concrete VerbRon of Verb =
|
||||
AdvVP vp adv = insertAdv adv.s vp ;
|
||||
AdVVP adv vp = insertAdv adv.s vp ;
|
||||
|
||||
ExtAdvVP vp adv = insertAdv (SOFT_BIND ++ "," ++ adv.s) vp ;
|
||||
AdvVPSlash vp adv = (insertAdv adv.s vp) ** {
|
||||
c2 = vp.c2 ; needAgr = vp.needAgr ; needClit = vp.needClit ; lock_VPSlash = <>
|
||||
} ;
|
||||
AdVVPSlash adv vp = (insertAdv adv.s vp) ** {
|
||||
c2 = vp.c2 ; needAgr = vp.needAgr ; needClit = vp.needClit ; lock_VPSlash = <>
|
||||
} ;
|
||||
|
||||
PassV2 v = insertSimpObj (\\a => v.s ! PPasse a.g a.n Indef ANomAcc) auxPassive ** {lock_VP = <>};
|
||||
|
||||
VPSlashPrep vp prep = vp ** {c2 = prep ; needAgr = False; needClit = True} ; ---- AR
|
||||
@@ -193,6 +201,6 @@ insertObjc : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp ->
|
||||
|
||||
|
||||
getConjComp : VP -> Agr -> {s: Agr => Str} = \vp,ag ->
|
||||
{s = \\a => "sã" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp ag ++ vp.comp ! a ++ vp.ext ! Pos};
|
||||
{s = \\a => "să" ++ (flattenSimpleClitics vp.nrClit vp.clAcc vp.clDat (vp.isRefl ! a)) ++ conjVP vp ag ++ vp.comp ! a ++ vp.ext ! Pos};
|
||||
|
||||
};
|
||||
Reference in new issue
Block a user