forked from GitHub/gf-rgl
Thai complete with what is needed to compile Sentences in Phrasebook
This commit is contained in:
5
src/api/SymbolicTha.gf
Normal file
5
src/api/SymbolicTha.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
--# -path=.:alltenses
|
||||||
|
|
||||||
|
resource SymbolicTha = Symbolic with
|
||||||
|
(Symbol = SymbolTha),
|
||||||
|
(Grammar = GrammarTha) ;
|
||||||
@@ -11,7 +11,7 @@ concrete GrammarTha of Grammar =
|
|||||||
RelativeTha,
|
RelativeTha,
|
||||||
ConjunctionTha,
|
ConjunctionTha,
|
||||||
PhraseTha,
|
PhraseTha,
|
||||||
TextX,
|
TextTha,
|
||||||
StructuralTha,
|
StructuralTha,
|
||||||
IdiomTha,
|
IdiomTha,
|
||||||
TenseX
|
TenseX
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ concrete LexiconTha of Lexicon = CatTha **
|
|||||||
open ParadigmsTha, ResTha, Prelude in {
|
open ParadigmsTha, ResTha, Prelude in {
|
||||||
|
|
||||||
flags
|
flags
|
||||||
optimize=values ;
|
coding = utf8 ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
-- airplane_N = regN "airplane" ;
|
-- airplane_N = regN "airplane" ;
|
||||||
@@ -45,7 +45,7 @@ lin
|
|||||||
-- ceiling_N = regN "ceiling" ;
|
-- ceiling_N = regN "ceiling" ;
|
||||||
-- chair_N = regN "chair" ;
|
-- chair_N = regN "chair" ;
|
||||||
-- cheese_N = regN "cheese" ;
|
-- cheese_N = regN "cheese" ;
|
||||||
-- child_N = mk2N "child" "children" ;
|
child_N = personN "ลูก" ;
|
||||||
-- church_N = regN "church" ;
|
-- church_N = regN "church" ;
|
||||||
-- city_N = regN "city" ;
|
-- city_N = regN "city" ;
|
||||||
-- clean_A = regADeg "clean" ;
|
-- clean_A = regADeg "clean" ;
|
||||||
@@ -101,7 +101,9 @@ lin
|
|||||||
-- industry_N = regN "industry" ;
|
-- industry_N = regN "industry" ;
|
||||||
-- iron_N = regN "iron" ;
|
-- iron_N = regN "iron" ;
|
||||||
-- king_N = regN "king" ;
|
-- 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" ;
|
-- lake_N = regN "lake" ;
|
||||||
-- lamp_N = regN "lamp" ;
|
-- lamp_N = regN "lamp" ;
|
||||||
-- learn_V2 = dirV2 (regV "learn") ;
|
-- learn_V2 = dirV2 (regV "learn") ;
|
||||||
@@ -114,7 +116,7 @@ lin
|
|||||||
-- long_A = regADeg "long" ;
|
-- long_A = regADeg "long" ;
|
||||||
-- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
|
-- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
|
||||||
-- love_N = regN "love" ;
|
-- love_N = regN "love" ;
|
||||||
love_V2 = dirV2 (regV rak_s) ;
|
love_V2 = mkV2 (regV rak_s) ;
|
||||||
-- man_N = mk2N "man" "men" ;
|
-- man_N = mk2N "man" "men" ;
|
||||||
-- married_A2 = mkA2 (regA "married") toP ;
|
-- married_A2 = mkA2 (regA "married") toP ;
|
||||||
-- meat_N = regN "meat" ;
|
-- meat_N = regN "meat" ;
|
||||||
@@ -190,6 +192,7 @@ lin
|
|||||||
-- thick_A = regADeg "thick" ;
|
-- thick_A = regADeg "thick" ;
|
||||||
-- thin_A = duplADeg "thin" ;
|
-- thin_A = duplADeg "thin" ;
|
||||||
-- train_N = regN "train" ;
|
-- train_N = regN "train" ;
|
||||||
|
today_Adv = ss (thbind "วัน" "นี้") ;
|
||||||
-- travel_V = (regDuplV "travel") ;
|
-- travel_V = (regDuplV "travel") ;
|
||||||
-- tree_N = regN "tree" ;
|
-- tree_N = regN "tree" ;
|
||||||
-- ---- trousers_N = regN "trousers" ;
|
-- ---- trousers_N = regN "trousers" ;
|
||||||
|
|||||||
@@ -10,6 +10,15 @@ oper
|
|||||||
= \s,c -> lin N {s = s ; c = c} ;
|
= \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) ;
|
mkA : Str -> A = \s -> lin A (mkAdj s) ;
|
||||||
|
|
||||||
mkV = overload {
|
mkV = overload {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ resource ResTha = ParamX, StringsTha ** open Prelude in {
|
|||||||
|
|
||||||
Noun = {s,c : Str} ;
|
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)
|
-- before and after classifier; whether classifier needed (default)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete StructuralTha of Structural = CatTha **
|
concrete StructuralTha of Structural = CatTha **
|
||||||
open StringsTha, ResTha, Prelude in {
|
open ParadigmsTha, ResTha, Prelude in {
|
||||||
|
|
||||||
flags coding = utf8 ;
|
flags coding = utf8 ;
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ concrete StructuralTha of Structural = CatTha **
|
|||||||
-- first_Ord = ss "first" ;
|
-- first_Ord = ss "first" ;
|
||||||
-- for_Prep = ss "for" ;
|
-- for_Prep = ss "for" ;
|
||||||
-- from_Prep = ss "from" ;
|
-- from_Prep = ss "from" ;
|
||||||
|
have_V2 = mkV2 "มี" ;
|
||||||
he_Pron = ss khaw_s ;
|
he_Pron = ss khaw_s ;
|
||||||
-- here_Adv = ss "here" ;
|
-- here_Adv = ss "here" ;
|
||||||
-- here7to_Adv = ss ["to here"] ;
|
-- here7to_Adv = ss ["to here"] ;
|
||||||
@@ -48,15 +49,15 @@ concrete StructuralTha of Structural = CatTha **
|
|||||||
-- most_Predet = ss "most" ;
|
-- most_Predet = ss "most" ;
|
||||||
-- much_Det = mkDeterminer Sg "much" ;
|
-- much_Det = mkDeterminer Sg "much" ;
|
||||||
must_VV = {s = tog_s ; typ = VVPre} ;
|
must_VV = {s = tog_s ; typ = VVPre} ;
|
||||||
-- no_Phr = ss "no" ;
|
no_Utt = ss may_s ;
|
||||||
-- on_Prep = ss "on" ;
|
-- on_Prep = ss "on" ;
|
||||||
-- one_Quant = mkDeterminer Sg "one" ;
|
-- one_Quant = mkDeterminer Sg "one" ;
|
||||||
-- only_Predet = ss "only" ;
|
-- only_Predet = ss "only" ;
|
||||||
-- or_Conj = ss "or" ** {n = Sg} ;
|
-- or_Conj = ss "or" ** {n = Sg} ;
|
||||||
-- otherwise_PConj = ss "otherwise" ;
|
-- otherwise_PConj = ss "otherwise" ;
|
||||||
-- part_Prep = ss "of" ;
|
-- part_Prep = ss "of" ;
|
||||||
-- please_Voc = ss "please" ;
|
please_Voc = ss "ขอ" ;
|
||||||
-- possess_Prep = ss "of" ;
|
possess_Prep = ss "ของ" ;
|
||||||
-- quite_Adv = ss "quite" ;
|
-- quite_Adv = ss "quite" ;
|
||||||
she_Pron = ss khaw_s ;
|
she_Pron = ss khaw_s ;
|
||||||
-- so_AdA = ss "so" ;
|
-- so_AdA = ss "so" ;
|
||||||
@@ -77,22 +78,22 @@ concrete StructuralTha of Structural = CatTha **
|
|||||||
-- this_NP = regNP "this" Sg ;
|
-- this_NP = regNP "this" Sg ;
|
||||||
-- those_NP = regNP "those" Pl ;
|
-- those_NP = regNP "those" Pl ;
|
||||||
-- through_Prep = ss "through" ;
|
-- through_Prep = ss "through" ;
|
||||||
-- too_AdA = ss "too" ;
|
too_AdA = ss (thbind "เกิน" "ไป") ;
|
||||||
-- to_Prep = ss "to" ;
|
-- to_Prep = ss "to" ;
|
||||||
-- under_Prep = ss "under" ;
|
-- under_Prep = ss "under" ;
|
||||||
-- very_AdA = ss "very" ;
|
very_AdA = ss "มาก" ;
|
||||||
want_VV = {s = yaak_s ; typ = VVMid} ;
|
want_VV = {s = yaak_s ; typ = VVMid} ;
|
||||||
we_Pron = ss raw_s ;
|
we_Pron = ss raw_s ;
|
||||||
whatPl_IP, whatSg_IP = ss (thbind "อะ" "ไร") ;
|
whatPl_IP, whatSg_IP = ss (thbind "อะ" "ไร") ;
|
||||||
-- when_IAdv = ss "when" ;
|
-- when_IAdv = ss "when" ;
|
||||||
-- when_Subj = ss "when" ;
|
-- when_Subj = ss "when" ;
|
||||||
-- where_IAdv = ss "where" ;
|
where_IAdv = ss (thbind "ฑี" "ไหน") ;
|
||||||
which_IQuant = {s1 = "ไหน" ; s2 = [] ; hasC = True} ;
|
which_IQuant = {s1 = "ไหน" ; s2 = [] ; hasC = True} ;
|
||||||
whoPl_IP, whoSg_IP = ss "ไคร" ;
|
whoPl_IP, whoSg_IP = ss "ไคร" ;
|
||||||
-- why_IAdv = ss "why" ;
|
-- why_IAdv = ss "why" ;
|
||||||
-- without_Prep = ss "without" ;
|
-- without_Prep = ss "without" ;
|
||||||
-- with_Prep = ss "with" ;
|
-- with_Prep = ss "with" ;
|
||||||
-- yes_Phr = ss "yes" ;
|
yes_Utt = ss chay_s ;
|
||||||
youSg_Pron = ss khun_s ;
|
youSg_Pron = ss khun_s ;
|
||||||
youPl_Pron = ss khun_s ;
|
youPl_Pron = ss khun_s ;
|
||||||
youPol_Pron = ss khun_s ;
|
youPol_Pron = ss khun_s ;
|
||||||
|
|||||||
@@ -3,30 +3,25 @@
|
|||||||
concrete SymbolTha of Symbol = CatTha ** open Prelude, ResTha in {
|
concrete SymbolTha of Symbol = CatTha ** open Prelude, ResTha in {
|
||||||
|
|
||||||
flags coding = utf8;
|
flags coding = utf8;
|
||||||
{-
|
|
||||||
lin
|
lin
|
||||||
-- SymbPN i = {s = \\_ => i.s ; g = Masc} ;
|
SymbPN i = i ;
|
||||||
SymbPN i = {s = addGenitiveS i.s ; g = Masc} ;
|
IntPN i = i ;
|
||||||
IntPN i = {s = addGenitiveS i.s ; g = Masc} ;
|
FloatPN i = i ;
|
||||||
FloatPN i = {s = addGenitiveS i.s ; g = Masc} ;
|
NumPN i = i ;
|
||||||
NumPN i = {s = \\_ =>i.s ; g = Masc} ;
|
|
||||||
CNIntNP cn i = {
|
CNIntNP cn i = {
|
||||||
s = \\c => cn.s ! Sg ! Dir ++ i.s ;
|
s = thbind cn.s ++ i.s ;
|
||||||
a = agrP3 cn.g Sg
|
c = cn.c
|
||||||
} ;
|
|
||||||
CNSymbNP det cn xs = {
|
|
||||||
s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Dir ++ xs.s ;
|
|
||||||
a = agrP3 cn.g det.n
|
|
||||||
} ;
|
} ;
|
||||||
|
CNSymbNP det cn xs = ss (thbind det.s1 cn.s xs.s) ; ----
|
||||||
CNNumNP cn i = {
|
CNNumNP cn i = {
|
||||||
s = \\c => cn.s ! Sg ! Dir ++ i.s ;
|
s = thbind cn.s ++ i.s ;
|
||||||
a = agrP3 cn.g Sg
|
c = cn.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SymbS sy = sy ;
|
SymbS sy = sy ;
|
||||||
SymbNum sy = { s = sy.s ; n = Pl } ;
|
SymbNum sy = sy ;
|
||||||
SymbOrd sy = { s = sy.s ++ "waN" ; n = Pl} ;
|
SymbOrd sy = sy ;
|
||||||
-}
|
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
|
|
||||||
|
|||||||
11
src/thai/TextTha.gf
Normal file
11
src/thai/TextTha.gf
Normal 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} ;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user