forked from GitHub/gf-core
implemented the top-17 missing functions in ParseChi; shaky definitions though
This commit is contained in:
@@ -23,5 +23,7 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in {
|
|||||||
AdAP ada ap = complexAP (ada.s ++ ap.s) ;
|
AdAP ada ap = complexAP (ada.s ++ ap.s) ;
|
||||||
|
|
||||||
UseA2 a = a ;
|
UseA2 a = a ;
|
||||||
|
|
||||||
|
AdvAP ap adv = complexAP (adv.s ++ ap.s) ; ----
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,6 @@ concrete AdverbChi of Adverb = CatChi **
|
|||||||
|
|
||||||
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner} ; -----
|
AdnCAdv cadv = ss (cadv.s ++ conjThat) ** {advType = ATManner} ; -----
|
||||||
|
|
||||||
|
PositAdAAdj a = {s = a.s} ; ----
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,7 @@ concrete ExtraChi of ExtraChiAbs = CatChi **
|
|||||||
lincat
|
lincat
|
||||||
Aspect = {s : Str ; a : ResChi.Aspect} ;
|
Aspect = {s : Str ; a : ResChi.Aspect} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
PassVPSlash vps = insertAdv (mkNP passive_s) vps ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
abstract ExtraChiAbs = Cat ** {
|
abstract ExtraChiAbs = Cat, Extra [VPSlash, PassVPSlash] ** {
|
||||||
cat
|
cat
|
||||||
Aspect ;
|
Aspect ;
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -86,4 +86,6 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
PossNP cn np = {s = np.s ++ possessive_s ++ cn.s ; c = cn.c} ;
|
PossNP cn np = {s = np.s ++ possessive_s ++ cn.s ; c = cn.c} ;
|
||||||
|
|
||||||
|
CountNP det np = {s = det.s ++ possessive_s ++ np.s} ; ---- classifier?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:../english:alltenses
|
--# -path=alltenses:.:../english
|
||||||
concrete ParseChi of ParseEngAbs =
|
concrete ParseChi of ParseEngAbs =
|
||||||
TenseChi,
|
TenseChi,
|
||||||
--- CatChi,
|
--- CatChi,
|
||||||
@@ -14,7 +14,7 @@ concrete ParseChi of ParseEngAbs =
|
|||||||
QuestionChi,
|
QuestionChi,
|
||||||
RelativeChi,
|
RelativeChi,
|
||||||
IdiomChi [NP, VP, Tense, Cl, ProgrVP, ExistNP],
|
IdiomChi [NP, VP, Tense, Cl, ProgrVP, ExistNP],
|
||||||
ExtraChi [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash,
|
ExtraChi [NP, Quant, VPSlash, VP, Tense, Aspect, GenNP, PassVPSlash,
|
||||||
Temp, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP,
|
Temp, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP,
|
||||||
VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||||
ClSlash, RCl, EmptyRelSlash],
|
ClSlash, RCl, EmptyRelSlash],
|
||||||
@@ -34,7 +34,7 @@ lin
|
|||||||
GenNP np =
|
GenNP np =
|
||||||
ParadigmsChi.mkQuant (np.s ++ possessive_s) ;
|
ParadigmsChi.mkQuant (np.s ++ possessive_s) ;
|
||||||
|
|
||||||
EmptyRelSlash slash = mkRCl which_RP (lin ClSlash slash) ;
|
EmptyRelSlash slash = mkRCl <which_RP : RP> <lin ClSlash slash : ClSlash> ;
|
||||||
|
|
||||||
that_RP = which_RP ;
|
that_RP = which_RP ;
|
||||||
|
|
||||||
@@ -69,17 +69,23 @@ DashCN noun cn = {s = noun.s ++ cn.s ; c = cn.c} ; ----
|
|||||||
s = \\n,c => noun1.s ! Sg ! Nom ++ "-" ++ noun2.s ! n ! c ;
|
s = \\n,c => noun1.s ! Sg ! Nom ++ "-" ++ noun2.s ! n ! c ;
|
||||||
g = noun2.g
|
g = noun2.g
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
|
|
||||||
GerundN v = {
|
GerundN v = {
|
||||||
s = \\n,c => v.s ! VPresPart ;
|
s = v.s ;
|
||||||
g = Neutr
|
c = ge_s ---- ge
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
GerundAP v = {
|
GerundAP v = {
|
||||||
s = \\agr => v.s ! VPresPart ;
|
s = v.s ++ de_s ; ----
|
||||||
isPre = True
|
monoSyl = False
|
||||||
} ;
|
} ;
|
||||||
-}
|
|
||||||
|
PastPartAP v = {
|
||||||
|
s = v.s ++ de_s ;
|
||||||
|
monoSyl = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
---- PastPartAP v = v ; ----
|
---- PastPartAP v = v ; ----
|
||||||
|
|
||||||
@@ -89,49 +95,53 @@ DashCN noun cn = {s = noun.s ++ cn.s ; c = cn.c} ; ----
|
|||||||
|
|
||||||
PositAdVAdj a = {s = a.s} ;
|
PositAdVAdj a = {s = a.s} ;
|
||||||
|
|
||||||
|
|
||||||
|
UseQuantPN q pn = {s = q.s ++ ge_s ++ pn.s} ; ---- ge
|
||||||
|
|
||||||
|
SlashV2V v a p vp =
|
||||||
|
insertObj (ResChi.mkNP (a.s ++ p.s ++ useVerb vp.verb ! p.p ! APlain ++ vp.compl))
|
||||||
|
(predV v) ** {c2 = v.c2 ; isPre = True} ; ---- aspect
|
||||||
|
|
||||||
{-
|
{-
|
||||||
UseQuantPN q pn = {s = \\c => q.s ! False ! Sg ++ pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ;
|
|
||||||
|
|
||||||
SlashV2V v ant p vp = insertObjc (\\a => v.c3 ++ ant.s ++ p.s ++
|
|
||||||
infVP v.typ vp ant.a p.p a)
|
|
||||||
(predVc v) ;
|
|
||||||
|
|
||||||
SlashVPIV2V v p vpi = insertObjc (\\a => p.s ++
|
SlashVPIV2V v p vpi = insertObjc (\\a => p.s ++
|
||||||
v.c3 ++
|
v.c3 ++
|
||||||
vpi.s ! VVAux ! a)
|
vpi.s ! VVAux ! a)
|
||||||
(predVc v) ;
|
(predVc v) ;
|
||||||
ComplVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
|
|
||||||
infVP v.typ vp a.a p.p agr)
|
|
||||||
(predVV v) ;
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
---- TODO: find proper expressions for OSV and OVS in Chi
|
---- TODO: find proper expressions for OSV and OVS in Chi
|
||||||
---- PredVPosv np vp = mkCl (lin NP np) (lin VP vp) ;
|
PredVPosv np vp = PredVP np vp ; ---- (lin NP np) (lin VP vp) ; ----
|
||||||
---- PredVPovs np vp = mkCl (lin NP np) (lin VP vp) ;
|
PredVPovs np vp = PredVP np vp ; ---- (lin NP np) (lin VP vp) ; ----
|
||||||
|
|
||||||
|
|
||||||
---- CompS s = s ; -----
|
CompS s = insertObj s (predV copula) ; ----
|
||||||
|
|
||||||
|
|
||||||
|
CompQS qs = insertObj qs (predV copula) ; ----
|
||||||
|
CompVP ant p vp = insertObj (ss (infVP vp)) (predV copula) ; ----
|
||||||
|
|
||||||
{-
|
{-
|
||||||
CompQS qs = {s = \\_ => qs.s ! QIndir} ;
|
|
||||||
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
|
|
||||||
infVP VVInf vp ant.a p.p a} ;
|
|
||||||
|
|
||||||
VPSlashVS vs vp =
|
VPSlashVS vs vp =
|
||||||
insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs) **
|
insertObj (\\a => infVP VVInf vp Simul CPos a) (predV vs) **
|
||||||
{c2 = ""; gapInMiddle = False} ;
|
{c2 = ""; gapInMiddle = False} ;
|
||||||
|
|
||||||
PastPartRS ant pol vps = {
|
|
||||||
s = \\agr => vps.ad ++ vps.ptp ++ vps.s2 ! agr ;
|
|
||||||
c = npNom
|
|
||||||
} ;
|
|
||||||
|
|
||||||
PresPartRS ant pol vp = {
|
|
||||||
s = \\agr => vp.ad ++ vp.prp ++ vp.s2 ! agr ;
|
|
||||||
c = npNom
|
|
||||||
} ;
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
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 ++ useVerb vp.verb ! p.p ! APlain ++ vp.compl ; ---- aspect
|
||||||
|
prePart = vp.prePart
|
||||||
|
} ;
|
||||||
|
|
||||||
ApposNP np1 np2 = {
|
ApposNP np1 np2 = {
|
||||||
s = np1.s ++ chcomma ++ np2.s
|
s = np1.s ++ chcomma ++ np2.s
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ resource ResChi = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
than_s = "比" ;
|
than_s = "比" ;
|
||||||
progressive_s = defaultStr ;
|
progressive_s = defaultStr ;
|
||||||
possessive_s = "的" ; -- also used for AP + NP
|
de_s, possessive_s = "的" ; -- also used for AP + NP
|
||||||
deAdvV_s = "地" ; -- between Adv and V
|
deAdvV_s = "地" ; -- between Adv and V
|
||||||
deVAdv_s = "得" ; -- between V and Adv
|
deVAdv_s = "得" ; -- between V and Adv
|
||||||
imperneg_s = neg_s ;
|
imperneg_s = neg_s ;
|
||||||
|
|||||||
@@ -62,5 +62,13 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
|||||||
|
|
||||||
VPSlashPrep vp prep = vp ** {c2 = prep ; isPre = True} ;
|
VPSlashPrep vp prep = vp ** {c2 = prep ; isPre = True} ;
|
||||||
|
|
||||||
|
AdvVPSlash vp adv = case adv.advType of {
|
||||||
|
ATManner => insertObj (ss (deVAdv_s ++ adv.s)) vp ; -- he sleeps well
|
||||||
|
_ => insertAdv (ss (zai_V.s ++ adv.s)) vp -- he sleeps in the house / today
|
||||||
|
} ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
||||||
|
|
||||||
|
AdVVPSlash adv vp = insertAdv adv vp ** {c2 = vp.c2 ; isPre = vp.isPre} ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module Main where
|
|||||||
|
|
||||||
import Numeric
|
import Numeric
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import System
|
import System.Environment
|
||||||
|
|
||||||
-- AR 3/10/2012
|
-- AR 3/10/2012
|
||||||
-- Chinese unicode - character - pinyin conversions
|
-- Chinese unicode - character - pinyin conversions
|
||||||
|
|||||||
Reference in New Issue
Block a user