forked from GitHub/gf-core
working towards tram in 4 langs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
--# -path=.:resource/abstract:resource/french:resource/romance:prelude
|
||||
--# -path=.:resource-1.0/abstract:resource-1.0/french:resource-1.0/common:resource-1.0/multimodal:resource-1.0/romance:prelude
|
||||
|
||||
concrete TramFre of Tram = TramI with
|
||||
(Multimodal = MultimodalFre),
|
||||
|
||||
5
examples/tram/TramGer.gf
Normal file
5
examples/tram/TramGer.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:resource-1.0/abstract:resource-1.0/common:resource-1.0/multimodal:resource-1.0/german:prelude
|
||||
|
||||
concrete TramGer of Tram = TramI with
|
||||
(Multimodal = MultimodalGer),
|
||||
(Math = MathGer) ;
|
||||
@@ -7,11 +7,11 @@ concrete LangFre of Lang =
|
||||
AdverbFre,
|
||||
-- NumeralFre,
|
||||
SentenceFre,
|
||||
-- QuestionFre,
|
||||
QuestionFre,
|
||||
-- RelativeFre,
|
||||
-- ConjunctionFre,
|
||||
-- PhraseFre,
|
||||
-- TensedFre,
|
||||
PhraseFre,
|
||||
TensedFre,
|
||||
StructuralFre,
|
||||
BasicFre
|
||||
** {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
concrete MathFre of Math = CatFre ** MathRomance with
|
||||
(DiffRomance = DiffFre) ;
|
||||
(ResRomance = ResFre) ;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
concrete PhraseFre of Phrase = CatFre, TenseX ** PhraseRomance with
|
||||
(DiffRomance = DiffFre) ;
|
||||
(ResRomance = ResFre) ;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
concrete QuestionFre of Question = CatFre ** QuestionRomance with
|
||||
(DiffRomance = DiffFre) ;
|
||||
(ResRomance = ResFre) ;
|
||||
|
||||
@@ -76,17 +76,17 @@ lin
|
||||
-- some_NDet = mkDeterminerNum "quelques" "quelques" ;
|
||||
-- something_NP = mkNameNounPhrase ["quelque chose"] Masc ;
|
||||
somewhere_Adv = ss ["quelque part"] ; --- ne - pas
|
||||
-- that_Det = mkDeterminer singular (pre {"ce" ; "cet" / voyelle}) "cette" ; --- là
|
||||
-- that_NP = mkNameNounPhrase ["ça"] Masc ;
|
||||
there7from_Adv = ss "de là" ;
|
||||
that_Quant = {s = \\g,c => prepCase c ++ genForms "ce" "cette" ! g} ; ---- cet
|
||||
that_NP = pn2np (mkPN ["ceci"] Masc) ;
|
||||
there7from_Adv = ss ["de là"] ;
|
||||
there7to_Adv = ss "là" ; --- y
|
||||
there_Adv = ss "là" ;
|
||||
therefore_PConj = ss "donc" ;
|
||||
-- these_NDet = mkDeterminerNum "ces" "ces" ; --- ci
|
||||
-- they_Pron = pronNounPhrase pronIls ;
|
||||
-- they8fem_Pron = pronNounPhrase pronElles ;
|
||||
-- this_Det = mkDeterminer singular (pre {"ce" ; "cet" / voyelle}) "cette" ; --- ci
|
||||
-- this_NP = mkNameNounPhrase ["ceci"] Masc ;
|
||||
this_Quant = {s = \\g,c => prepCase c ++ genForms "ce" "cette" ! g} ; ---- cet
|
||||
this_NP = pn2np (mkPN ["ceci"] Masc) ;
|
||||
-- those_NDet = mkDeterminerNum "ces" "ces" ; --- là
|
||||
thou_Pron = mkPronoun
|
||||
"tu" (elision "t") (elision "t") "toi" "ton" (elisPoss "t") "tes"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
concrete TensedFre of Tensed = CatFre, TenseX ** TensedRomance with
|
||||
(DiffRomance = DiffFre) ;
|
||||
(ResRomance = ResFre) ;
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
--concrete MathGer of Math = CatGer ** open Prelude, ResGer in {
|
||||
--
|
||||
--lin
|
||||
-- SymbPN i = {s = \\c => i.s ; a = agrP3 Sg} ; --- c
|
||||
-- IntPN i = {s = \\c => i.s ; a = agrP3 Sg} ; --- c
|
||||
-- CNIntNP cn i = {
|
||||
-- s = \\c => (cn.s ! Sg ! Nom ++ i.s) ;
|
||||
-- a = agrP3 Sg
|
||||
-- } ;
|
||||
-- CNSymbNP det cn xs = {
|
||||
-- s = \\c => det.s ++ cn.s ! det.n ! c ++ xs.s ;
|
||||
-- a = agrP3 det.n
|
||||
-- } ;
|
||||
--
|
||||
--lincat
|
||||
--
|
||||
-- Symb, SymbList = SS ;
|
||||
--
|
||||
--lin
|
||||
--
|
||||
-- MkSymb s = s ;
|
||||
--
|
||||
-- BaseSymb = infixSS "and" ;
|
||||
-- ConsSymb = infixSS "," ;
|
||||
--
|
||||
--}
|
||||
concrete MathGer of Math = CatGer ** open Prelude, ResGer in {
|
||||
|
||||
lin
|
||||
SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c
|
||||
IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c
|
||||
{-
|
||||
CNIntNP cn i = {
|
||||
s = \\c => (cn.s ! Sg ! DIndef ! Nom ++ i.s) ;
|
||||
a = agrP3 cn.g Sg
|
||||
} ;
|
||||
CNSymbNP det cn xs = let g = cn.g in {
|
||||
s = \\c => det.s ! cn.isMod ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ;
|
||||
a = agrP3 g det.n
|
||||
} ;
|
||||
-}
|
||||
lincat
|
||||
|
||||
Symb, SymbList = SS ;
|
||||
|
||||
lin
|
||||
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS "und" ;
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
--# -path=.:../english/:../abstract:../common:prelude
|
||||
|
||||
concrete DemonstrativeEng of Demonstrative = CatEng, TenseX ** DemonstrativeI with
|
||||
(Test = TestEng),
|
||||
(Structural = StructuralEng) ;
|
||||
|
||||
(Lang = LangEng) ;
|
||||
|
||||
2
lib/resource-1.0/multimodal/DemonstrativeFre.gf
Normal file
2
lib/resource-1.0/multimodal/DemonstrativeFre.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete DemonstrativeFre of Demonstrative = CatFre, TenseX ** DemonstrativeI with
|
||||
(Lang = LangFre) ;
|
||||
4
lib/resource-1.0/multimodal/DemonstrativeGer.gf
Normal file
4
lib/resource-1.0/multimodal/DemonstrativeGer.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../german/:../abstract:../common:prelude
|
||||
|
||||
concrete DemonstrativeGer of Demonstrative = CatGer, TenseX ** DemonstrativeI with
|
||||
(Lang = LangGer) ;
|
||||
@@ -1,5 +1,5 @@
|
||||
incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
||||
open Prelude, Test, Structural, ParamX, DemRes in {
|
||||
open Prelude, Lang, ParamX, DemRes in {
|
||||
|
||||
lincat
|
||||
|
||||
@@ -24,8 +24,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
||||
mkDem
|
||||
{s : Polarity => Str}
|
||||
(polCases
|
||||
(UttS (PosCl cl))
|
||||
(UttS (NegCl cl)))
|
||||
(UttS (UseCl TPres ASimul PPos cl))
|
||||
(UttS (UseCl TPres ASimul PNeg cl)))
|
||||
(concatPoint np vp) ;
|
||||
|
||||
MQPredVP np vp =
|
||||
@@ -34,8 +34,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
||||
mkDem
|
||||
{s : Polarity => Str}
|
||||
(polCases
|
||||
(UttQS (PosQCl cl))
|
||||
(UttQS (NegQCl cl)))
|
||||
(UttQS (UseQCl TPres ASimul PPos cl))
|
||||
(UttQS (UseQCl TPres ASimul PNeg cl)))
|
||||
(concatPoint np vp) ;
|
||||
|
||||
MQuestVP np vp =
|
||||
@@ -44,8 +44,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
||||
mkDem
|
||||
{s : Polarity => Str}
|
||||
(polCases
|
||||
(UttQS (PosQCl cl))
|
||||
(UttQS (NegQCl cl)))
|
||||
(UttQS (UseQCl TPres ASimul PPos cl))
|
||||
(UttQS (UseQCl TPres ASimul PNeg cl)))
|
||||
vp ;
|
||||
|
||||
MImpVP vp =
|
||||
@@ -80,9 +80,9 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
||||
that_MNP = mkDem NP that_NP ;
|
||||
|
||||
thisDet_MNP cn =
|
||||
mkDem NP (DetCN (MkDet NoPredet this_Quant NoNum NoOrd) cn) ;
|
||||
mkDem NP (DetCN (DetSg this_Quant NoOrd) cn) ;
|
||||
thatDet_MNP cn =
|
||||
mkDem NP (DetCN (MkDet NoPredet that_Quant NoNum NoOrd) cn) ;
|
||||
mkDem NP (DetCN (DetSg that_Quant NoOrd) cn) ;
|
||||
|
||||
here_MAdv = mkDem Adv here_Adv ;
|
||||
here7from_MAdv = mkDem Adv here7from_Adv ;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete DemonstrativeSwe of Demonstrative = CatSwe, TenseX ** DemonstrativeI with
|
||||
(Test = TestSwe),
|
||||
(Structural = StructuralSwe) ;
|
||||
(Lang = LangSwe) ;
|
||||
|
||||
|
||||
|
||||
19
lib/resource-1.0/multimodal/MultimodalFre.gf
Normal file
19
lib/resource-1.0/multimodal/MultimodalFre.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
--# -path=.:../french/:../romancs:../abstract:../common:prelude
|
||||
|
||||
concrete MultimodalFre of Multimodal =
|
||||
NounFre,
|
||||
-- Verb,
|
||||
AdjectiveFre,
|
||||
AdverbFre,
|
||||
-- NumeralFre,
|
||||
-- Sentence,
|
||||
-- Question,
|
||||
-- Relative,
|
||||
-- Conjunction,
|
||||
-- Phrase,
|
||||
-- Tensed,
|
||||
StructuralFre,
|
||||
DemonstrativeFre,
|
||||
BasicFre
|
||||
** {} ;
|
||||
|
||||
18
lib/resource-1.0/multimodal/MultimodalGer.gf
Normal file
18
lib/resource-1.0/multimodal/MultimodalGer.gf
Normal file
@@ -0,0 +1,18 @@
|
||||
--# -path=.:../german/:../abstract:../common:prelude
|
||||
|
||||
concrete MultimodalGer of Multimodal =
|
||||
NounGer,
|
||||
-- Verb,
|
||||
AdjectiveGer,
|
||||
AdverbGer,
|
||||
NumeralGer,
|
||||
-- Sentence,
|
||||
-- Question,
|
||||
-- Relative,
|
||||
-- Conjunction,
|
||||
-- Phrase,
|
||||
-- Tensed,
|
||||
StructuralGer,
|
||||
DemonstrativeGer,
|
||||
BasicGer
|
||||
** {} ;
|
||||
@@ -1,9 +1,11 @@
|
||||
incomplete concrete MathRomance of Math =
|
||||
CatRomance ** open Prelude, ResRomance, DiffRomance in {
|
||||
CatRomance ** open Prelude, CommonRomance, ResRomance in {
|
||||
|
||||
lin
|
||||
SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c
|
||||
IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c
|
||||
SymbPN i = {s = i.s ; g = Masc} ;
|
||||
IntPN i = {s = i.s ; g = Masc} ;
|
||||
|
||||
{-
|
||||
CNIntNP cn i = {
|
||||
s = \\c => (cn.s ! Sg ! DIndef ! Nom ++ i.s) ;
|
||||
a = agrP3 cn.g Sg
|
||||
@@ -12,6 +14,7 @@ lin
|
||||
s = \\c => det.s ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ;
|
||||
a = agrP3 g det.n
|
||||
} ;
|
||||
-}
|
||||
|
||||
lincat
|
||||
|
||||
@@ -21,7 +24,7 @@ lin
|
||||
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS conjAnd ;
|
||||
BaseSymb = infixSS "et" ; ----
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,11 +14,7 @@ incomplete concrete NounRomance of Noun =
|
||||
c = Clit0
|
||||
} ;
|
||||
|
||||
UsePN pn = {
|
||||
s = \\c => prepCase (npform2case c) ++ pn.s ;
|
||||
a = agrP3 pn.g Sg ;
|
||||
c = Clit0
|
||||
} ;
|
||||
UsePN = pn2np ;
|
||||
|
||||
UsePron p = p ;
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
incomplete concrete PhraseRomance of Phrase =
|
||||
CatRomance, TenseX ** open DiffRomance, ResRomance, Prelude in {
|
||||
CatRomance, TenseX ** open CommonRomance, ResRomance, Prelude in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = {s = s.s ! Main} ;
|
||||
UttS s = {s = s.s ! Indic} ;
|
||||
UttQS qs = {s = qs.s ! QDir} ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! aagr Fem Sg} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! aagr Fem Pl} ;
|
||||
|
||||
UttIP ip = {s = ip.s ! nominative} ; --- Acc also
|
||||
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = {s = np.s ! accusative} ;
|
||||
UttVP vp = {s = infMark ++ infVP vp (agrP3 Utr Sg)} ;
|
||||
UttNP np = {s = np.s ! Ton Nom} ;
|
||||
---- UttVP vp = {s = infVP vp (agrP3 Utr Sg)} ;
|
||||
UttAdv adv = adv ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
PConjConj conj = conj ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = "," ++ np.s ! nominative} ;
|
||||
VocNP np = {s = "," ++ np.s ! Ton Nom} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
incomplete concrete QuestionRomance of Question =
|
||||
CatRomance ** open DiffRomance, ResRomance in {
|
||||
CatRomance ** open CommonRomance, ResRomance in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
@@ -9,23 +9,19 @@ incomplete concrete QuestionRomance of Question =
|
||||
s = \\t,a,p =>
|
||||
let cls = cl.s ! t ! a ! p
|
||||
in table {
|
||||
QDir => cls ! Inv ;
|
||||
QIndir => subjIf ++ cls ! Sub
|
||||
QDir => cls ! Indic ;
|
||||
QIndir => "si" ++ cls ! Indic ---- subjIf
|
||||
}
|
||||
} ;
|
||||
|
||||
QuestVP qp vp = {
|
||||
s = \\t,a,b,q =>
|
||||
let
|
||||
somo = case q of {
|
||||
QIndir => <"som",Sub> ;
|
||||
_ => <[], Main>
|
||||
} ;
|
||||
cl = mkClause (qp.s ! nominative ++ somo.p1) {gn = qp.gn ; p = P3} vp
|
||||
s = \\t,a,b,_ =>
|
||||
let
|
||||
cl = mkClause (qp.s ! Nom) (agrP3 qp.a.g qp.a.n) vp
|
||||
in
|
||||
cl.s ! t ! a ! b ! somo.p2
|
||||
cl.s ! t ! a ! b ! Indic
|
||||
} ;
|
||||
|
||||
{-
|
||||
QuestSlash ip slash = {
|
||||
s = \\t,a,p =>
|
||||
let
|
||||
@@ -62,5 +58,5 @@ incomplete concrete QuestionRomance of Question =
|
||||
idet.s ! g ++ num.s ! g ++ ord.s ++ cn.s ! idet.n ! idet.det ! caseNP c ;
|
||||
gn = gennum g idet.n
|
||||
} ;
|
||||
|
||||
-}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ oper
|
||||
complGen : Compl = {s = [] ; c = genitive ; isDir = False} ;
|
||||
complDat : Compl = {s = [] ; c = dative ; isDir = True} ;
|
||||
|
||||
pn2np : {s : Str ; g : Gender} -> Pronoun = \pn -> {
|
||||
s = \\c => prepCase (npform2case c) ++ pn.s ;
|
||||
a = agrP3 pn.g Sg ;
|
||||
c = Clit0
|
||||
} ;
|
||||
|
||||
npform2case : NPForm -> Case = \p -> case p of {
|
||||
Ton x => x ;
|
||||
Aton x => x ;
|
||||
|
||||
@@ -5,18 +5,18 @@ incomplete concrete SentenceRomance of Sentence =
|
||||
|
||||
lin
|
||||
PredVP np vp = mkClause (np.s ! Aton Nom) np.a vp ;
|
||||
{-
|
||||
PredSCVP sc vp = mkClause sc.s (agrP3 neutrum Sg) vp ;
|
||||
|
||||
-- PredSCVP sc vp = mkClause sc.s (agrP3 neutrum Sg) vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\pol,n =>
|
||||
s = \\pol,aag =>
|
||||
let
|
||||
agr = {gn = gennum utrum n ; p = P2} ;
|
||||
verb = vp.s ! VPImperat ;
|
||||
agr = aag ** {p = P2} ;
|
||||
verb = (vp.s ! VPImperat).fin ! agr
|
||||
in
|
||||
verb.fin ++ vp.a1 ! pol ++ verb.inf ++ vp.n2 ! agr ++ vp.a2 ++ vp.ext
|
||||
verb ++ vp.comp ! agr ++ vp.ext --- neg,clit
|
||||
} ;
|
||||
|
||||
{-
|
||||
SlashV2 np v2 =
|
||||
mkClause
|
||||
(np.s ! nominative) np.a
|
||||
|
||||
@@ -6,6 +6,6 @@ incomplete concrete TensedRomance of Tensed = CatRomance, TenseX **
|
||||
lin
|
||||
UseCl t a p cl = {s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o} ;
|
||||
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ;
|
||||
UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ;
|
||||
-- UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ lin
|
||||
a = agrP3 cn.g Sg
|
||||
} ;
|
||||
CNSymbNP det cn xs = let g = cn.g in {
|
||||
s = \\c => det.s ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ;
|
||||
s = \\c => det.s ! cn.isMod ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ;
|
||||
a = agrP3 g det.n
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
concrete MathSwe of Math = CatSwe ** MathScand with
|
||||
(DiffScand = DiffSwe) ;
|
||||
(ResScand = ResSwe) ;
|
||||
|
||||
Reference in New Issue
Block a user