1
0
forked from GitHub/gf-core

added stubs for Jpn modules needed in TranslateJpn

This commit is contained in:
aarne
2015-01-14 16:55:58 +00:00
parent fbed7c19d5
commit 3afa54c465
3 changed files with 247 additions and 0 deletions

59
lib/src/chunk/ChunkJpn.gf Normal file
View File

@@ -0,0 +1,59 @@
concrete ChunkJpn of Chunk = {} ;
{-
---- TODO: everything. Since CatJpn.Utt is not {s : Str}, nothing works in the functor
CatJpn, ExtensionsJpn [VPS,VPI] **
ChunkFunctor
with (Syntax = SyntaxJpn), (Extensions = ExtensionsJpn) **
open
SyntaxJpn, (E = ExtensionsJpn), Prelude,
ResJpn, (P = ParadigmsJpn) in {
oper
emptyNP : NP = mkNP [] ;
-- exceptions to functor
lin
Conj_Chunk conj = ss (conj.s ! CSent).s2 ;
Numeral_Nom_Chunk num = ss (num.s ++ ge_s) ;
CN_Pl_Chunk cn = cn ;
Subj_Chunk subj = ss (subj.prePart ++ subj.sufPart) ;
Prep_Chunk prep = ss (prep.prepPre ++ prep.prepPost) ;
Predet_Chunk predet = predet ;
lin
NP_Acc_Chunk np = np ;
NP_Gen_Chunk np = ss (np.s ++ de_s) ;
VPI_Chunk vpi = vpi ;
copula_inf_Chunk = ss copula_s ;
refl_SgP1_Chunk = ss reflPron ;
refl_SgP2_Chunk = ss reflPron ;
refl_SgP3_Chunk = ss reflPron ;
refl_PlP1_Chunk = ss reflPron ;
refl_PlP2_Chunk = ss reflPron ;
refl_PlP3_Chunk = ss reflPron ;
neg_Chunk = ss neg_s ;
copula_Chunk = ss copula_s ;
copula_neg_Chunk = ss (neg_s ++ copula_s) ;
past_copula_Chunk = ss "了" ;
past_copula_neg_Chunk = ss (neg_s ++ copula_s ++ "了") ;
future_Chunk = ss copula_s ; ----
future_neg_Chunk = ss (neg_s ++ copula_s) ;
cond_Chunk = ss copula_s ; ----
cond_neg_Chunk = ss (neg_s ++ copula_s) ;
perfect_Chunk = ss "了" ;
perfect_neg_Chunk = ss (neg_s ++ copula_s ++ "了") ;
past_perfect_Chunk = ss "了" ;
past_perfect_neg_Chunk = ss (neg_s ++ copula_s ++ "了") ;
}
-}

View File

