forked from GitHub/gf-core
determiners and extrapositions in Tha fixed
This commit is contained in:
@@ -32,7 +32,7 @@ concrete CatTha of Cat = CommonX ** open ResTha, Prelude in {
|
||||
-- Verb
|
||||
|
||||
VP = ResTha.VP ;
|
||||
Comp = ResTha.VP ;
|
||||
Comp = {s : Polarity => Str} ;
|
||||
VPSlash = ResTha.VP ** {c2 : Str} ;
|
||||
|
||||
-- Adjective
|
||||
@@ -43,9 +43,9 @@ concrete CatTha of Cat = CommonX ** open ResTha, Prelude in {
|
||||
|
||||
CN = ResTha.Noun ;
|
||||
NP, Pron = ResTha.NP ;
|
||||
Det = ResTha.Determiner ;
|
||||
Det, Quant = ResTha.Determiner ;
|
||||
Predet, Ord = {s : Str} ;
|
||||
Num, Quant = {s : Str ; hasC : Bool} ;
|
||||
Num = {s : Str ; hasC : Bool} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ concrete IdiomTha of Idiom = CatTha ** open Prelude, ResTha in {
|
||||
|
||||
ProgrVP vp = {
|
||||
s = \\p => thbind kam_s lag2_s (vp.s ! p) ;
|
||||
e = vp.e
|
||||
} ;
|
||||
|
||||
ImpPl1 vp = ss (infVP vp) ; ----
|
||||
|
||||
@@ -60,7 +60,7 @@ lin
|
||||
-- ceiling_N = regN "ceiling" ;
|
||||
-- chair_N = regN "chair" ;
|
||||
cheese_N = mkN (thword "เนย" "แข็ง") "ก้อน" ;
|
||||
child_N = personN (thword "เด็ก") ;
|
||||
child_N = personN (thword "ลูก") ; --- personN (thword "เด็ก") ;
|
||||
-- church_N = regN "church" ;
|
||||
city_N = mkN "นคร" "แห่ง" ;
|
||||
-- clean_A = regADeg "clean" ;
|
||||
@@ -191,7 +191,7 @@ lin
|
||||
long_A = mkA (thword "ยาว") ;
|
||||
-- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
|
||||
louse_N = animalN (thword "เล็น") ;
|
||||
-- love_N = regN "love" ;
|
||||
love_N = mkN (thword "ความ" rak_s) ;
|
||||
love_V2 = mkV2 rak_s ;
|
||||
man_N = personN (thword "ชาย") ;
|
||||
married_A2 = mkA2 (mkA (thword "แต่ง" "งาน" "แล้ว")) "กับ" ;
|
||||
@@ -316,7 +316,7 @@ lin
|
||||
-- table_N = regN "table" ;
|
||||
tail_N = mkN (thword "หาง") ;
|
||||
-- talk_V3 = mkV3 (regV "talk") toP aboutP ;
|
||||
-- teach_V2 = dirV2 (irregV "teach" "taught" "taught") ;
|
||||
teach_V2 = mkV2 "สอน" ;
|
||||
-- teacher_N = regN "teacher" ;
|
||||
-- television_N = regN "television" ;
|
||||
thick_A = mkA (thword "หนา") ;
|
||||
|
||||
@@ -18,18 +18,19 @@ concrete NounTha of Noun = CatTha ** open StringsTha, ResTha, Prelude in {
|
||||
AdvNP np adv = thbind np adv ;
|
||||
|
||||
DetQuant quant num = {
|
||||
s1 = num.s ;
|
||||
s2 = quant.s ;
|
||||
s1 = num.s ++ quant.s1 ; --- can there be quant.s1 ??
|
||||
s2 = quant.s2 ;
|
||||
hasC = orB num.hasC quant.hasC ;
|
||||
} ;
|
||||
DetQuantOrd quant num ord = {
|
||||
s1 = num.s ;
|
||||
s2 = quant.s ++ ord.s ;
|
||||
hasC = orB num.hasC quant.hasC ;
|
||||
s1 = num.s ++ quant.s1 ; --- can there be quant.s1 ??
|
||||
s2 = ord.s ++ quant.s2 ;
|
||||
hasC = True ;
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
s = khoog_s ++ p.s ;
|
||||
s1 = khoog_s ++ p.s ;
|
||||
s2 = [] ;
|
||||
hasC = False
|
||||
} ;
|
||||
|
||||
@@ -46,8 +47,8 @@ concrete NounTha of Noun = CatTha ** open StringsTha, ResTha, Prelude in {
|
||||
|
||||
OrdSuperl a = {s = thbind a.s thii_s sut_s} ;
|
||||
|
||||
DefArt = {s = [] ; hasC = False} ;
|
||||
IndefArt = {s = [] ; hasC = False} ;
|
||||
DefArt = {s1,s2 = [] ; hasC = False} ;
|
||||
IndefArt = {s1,s2 = [] ; hasC = False} ;
|
||||
|
||||
MassNP cn = cn ;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ concrete QuestionTha of Question = CatTha **
|
||||
|
||||
---- order of IP and VP to be revisited: Smyth p. 160
|
||||
|
||||
QuestVP qp vp = {s = (mkClause qp vp).s ! ClQuest} ;
|
||||
QuestVP qp vp = {s = (mkClause qp vp).s ! ClDecl} ;
|
||||
|
||||
QuestSlash ip slash = {s = \\p => thbind (slash.s ! p) slash.c2 ip.s} ;
|
||||
|
||||
@@ -30,7 +30,7 @@ concrete QuestionTha of Question = CatTha **
|
||||
IdetIP idet = mkNP (thbind idet.s1 idet.s2) ;
|
||||
|
||||
IdetQuant iquant num = {
|
||||
s1 = iquant.s1 ++ num.s ;
|
||||
s1 = num.s ++ iquant.s1 ; --- is num even possible ??
|
||||
s2 = iquant.s2 ;
|
||||
hasC = iquant.hasC
|
||||
} ;
|
||||
|
||||
@@ -52,9 +52,15 @@ resource ResTha = ParamX, StringsTha ** open Prelude in {
|
||||
|
||||
Determiner = {s1, s2 : Str ; hasC : Bool} ;
|
||||
|
||||
mkDet : Str -> Str -> Determiner =
|
||||
mkDet : Str -> Str -> Determiner = -- before and after classifier
|
||||
\s,c -> {s1 = s ; s2 = c ; hasC = True} ;
|
||||
|
||||
quantDet : Str -> Determiner = -- quantifier: before classifier
|
||||
\s -> mkDet s [] ;
|
||||
|
||||
demDet : Str -> Determiner = -- demonstrative: after classifier
|
||||
\s -> mkDet [] s ;
|
||||
|
||||
-- Part before and after negation (mai_s)
|
||||
|
||||
Verb = {s1,s2 : Str ; isCompl : Bool} ;
|
||||
@@ -80,27 +86,37 @@ resource ResTha = ParamX, StringsTha ** open Prelude in {
|
||||
-- Verb phrases: form negation and question, too.
|
||||
|
||||
VP = {
|
||||
s : Polarity => Str
|
||||
s : Polarity => Str ;
|
||||
e : Str -- extraposed clause
|
||||
} ;
|
||||
|
||||
infVP : VP -> Str = \vp -> vp.s ! Pos ; ----
|
||||
infVP : VP -> Str = \vp -> thbind (vp.s ! Pos) vp.e ; ----
|
||||
|
||||
predV : Verb -> VP = \v -> {
|
||||
s = \\p => if_then_Str v.isCompl
|
||||
(thbind v.s1 (polStr may_s p ++ v.s2))
|
||||
(v.s1 ++ (polStr may_s p ++ v.s2)) --- v.s1 = []
|
||||
(v.s1 ++ (polStr may_s p ++ v.s2)) ; --- v.s1 = [] ;
|
||||
e = []
|
||||
} ;
|
||||
|
||||
insertObj : NP -> VP -> VP = \o,vp -> {
|
||||
s = \\p => thbind (vp.s ! p) o.s
|
||||
s = \\p => thbind (vp.s ! p) o.s ;
|
||||
e = vp.e
|
||||
} ;
|
||||
|
||||
insertExtra : Str -> VP -> VP = \o,vp -> {
|
||||
s = vp.s ;
|
||||
e = vp.e ++ o
|
||||
} ;
|
||||
|
||||
adjVP : Adj -> VP = \a -> {
|
||||
s = \\p => polStr may_s p ++ a.s
|
||||
s = \\p => thbind (polStr may_s p) a.s ;
|
||||
e = []
|
||||
} ;
|
||||
|
||||
insertObject : Str -> VP -> VP = \np,vp -> {
|
||||
s = \\p => thbind (vp.s ! p) np
|
||||
s = \\p => thbind (vp.s ! p) np ;
|
||||
e = vp.e
|
||||
} ;
|
||||
|
||||
polStr : Str -> Polarity -> Str = \m,p -> case p of {
|
||||
@@ -125,8 +141,8 @@ oper
|
||||
|
||||
mkClause : NP -> VP -> Clause = \np,vp -> {
|
||||
s = table {
|
||||
ClDecl => \\p => thbind np.s (vp.s ! p) ;
|
||||
ClQuest => \\p => thbind np.s (vp.s ! p) (polStr chay_s p) m'ay_s
|
||||
ClDecl => \\p => thbind np.s (vp.s ! p) vp.e ;
|
||||
ClQuest => \\p => thbind np.s (vp.s ! p) (polStr chay_s p) vp.e m'ay_s --- the place of vp.e?
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ concrete StructuralTha of Structural = CatTha **
|
||||
-- during_Prep = ss "during" ;
|
||||
-- either7or_DConj = sd2 "either" "or" ** {n = Sg} ;
|
||||
-- everybody_NP = regNP "everybody" Sg ;
|
||||
-- every_Det = mkDeterminer Sg "every" ;
|
||||
every_Det = quantDet "ทุก" ;
|
||||
-- everything_NP = regNP "everything" Sg ;
|
||||
-- everywhere_Adv = ss "everywhere" ;
|
||||
few_Det = mkDet (thword "สอง" "สาม") [] ;
|
||||
few_Det = quantDet (thword "สอง" "สาม") ;
|
||||
-- first_Ord = ss "first" ;
|
||||
-- for_Prep = ss "for" ;
|
||||
from_Prep = ss "จาก" ;
|
||||
@@ -37,21 +37,21 @@ concrete StructuralTha of Structural = CatTha **
|
||||
-- here7to_Adv = ss ["to here"] ;
|
||||
-- here7from_Adv = ss ["from here"] ;
|
||||
how_IAdv = ss (thword "อย่าง" "ไร") ;
|
||||
-- how8many_IDet = mkDeterminer Pl ["how many"] ;
|
||||
how8many_IDet = quantDet "กี่" ;
|
||||
how8much_IAdv = ss (thword "เท่า" "ไร") ;
|
||||
-- in8front_Prep = ss ["in front of"] ;
|
||||
i_Pron = ss chan_s ;
|
||||
if_Subj = ss (thword "ถ้า") ;
|
||||
in_Prep = ss (thword "ใน") ;
|
||||
it_Pron = ss "มัน" ;
|
||||
-- less_CAdv = ss "less" ;
|
||||
many_Det = mkDet "หลาย" [] ;
|
||||
many_Det = quantDet "หลาย" ;
|
||||
more_CAdv = {s = thword "มาก" "กว่า" ; p = []} ; ----
|
||||
-- most_Predet = ss "most" ;
|
||||
-- much_Det = mkDeterminer Sg "much" ;
|
||||
must_VV = {s = tog_s ; typ = VVPre} ;
|
||||
no_Utt = ss may_s ;
|
||||
on_Prep = ss "บน" ;
|
||||
-- one_Quant = mkDeterminer Sg "one" ;
|
||||
only_Predet = ss (thword "เฑา" "นั้น") ;
|
||||
or_Conj = {s1 = [] ; s2 = "หริอ"} ;
|
||||
-- otherwise_PConj = ss "otherwise" ;
|
||||
@@ -62,19 +62,18 @@ concrete StructuralTha of Structural = CatTha **
|
||||
she_Pron = ss khaw_s ;
|
||||
-- so_AdA = ss "so" ;
|
||||
-- somebody_NP = regNP "somebody" Sg ;
|
||||
somePl_Det = mkDet ("บ้าง") [] ;
|
||||
someSg_Det = mkDet ("บ้าง") [] ;
|
||||
somePl_Det = quantDet ("บ้าง") ;
|
||||
someSg_Det = quantDet ("บ้าง") ;
|
||||
-- something_NP = regNP "something" Sg ;
|
||||
-- somewhere_Adv = ss "somewhere" ;
|
||||
that_Quant = ss nan_s ** {hasC = True} ;
|
||||
-- that_NP = regNP "that" Sg ;
|
||||
that_Quant = demDet nan_s ;
|
||||
there_Adv = ss (thword "ที่" "นั่น") ;
|
||||
-- there7to_Adv = ss "there" ;
|
||||
-- there7from_Adv = ss ["from there"] ;
|
||||
-- therefore_PConj = ss "therefore" ;
|
||||
-- these_NP = regNP "these" Pl ;
|
||||
they_Pron = mkNP khaw_s ;
|
||||
this_Quant = ss nii_s ** {hasC = True} ;
|
||||
this_Quant = demDet nii_s ;
|
||||
-- this_NP = regNP "this" Sg ;
|
||||
-- those_NP = regNP "those" Pl ;
|
||||
-- through_Prep = ss "through" ;
|
||||
@@ -88,7 +87,7 @@ concrete StructuralTha of Structural = CatTha **
|
||||
when_IAdv = ss (thword "เมื่อไร") ;
|
||||
when_Subj = ss "ฑี" ;
|
||||
where_IAdv = ss (thword "ฑี" "ไหน") ;
|
||||
which_IQuant = {s1 = "ไหน" ; s2 = [] ; hasC = True} ;
|
||||
which_IQuant = demDet "ไหน" ;
|
||||
whoPl_IP, whoSg_IP = ss "ไคร" ;
|
||||
why_IAdv = ss (thword "ฑำ" "ไม") ;
|
||||
without_Prep = ss (thword "ไ่ม" "มี") ;
|
||||
|
||||
@@ -11,14 +11,14 @@ concrete VerbTha of Verb = CatTha ** open ResTha, StringsTha, Prelude in {
|
||||
Slash3V3 v np = insertObj np (predV v) ** {c2 = v.c2} ;
|
||||
|
||||
SlashV2A v ap =
|
||||
insertObj (mkNP <thbind v.c2 ap.s : Str>) (predV v) ** {c2 = v.c2} ;
|
||||
insertExtra <thbind v.c2 ap.s : Str> (predV v) ** {c2 = v.c2} ;
|
||||
|
||||
SlashV2V v vp = ---- looks too simple compared with ComplVV
|
||||
insertObj (mkNP <thbind v.c2 (infVP vp) : Str>) (predV v) ** {c2 = v.c2} ;
|
||||
insertExtra <thbind <v.c2 : Str> <infVP vp : Str> : Str> (predV v) ** {c2 = v.c2} ;
|
||||
SlashV2S v s =
|
||||
insertObj (mkNP <thbind conjThat s.s : Str>) (predV v) ** {c2 = v.c2} ;
|
||||
insertExtra conjThat (predV v) ** {c2 = v.c2} ;
|
||||
SlashV2Q v q =
|
||||
insertObj (mkNP (q.s ! QDir)) (predV v) ** {c2 = v.c2} ;
|
||||
insertExtra (q.s ! QIndir) (predV v) ** {c2 = v.c2} ;
|
||||
|
||||
ComplVV vv vp = {
|
||||
s = \\p =>
|
||||
@@ -30,18 +30,19 @@ concrete VerbTha of Verb = CatTha ** open ResTha, StringsTha, Prelude in {
|
||||
VVPre => thbind vv.s neg v ;
|
||||
VVMid => thbind neg vv.s v ;
|
||||
VVPost => thbind v neg vv.s
|
||||
}
|
||||
} ;
|
||||
e = []
|
||||
} ;
|
||||
|
||||
ComplVS v s = insertObj (mkNP (thbind conjThat s.s)) (predV v) ;
|
||||
ComplVQ v q = insertObj (mkNP (q.s ! QDir)) (predV v) ;
|
||||
ComplVQ v q = insertObj (mkNP (q.s ! QIndir)) (predV v) ;
|
||||
|
||||
|
||||
ComplVA v ap = insertObj ap (predV v) ;
|
||||
|
||||
ComplSlash vp np = insertObj (mkNP (thbind vp.c2 np.s)) vp ;
|
||||
|
||||
UseComp comp = comp ;
|
||||
UseComp comp = comp ** {e = []} ;
|
||||
|
||||
SlashVV v vp = ---- too simple?
|
||||
insertObj (mkNP (infVP vp)) (predV (regV v.s)) ** {c2 = vp.c2} ;
|
||||
@@ -56,7 +57,7 @@ concrete VerbTha of Verb = CatTha ** open ResTha, StringsTha, Prelude in {
|
||||
|
||||
ReflVP vp = insertObj (mkNP (thbind vp.c2 reflPron)) vp ;
|
||||
|
||||
PassV2 v = {s = \\p => thbind thuuk_s ((predV v).s ! p)} ;
|
||||
PassV2 v = {s = \\p => thbind thuuk_s ((predV v).s ! p) ; e = []} ;
|
||||
|
||||
CompAP ap = {s = \\p => thbind (polStr may_s p) ap.s} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user