Thai complete with what is needed to compile Sentences in Phrasebook

This commit is contained in:
aarne
2011-11-07 15:46:21 +00:00
parent 3148e305d5
commit 06630f223f
9 changed files with 55 additions and 31 deletions

View File

@@ -0,0 +1,5 @@
--# -path=.:alltenses
resource SymbolicTha = Symbolic with
(Symbol = SymbolTha),
(Grammar = GrammarTha) ;

View File

@@ -11,7 +11,7 @@ concrete GrammarTha of Grammar =
RelativeTha,
ConjunctionTha,
PhraseTha,
TextX,
TextTha,
StructuralTha,
IdiomTha,
TenseX

View File

@@ -4,7 +4,7 @@ concrete LexiconTha of Lexicon = CatTha **
open ParadigmsTha, ResTha, Prelude in {
flags
optimize=values ;
coding = utf8 ;
lin
-- airplane_N = regN "airplane" ;
@@ -45,7 +45,7 @@ lin
-- ceiling_N = regN "ceiling" ;
-- chair_N = regN "chair" ;
-- cheese_N = regN "cheese" ;
-- child_N = mk2N "child" "children" ;
child_N = personN "ลูก" ;
-- church_N = regN "church" ;
-- city_N = regN "city" ;
-- clean_A = regADeg "clean" ;
@@ -101,7 +101,9 @@ lin
-- industry_N = regN "industry" ;
-- iron_N = regN "iron" ;
-- king_N = regN "king" ;
-- know_V2 = dirV2 (irregV "know" "knew" "known") ;
know_V2 = mkV2 "รู้" ; -----
know_VQ = lin VQ (regV "รู้") ; -----
know_VS = lin VS (regV "รู้") ; -----
-- lake_N = regN "lake" ;
-- lamp_N = regN "lamp" ;
-- learn_V2 = dirV2 (regV "learn") ;
@@ -114,7 +116,7 @@ lin
-- long_A = regADeg "long" ;
-- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
-- love_N = regN "love" ;
love_V2 = dirV2 (regV rak_s) ;
love_V2 = mkV2 (regV rak_s) ;
-- man_N = mk2N "man" "men" ;
-- married_A2 = mkA2 (regA "married") toP ;
-- meat_N = regN "meat" ;
@@ -190,6 +192,7 @@ lin
-- thick_A = regADeg "thick" ;
-- thin_A = duplADeg "thin" ;
-- train_N = regN "train" ;
today_Adv = ss (thbind "วัน" "นี้") ;
-- travel_V = (regDuplV "travel") ;
-- tree_N = regN "tree" ;
-- ---- trousers_N = regN "trousers" ;

View File

@@ -10,6 +10,15 @@ oper
= \s,c -> lin N {s = s ; c = c} ;
} ;
personN : Str -> N
= \s -> mkN s "คน" ;
fooddishN : Str -> N
= \s -> mkN s "จาน" ;
vehicleN : Str -> N
= \s -> mkN s "คัน" ;
houseN : Str -> N
= \s -> mkN s "หลัง" ;
mkA : Str -> A = \s -> lin A (mkAdj s) ;
mkV = overload {

View File

@@ -39,7 +39,7 @@ resource ResTha = ParamX, StringsTha ** open Prelude in {
Noun = {s,c : Str} ;
mkN : Str -> Str -> Noun = \s,c -> {s = s ; c = c} ;
mkNoun : Str -> Str -> Noun = \s,c -> {s = s ; c = c} ;
-- before and after classifier; whether classifier needed (default)

View File

@@ -1,5 +1,5 @@
concrete StructuralTha of Structural = CatTha **
open StringsTha, ResTha, Prelude in {
open ParadigmsTha, ResTha, Prelude in {
flags coding = utf8 ;
@@ -31,6 +31,7 @@ concrete StructuralTha of Structural = CatTha **
-- first_Ord = ss "first" ;
-- for_Prep = ss "for" ;
-- from_Prep = ss "from" ;
have_V2 = mkV2 "มี" ;
he_Pron = ss khaw_s ;
-- here_Adv = ss "here" ;
-- here7to_Adv = ss ["to here"] ;
@@ -48,15 +49,15 @@ concrete StructuralTha of Structural = CatTha **
-- most_Predet = ss "most" ;
-- much_Det = mkDeterminer Sg "much" ;
must_VV = {s = tog_s ; typ = VVPre} ;
-- no_Phr = ss "no" ;
no_Utt = ss may_s ;
-- on_Prep = ss "on" ;
-- one_Quant = mkDeterminer Sg "one" ;
-- only_Predet = ss "only" ;
-- or_Conj = ss "or" ** {n = Sg} ;
-- otherwise_PConj = ss "otherwise" ;
-- part_Prep = ss "of" ;
-- please_Voc = ss "please" ;
-- possess_Prep = ss "of" ;
please_Voc = ss "ขอ" ;
possess_Prep = ss "ของ" ;
-- quite_Adv = ss "quite" ;
she_Pron = ss khaw_s ;
-- so_AdA = ss "so" ;
@@ -77,22 +78,22 @@ concrete StructuralTha of Structural = CatTha **
-- this_NP = regNP "this" Sg ;
-- those_NP = regNP "those" Pl ;
-- through_Prep = ss "through" ;
-- too_AdA = ss "too" ;
too_AdA = ss (thbind "เกิน" "ไป") ;
-- to_Prep = ss "to" ;
-- under_Prep = ss "under" ;
-- very_AdA = ss "very" ;
very_AdA = ss "มาก" ;
want_VV = {s = yaak_s ; typ = VVMid} ;
we_Pron = ss raw_s ;
whatPl_IP, whatSg_IP = ss (thbind "อะ" "ไร") ;
-- when_IAdv = ss "when" ;
-- when_Subj = ss "when" ;
-- where_IAdv = ss "where" ;
where_IAdv = ss (thbind "ฑี" "ไหน") ;
which_IQuant = {s1 = "ไหน" ; s2 = [] ; hasC = True} ;
whoPl_IP, whoSg_IP = ss "ไคร" ;
-- why_IAdv = ss "why" ;
-- without_Prep = ss "without" ;
-- with_Prep = ss "with" ;
-- yes_Phr = ss "yes" ;
yes_Utt = ss chay_s ;
youSg_Pron = ss khun_s ;
youPl_Pron = ss khun_s ;
youPol_Pron = ss khun_s ;

View File

@@ -3,30 +3,25 @@
concrete SymbolTha of Symbol = CatTha ** open Prelude, ResTha in {
flags coding = utf8;
{-
lin
-- SymbPN i = {s = \\_ => i.s ; g = Masc} ;
SymbPN i = {s = addGenitiveS i.s ; g = Masc} ;
IntPN i = {s = addGenitiveS i.s ; g = Masc} ;
FloatPN i = {s = addGenitiveS i.s ; g = Masc} ;
NumPN i = {s = \\_ =>i.s ; g = Masc} ;
SymbPN i = i ;
IntPN i = i ;
FloatPN i = i ;
NumPN i = i ;
CNIntNP cn i = {
s = \\c => cn.s ! Sg ! Dir ++ i.s ;
a = agrP3 cn.g Sg
} ;
CNSymbNP det cn xs = {
s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Dir ++ xs.s ;
a = agrP3 cn.g det.n
s = thbind cn.s ++ i.s ;
c = cn.c
} ;
CNSymbNP det cn xs = ss (thbind det.s1 cn.s xs.s) ; ----
CNNumNP cn i = {
s = \\c => cn.s ! Sg ! Dir ++ i.s ;
a = agrP3 cn.g Sg
s = thbind cn.s ++ i.s ;
c = cn.c
} ;
SymbS sy = sy ;
SymbNum sy = { s = sy.s ; n = Pl } ;
SymbOrd sy = { s = sy.s ++ "waN" ; n = Pl} ;
-}
SymbNum sy = sy ;
SymbOrd sy = sy ;
lincat

11
lib/src/thai/TextTha.gf Normal file
View File

@@ -0,0 +1,11 @@
concrete TextTha of Text = CommonX ** {
-- No punctuation - but make sure to leave spaces between sentences!
lin
TEmpty = {s = []} ;
TFullStop x xs = {s = x.s ++ "" ++ xs.s} ;
TQuestMark x xs = {s = x.s ++ "" ++ xs.s} ;
TExclMark x xs = {s = x.s ++ "" ++ xs.s} ;
}