@@ -0,0 +1,140 @@
--# -path=.:../abstract
concrete ExtensionsJpn of Extensions =
CatJpn ** open ResJpn, ParadigmsJpn, SyntaxJpn, (G = GrammarJpn), (E = ExtraJpn), Prelude in {
{-
---- TODO: everything. But consult TranslateJpn.gf to see what is not needed
lincat
VPI = E.VPI ;
VPS = E.VPS ;
ListVPI = E.ListVPI ;
ListVPS = E.ListVPS ;
lin
MkVPI = E.MkVPI ;
ConjVPI = E.ConjVPI ;
---- ComplVPIVV = E.ComplVPIVV ;
MkVPS = E.MkVPS ;
ConjVPS = E.ConjVPS ;
PredVPS = E.PredVPS ;
BaseVPI = E.BaseVPI ;
ConsVPI = E.ConsVPI ;
BaseVPS = E.BaseVPS ;
ConsVPS = E.ConsVPS ;
GenNP = E.GenNP ;
---- GenIP = E.GenIP ;
GenRP = E.GenRP ;
PassVPSlash = E.PassVPSlash ;
PassAgentVPSlash = E.PassAgentVPSlash ;
---- EmptyRelSlash = E.EmptyRelSlash ;
lin
that_RP = which_RP ;
-- lexical entries
-- another_Quant = mkQuantifier "otro" "otra" "otros" "otras" ;
-- some_Quant = mkQuantifier "algún" "alguna" "algunos" "algunas" ;
-- anySg_Det = mkDeterminer "algún" "alguna" Sg False ; ---- also meaning "whichever" ?
-- each_Det = SyntaxJpn.every_Det ;
-- but_Subj = {s = "pero" ; m = Indic} ; ---- strange to have this as Subj
CompoundN noun cn = {s = noun.s ++ cn.s ; c = cn.c} ; ----
CompoundAP noun adj = complexAP (noun.s ++ possessive_s ++ adj.s) ; ----
GerundN v = {
s = v.s ;
c = ge_s ---- ge
} ;
GerundNP vp = {
s = infVP vp ; ---- ?
} ;
GerundAdv vp = {
s = infVP vp ++ "地" ; ---- ?
advType = ATManner ;
} ;
PastPartAP v = {
s = v.verb.s ++ de_s ; ----
monoSyl = False ;
hasAdA = True ; ---
} ;
---- PastPartAP v = v ; ----
OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ;
PositAdVAdj a = {s = a.s} ;
UseQuantPN q pn = {s = q.s ++ ge_s ++ pn.s} ; ---- ge
SlashV2V v a p vp =
insertObj (ResJpn.mkNP (a.s ++ p.s ++ useVerb vp.verb ! p.p ! APlain ++ vp.compl))
(predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; ---- aspect
SlashVPIV2V v p vpi = insertObjc (\\a => p.s ++
v.c3 ++
vpi.s ! VVAux ! a)
(predVc v) ;
---- TODO: find proper expressions for OSV and OVS in Jpn
PredVPosv np vp = G.PredVP np vp ; ---- (lin NP np) (lin VP vp) ; ----
PredVPovs np vp = G.PredVP np vp ; ---- (lin NP np) (lin VP vp) ; ----
CompS s = insertObj s (predV copula []) ; ----
CompQS qs = insertObj (ss (qs.s ! False)) (predV copula []) ; ----
CompVP ant p vp = insertObj (ss (infVP vp)) (predV copula []) ; ----
VPSlashVS vs vp =
insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs []) **
{c2 = ""; gapInMiddle = False} ;
PastPartRS ant pol vp = { ---- copied from PresPartRS
s = ant.s ++ pol.s ++ vp.prePart ++ useVerb vp.verb ! pol.p ! APlain ++ vp.compl ++ which_RP.s ---- aspect
} ; ---- ??
PresPartRS ant pol vp = { ---- copied from RelVP
s = ant.s ++ pol.s ++ vp.prePart ++ useVerb vp.verb ! pol.p ! APlain ++ vp.compl ++ which_RP.s ---- aspect
} ; ---- ??
ComplVV v a p vp = {
verb = v ;
compl = a.s ++ p.s ++ vp.topic ++ vp.prePart ++ useVerb vp.verb ! p.p ! APlain ++ vp.compl ; ---- aspect
prePart, topic = []
} ;
ApposNP np1 np2 = {
s = np1.s ++ chcomma ++ np2.s
} ;
AdAdV = cc2 ;
UttAdV adv = adv;
-}
}

View File

@@ -0,0 +1,48 @@
--# -path=.:../chunk:alltenses
concrete TranslateJpn of Translate =
TenseJpn,
NounJpn - [PPartNP],
AdjectiveJpn,
NumeralJpn,
SymbolJpn [
PN, Symb, String, CN, Card, NP, MkSymb, SymbPN, CNNumNP
],
ConjunctionJpn,
VerbJpn - [
UseCopula, -- just removed
PassV2 -- generalized
],
AdverbJpn,
PhraseJpn,
SentenceJpn,
QuestionJpn,
RelativeJpn,
IdiomJpn,
---- ConstructionJpn, ---- TODO
---- DocumentationJpn, ---- TODO
ChunkJpn,
ExtensionsJpn [
CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP
, DirectComplVS, DirectComplVQ, FocusObjS
, PastPartAP, PastPartAgentAP, PresPartAP, GerundNP, GerundAdv
, WithoutVP, InOrderToVP, ByVP
],
DictionaryJpn **
open ResJpn, ParadigmsJpn, SyntaxJpn, Prelude, (G = GrammarJpn), (E = ExtraJpn) in {
flags
literal = Symb ;
coding = utf8 ;
---- TODO: everything
-- Japanese-specific overrides (if any) here
}