forked from GitHub/gf-rgl
Merge pull request #72 from odanoburu/porextend
(Por) add lins to Extend + mkV2A paradigm change
This commit is contained in:
@@ -70,7 +70,7 @@ abstract Sentence = Cat ** {
|
|||||||
|
|
||||||
-- This covers subjunctive clauses, but they can also be added to the end.
|
-- This covers subjunctive clauses, but they can also be added to the end.
|
||||||
|
|
||||||
SSubjS : S -> Subj -> S -> S ; -- I go home if she comes
|
SSubjS : S -> Subj -> S -> S ; -- I go home, if she comes
|
||||||
|
|
||||||
-- A sentence can be modified by a relative clause referring to its contents.
|
-- A sentence can be modified by a relative clause referring to its contents.
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ concrete ExtendPor of Extend =
|
|||||||
CatPor ** ExtendFunctor -
|
CatPor ** ExtendFunctor -
|
||||||
[
|
[
|
||||||
AdAdV,
|
AdAdV,
|
||||||
|
AdjAsCN,
|
||||||
|
AdjAsNP,
|
||||||
ApposNP,
|
ApposNP,
|
||||||
BaseVPS,
|
BaseVPS,
|
||||||
ByVP,
|
ByVP,
|
||||||
@@ -13,6 +15,7 @@ concrete ExtendPor of Extend =
|
|||||||
CompoundAP,
|
CompoundAP,
|
||||||
CompoundN,
|
CompoundN,
|
||||||
CompVP,
|
CompVP,
|
||||||
|
ConjVPS,
|
||||||
ConsVPS,
|
ConsVPS,
|
||||||
--EmptyRelSlash,
|
--EmptyRelSlash,
|
||||||
ExistsNP,
|
ExistsNP,
|
||||||
@@ -27,11 +30,13 @@ concrete ExtendPor of Extend =
|
|||||||
ICompAP,
|
ICompAP,
|
||||||
InOrderToVP,
|
InOrderToVP,
|
||||||
ListVPS,
|
ListVPS,
|
||||||
|
MkVPS,
|
||||||
PassAgentVPSlash,
|
PassAgentVPSlash,
|
||||||
PassVPSlash,
|
PassVPSlash,
|
||||||
PastPartAP,
|
PastPartAP,
|
||||||
PastPartAgentAP,
|
PastPartAgentAP,
|
||||||
PositAdVAdj,
|
PositAdVAdj,
|
||||||
|
PredVPS,
|
||||||
PresPartAP,
|
PresPartAP,
|
||||||
ProDrop,
|
ProDrop,
|
||||||
PurposeVP,
|
PurposeVP,
|
||||||
@@ -52,13 +57,13 @@ concrete ExtendPor of Extend =
|
|||||||
with
|
with
|
||||||
(Grammar = GrammarPor), (Syntax = SyntaxPor) **
|
(Grammar = GrammarPor), (Syntax = SyntaxPor) **
|
||||||
open
|
open
|
||||||
GrammarPor,
|
GrammarPor,
|
||||||
ResPor,
|
ResPor,
|
||||||
MorphoPor,
|
MorphoPor,
|
||||||
Coordination,
|
Coordination,
|
||||||
Prelude,
|
Prelude,
|
||||||
ParadigmsPor,
|
ParadigmsPor,
|
||||||
(S = StructuralPor) in {
|
(S = StructuralPor) in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
GenNP np =
|
GenNP np =
|
||||||
@@ -85,17 +90,28 @@ concrete ExtendPor of Extend =
|
|||||||
c = Nom
|
c = Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
---- these come from ExtraRomance: how to avoid the repetition?
|
||||||
|
---- can't seem to be able to use two functors
|
||||||
lincat
|
lincat
|
||||||
VPS = {s : Agr => Mood => Str} ;
|
VPS = {s : Mood => Agr => Bool => Str} ;
|
||||||
[VPS] = {s1,s2 : Agr => Mood => Str} ;
|
[VPS] = {s1,s2 : Mood => Agr => Bool => Str} ;
|
||||||
-- VPI = {s : VType => Agr => Str } ;
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseVPS = twoTable2 Agr Mood ;
|
BaseVPS x y = twoTable3 Mood Agr Bool x y ;
|
||||||
ConsVPS = consrTable2 Agr Mood comma ;
|
ConsVPS = consrTable3 Mood Agr Bool comma ;
|
||||||
|
|
||||||
-- MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ;
|
PredVPS np vpi = {
|
||||||
--TODO: write mkVPS oper
|
s = \\m => (np.s ! Nom).comp ++ vpi.s ! m ! np.a ! np.isNeg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
MkVPS tm p vp = {
|
||||||
|
s = \\m,agr,isNeg =>
|
||||||
|
tm.s ++ p.s ++
|
||||||
|
(mkClausePol (orB isNeg vp.isNeg) [] False False agr vp).s
|
||||||
|
! DDir ! tm.t ! tm.a ! p.p ! m
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjVPS = conjunctDistrTable3 Mood Agr Bool ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ProDrop p = {
|
ProDrop p = {
|
||||||
@@ -148,13 +164,23 @@ concrete ExtendPor of Extend =
|
|||||||
|
|
||||||
ComplBareVS = ComplVS ;
|
ComplBareVS = ComplVS ;
|
||||||
|
|
||||||
|
AdjAsCN ap = {
|
||||||
|
s =\\n => ap.s ! AF Masc n ;
|
||||||
|
g = Masc
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdjAsNP ap = heavyNP {
|
||||||
|
s = \\_c => ap.s ! AF Masc Sg ;
|
||||||
|
a = Ag Masc Sg P3
|
||||||
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
pastPartAP : VPSlash -> Str -> AP ;
|
pastPartAP : VPSlash -> Str -> AP ;
|
||||||
pastPartAP vps agent = lin AP {
|
pastPartAP vps agent = lin AP {
|
||||||
s = \\af => vps.comp ! (aform2aagr af ** {p = P3}) ++ vps.s.s ! VPart (aform2gender af) (aform2number af) ++ agent ;
|
s = \\af => vps.comp ! (aform2aagr af ** {p = P3}) ++ vps.s.s ! VPart (aform2gender af) (aform2number af) ++ agent ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
passVPSlash : VPSlash -> Str -> VP ;
|
passVPSlash : VPSlash -> Str -> VP ;
|
||||||
passVPSlash vps agent = let
|
passVPSlash vps agent = let
|
||||||
auxvp = predV auxPassive
|
auxvp = predV auxPassive
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ flags
|
|||||||
lin
|
lin
|
||||||
easy_A2V = mkA2V (mkA "fácil") dative genitive ;
|
easy_A2V = mkA2V (mkA "fácil") dative genitive ;
|
||||||
married_A2 = mkA2 (mkA "casado") dative ;
|
married_A2 = mkA2 (mkA "casado") dative ;
|
||||||
probable_AS = mkAS (mkA "provável" "provável" "prováveis" "prováveis" "provavelmente") ;
|
probable_AS = mkAS (prefA (mkA "provável" "provavelmente")) ;
|
||||||
fun_AV = mkAV (mkA "divertido") genitive ;
|
fun_AV = mkAV (mkA "divertido") genitive ;
|
||||||
-- A
|
-- A
|
||||||
bad_A = prefA (mkA (mkA "mau") (mkA "pior")) ;
|
bad_A = prefA (mkA (mkA "mau") (mkA "pior")) ;
|
||||||
@@ -38,7 +38,7 @@ lin
|
|||||||
narrow_A = mkA "estreito" ;
|
narrow_A = mkA "estreito" ;
|
||||||
near_A = mkA "perto" ;
|
near_A = mkA "perto" ;
|
||||||
new_A = prefA (mkA "novo") ;
|
new_A = prefA (mkA "novo") ;
|
||||||
old_A = prefA (mkA "velho") ;
|
old_A = prefA (mkA "velho") ;
|
||||||
ready_A = mkA "pronto" ;
|
ready_A = mkA "pronto" ;
|
||||||
red_A = mkA "vermelho" ;
|
red_A = mkA "vermelho" ;
|
||||||
rotten_A = mkA "podre" ;
|
rotten_A = mkA "podre" ;
|
||||||
@@ -58,7 +58,7 @@ lin
|
|||||||
white_A = compADeg (mkA "branco") ;
|
white_A = compADeg (mkA "branco") ;
|
||||||
wide_A = mkA "largo" ; -- extenso
|
wide_A = mkA "largo" ; -- extenso
|
||||||
yellow_A = mkA "amarelo" ;
|
yellow_A = mkA "amarelo" ;
|
||||||
young_A = prefA (mkA "jovem" "jovem" "jovens" "jovens" "juvenilmente") ;
|
young_A = prefA (mkA "jovem" "juvenilmente") ;
|
||||||
already_Adv = mkAdv "já" ;
|
already_Adv = mkAdv "já" ;
|
||||||
far_Adv = mkAdv "longe" ; ----?
|
far_Adv = mkAdv "longe" ; ----?
|
||||||
now_Adv = mkAdv "agora" ;
|
now_Adv = mkAdv "agora" ;
|
||||||
|
|||||||
@@ -124,16 +124,16 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkAdj2N : (_,_: N) -> Str -> Adj = \mascN, femN, burramente ->
|
mkAdj2 : (_,_: Str) -> Adj ;
|
||||||
{s = table {
|
mkAdj2 aj av = let
|
||||||
AF Masc n => mascN.s ! n ;
|
adj = mkAdjReg aj
|
||||||
AF Fem n => femN.s ! n ;
|
in {
|
||||||
AA => burramente
|
s = table {
|
||||||
}
|
AF g n => adj.s ! AF g n ;
|
||||||
|
AA => av
|
||||||
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkAdjN : N -> Str -> Adj = \n, burramente -> mkAdj2N n n burramente ;
|
|
||||||
|
|
||||||
-- Then the regular and invariant patterns.
|
-- Then the regular and invariant patterns.
|
||||||
|
|
||||||
adjPreto : Str -> Adj = \preto ->
|
adjPreto : Str -> Adj = \preto ->
|
||||||
@@ -174,7 +174,7 @@ oper
|
|||||||
"ã" => "a"
|
"ã" => "a"
|
||||||
} ;
|
} ;
|
||||||
alemvo : Str = alem + v + "o" ;
|
alemvo : Str = alem + v + "o" ;
|
||||||
in mkAdj alemão alemã (alemã + "s") (alemã + "es") (alemã + "amente") ;
|
in mkAdj alemão alemã (alemã + "s") (alemã + "es") (alemã + "mente") ;
|
||||||
|
|
||||||
adjEuropeu : Str -> Adj = \europeu -> let europe = init europeu in
|
adjEuropeu : Str -> Adj = \europeu -> let europe = init europeu in
|
||||||
mkAdj europeu (europe + "ia") (europeu + "s") (europe + "ias")
|
mkAdj europeu (europe + "ia") (europeu + "s") (europe + "ias")
|
||||||
@@ -183,11 +183,13 @@ oper
|
|||||||
mkAdjReg : Str -> Adj = \a ->
|
mkAdjReg : Str -> Adj = \a ->
|
||||||
case a of {
|
case a of {
|
||||||
pret + "o" => adjPreto a ;
|
pret + "o" => adjPreto a ;
|
||||||
anarquist + v@("e" | "a") => adjUtil (anarquist + v) (anarquist + v + "s") ;
|
anarquist + v@("e" | "a") => adjUtil a (a + "s") ;
|
||||||
ouvido + "r" => adjOuvidor a (ouvido + "ra") ;
|
ouvido + "r" => adjOuvidor a (ouvido + "ra") ;
|
||||||
chin + "ês" => adjFrances a ;
|
chin + "ês" => adjFrances a ;
|
||||||
europ + "eu" => adjEuropeu a ;
|
europ + "eu" => adjEuropeu a ;
|
||||||
alem + "ão" => adjVo a ;
|
alem + "ão" => adjVo a ;
|
||||||
|
provav + v@("e" | "i") + "l" => adjUtil a (provav + "eis") ;
|
||||||
|
jove + "m" => adjUtil a (jove + "ns") ;
|
||||||
_ => adjUtil a (a + "s")
|
_ => adjUtil a (a + "s")
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -203,9 +203,9 @@ oper
|
|||||||
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ;
|
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ;
|
||||||
lock_A = <>} ;
|
lock_A = <>} ;
|
||||||
|
|
||||||
mk2A : (espanhol,espanhola : Str) -> A ;
|
mk2A : (único,unicamente : Str) -> A ;
|
||||||
mk2A a b = compADeg {s = \\_ => (mkAdj2N (mkN a) (mkN b) (b + "mente")).s ; isPre = False ;
|
mk2A adj adv = compADeg {s = \\_ => (mkAdj2 adj adv).s ; isPre = False ;
|
||||||
lock_A = <>} ;
|
lock_A = <>} ;
|
||||||
|
|
||||||
mk5A : (preto,preta,pretos,pretas,pretamente : Str) -> A ;
|
mk5A : (preto,preta,pretos,pretas,pretamente : Str) -> A ;
|
||||||
mk5A a b c d e = compADeg {s = \\_ => (mkAdj a b c d e).s ;
|
mk5A a b c d e = compADeg {s = \\_ => (mkAdj a b c d e).s ;
|
||||||
|
|||||||
Reference in New Issue
Block a user