mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
fixed many things in ParseChi
This commit is contained in:
@@ -2216,7 +2216,7 @@ back_V = mkV "支持" ;
|
||||
attractive_A = mkA "优美" ;
|
||||
withdrawal_N = mkN "撤离" ;
|
||||
while_N = mkN "时间" ;
|
||||
top_N = mkN "while" ;
|
||||
---- top_N = mkN "while" ;
|
||||
syndicate_N = mkN "辛迪加" ;
|
||||
speed_N = mkN "速度" ;
|
||||
sophisticated_A = mkA "尖端" ;
|
||||
@@ -2362,7 +2362,7 @@ ohio_PN = mkPN "俄亥俄" ;
|
||||
mining_N = mkN "采矿" ;
|
||||
low_N = mkN "低" ;
|
||||
legislator_N = mkN "立委" ;
|
||||
houston_PN = mkPN "Xiūsīdùn" ;
|
||||
---- houston_PN = mkPN "Xiūsīdùn" ;
|
||||
hard_Adv = mkAdv "硬" ;
|
||||
grant_N = mkN "授与" ;
|
||||
forest_N = mkN "森林" ;
|
||||
@@ -2486,7 +2486,7 @@ will_N = mkN "意志" ;
|
||||
use_VV = mkVV "使用" ;
|
||||
unfortunate_A = mkA "不幸" ;
|
||||
turnover_N = mkN "营业额" ;
|
||||
theme_N = mkN "Zhǔtí" ;
|
||||
---- theme_N = mkN "Zhǔtí" ;
|
||||
switch_V = mkV "交换" ;
|
||||
strategist_N = mkN "战略家" ;
|
||||
shortage_N = mkN "短缺" ;
|
||||
@@ -5016,7 +5016,7 @@ frenzy_N = mkN "狂妄" ;
|
||||
free_of_A2 = mkA2 "免费" ;
|
||||
frame_N = mkN "框架" ;
|
||||
fortunate_A = mkA "幸运" ;
|
||||
forth_Adv = mkAdv "forth" ;
|
||||
---- forth_Adv = mkAdv "forth" ;
|
||||
forbid_V2 = mkV2 "禁止" ;
|
||||
flood_V2 = mkV2 "淹没" ;
|
||||
fitness_N = mkN "健身" ;
|
||||
|
||||
@@ -1,10 +1,32 @@
|
||||
concrete ExtraChi of ExtraChiAbs = CatChi **
|
||||
open ResChi, Prelude in {
|
||||
open ResChi, Coordination, Prelude in {
|
||||
|
||||
lincat
|
||||
Aspect = {s : Str ; a : ResChi.Aspect} ;
|
||||
VPS = {s : Str} ;
|
||||
[VPS] = {s1,s2 : Str} ;
|
||||
VPI = {s : Str} ; --- ???
|
||||
[VPI] = {s1,s2 : Str} ; --- ???
|
||||
[CN] = {s : Str ; c : Str} ;
|
||||
|
||||
lin
|
||||
PassVPSlash vps = insertAdv (mkNP passive_s) vps ;
|
||||
|
||||
MkVPS t p vp = {s = t.s ++ p.s ++ (mkClause [] vp).s ! p.p ! t.t} ;
|
||||
ConjVPS c = conjunctDistrSS (c.s ! CSent) ;
|
||||
BaseVPS = twoSS ;
|
||||
ConsVPS = consrSS duncomma ;
|
||||
|
||||
MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS
|
||||
ConjVPI c = conjunctDistrSS (c.s ! CSent) ;
|
||||
BaseVPI = twoSS ;
|
||||
ConsVPI = consrSS duncomma ;
|
||||
|
||||
ConjCN c = conjunctDistrSS (c.s ! CPhr CNPhrase) ** {c = ge_s} ; --- classifier always ge
|
||||
BaseCN = twoSS ;
|
||||
ConsCN = consrSS duncomma ;
|
||||
|
||||
GenRP nu cn = {s = cn.s ++ relative_s} ; ---- ??
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
abstract ExtraChiAbs = Cat, Extra [VPSlash, PassVPSlash] ** {
|
||||
abstract ExtraChiAbs = Cat,
|
||||
|
||||
Extra [NP, Quant, VPSlash, VP, Tense, Aspect, GenNP, PassVPSlash,
|
||||
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,
|
||||
ClSlash, RCl, EmptyRelSlash, ListCN, ConjCN, BaseCN, ConsCN]
|
||||
|
||||
** {
|
||||
cat
|
||||
Aspect ;
|
||||
} ;
|
||||
|
||||
@@ -17,7 +17,7 @@ concrete ParseChi of ParseEngAbs =
|
||||
ExtraChi [NP, Quant, VPSlash, VP, Tense, Aspect, GenNP, PassVPSlash,
|
||||
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,
|
||||
ClSlash, RCl, EmptyRelSlash],
|
||||
ClSlash, RCl, EmptyRelSlash, ListCN, ConjCN, BaseCN, ConsCN],
|
||||
|
||||
DictEngChi **
|
||||
open ResChi, ParadigmsChi, SyntaxChi, Prelude in {
|
||||
|
||||
@@ -65,6 +65,8 @@ resource ResChi = ParamX ** open Prelude in {
|
||||
bword : Str -> Str -> Str = \x,y -> x ++ y ; -- change to x + y to treat words as single tokens
|
||||
|
||||
word : Str -> Str = \s -> case s of {
|
||||
x@? + y@? + z@? + u@? + v@? + w@? => bword x (bword y (bword z (bword u (bword v w)))) ;
|
||||
x@? + y@? + z@? + u@? + v@? => bword x (bword y (bword z (bword u v))) ;
|
||||
x@? + y@? + z@? + u@? => bword x (bword y (bword z u)) ;
|
||||
x@? + y@? + z@? => bword x (bword y z) ;
|
||||
x@? + y@? => bword x y ;
|
||||
|
||||
@@ -34,13 +34,16 @@ concrete SentenceChi of Sentence = CatChi **
|
||||
EmbedQS qs = qs ;
|
||||
EmbedVP vp = ss (infVP vp) ;
|
||||
|
||||
UseCl t p cl = {s = cl.s ! p.p ! t.t} ;
|
||||
UseQCl t p cl = {s = cl.s ! p.p ! t.t} ;
|
||||
UseRCl t p cl = {s = cl.s ! p.p ! t.t} ;
|
||||
UseSlash t p cl = {s = cl.s ! p.p ! t.t ; c2 = cl.c2} ;
|
||||
UseCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||
UseRCl t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t} ;
|
||||
UseSlash t p cl = {s = t.s ++ p.s ++ cl.s ! p.p ! t.t ; c2 = cl.c2} ;
|
||||
|
||||
AdvS a s = ss (a.s ++ s.s) ;
|
||||
ExtAdvS a s = ss (a.s ++ chcomma ++ s.s) ;
|
||||
|
||||
RelS s r = ss (s.s ++ r.s) ;
|
||||
|
||||
SSubjS a subj b = ss (a.s ++ subj.prePart ++ b.s ++ subj.sufPart) ;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in {
|
||||
|
||||
ComplVV v vp = {
|
||||
verb = v ;
|
||||
compl = vp.verb.s ++ vp.compl ;
|
||||
prePart = vp.prePart
|
||||
compl = vp.prePart ++ vp.verb.s ++ vp.compl ;
|
||||
prePart = []
|
||||
} ;
|
||||
|
||||
ComplVS v s = insertObj s (predV v []) ;
|
||||
|
||||
Reference in New Issue
Block a user