1
0
forked from GitHub/gf-core

diverse RGL and Phrasebook fixes, and a corrected Synopsis

This commit is contained in:
aarne
2011-12-05 15:25:06 +00:00
parent d5623f9d67
commit 25c9dabd02
12 changed files with 338 additions and 341 deletions

View File

@@ -1,7 +1,7 @@
concrete SentencesTha of Sentences = NumeralTha ** SentencesI - [ concrete SentencesTha of Sentences = NumeralTha ** SentencesI - [
PGreetingMale, PGreetingFemale, PGreetingMale, PGreetingFemale,
GObjectPlease, GObjectPlease,
ACitizen, WherePlace, WherePerson ACitizen
] with ] with
(Syntax = SyntaxTha), (Syntax = SyntaxTha),
(Symbolic = SymbolicTha), (Symbolic = SymbolicTha),
@@ -17,11 +17,6 @@ lin
ACitizen p n = mkCl p.name (mkVP (mkCN n (P.personN R.khon_s))) ; ACitizen p n = mkCl p.name (mkVP (mkCN n (P.personN R.khon_s))) ;
WherePlace place = mkQS (mkQCl where_IAdv (mkCl place.name yuu_V)) ;
WherePerson person = mkQS (mkQCl where_IAdv (mkCl person.name yuu_V)) ;
oper oper
yuu_V : V = R.regV "อยู่" ;
thpron = R.thpron ; thpron = R.thpron ;
} }

View File

@@ -14,7 +14,7 @@ mkExx sss = case sss of
(s1:ss1,s2:ss2) | isMsg s1 -> mkExx (ss1,s2:ss2) (s1:ss1,s2:ss2) | isMsg s1 -> mkExx (ss1,s2:ss2)
(s1:ss1,s2:ss2) | isMsg s2 -> mkExx (s1:ss1,ss2) (s1:ss1,s2:ss2) | isMsg s2 -> mkExx (s1:ss1,ss2)
(s1:ss1,s2:ss2) | s1 /= s2 -> (s1:ss1,s2:ss2) | s1 /= s2 ->
putStrLn (drops s1) >> putStrLn (drops s2) >> putStrLn [] >> mkExx (ss1,ss2) -- show the strings putStrLn (drops s1) >> putStrLn (filter (not . (==' ')) (drops s2)) >> putStrLn [] >> mkExx (ss1,ss2) -- show strings
(s1:ss1,s2:ss2) | s1 == s2 && not (isJunk s1) -> (s1:ss1,s2:ss2) | s1 == s2 && not (isJunk s1) ->
putStrLn (drops s1) >> mkExx (ss1,ss2) -- show the term putStrLn (drops s1) >> mkExx (ss1,ss2) -- show the term
(s1:ss1,s2:ss2) | s1 == s2 -> mkExx (ss1,ss2) (s1:ss1,s2:ss2) | s1 == s2 -> mkExx (ss1,ss2)

View File

@@ -68,9 +68,10 @@ prApiExx aexx = unlines
prApiEx :: M.Map String String -> [String] prApiEx :: M.Map String String -> [String]
prApiEx apexx = case M.toList apexx of prApiEx apexx = case M.toList apexx of
(a,e):lexx -> (a ++ ": ``" ++ unwords (words e) ++ "``"): (a,e):lexx -> (a ++ ": ``" ++ unwords (words e) ++ "``"):
[l ++ ": //" ++ mkEx e ++ "//" | (l,e) <- lexx] [l ++ ": //" ++ mkEx l e ++ "//" | (l,e) <- lexx]
mkEx = unwords . bind . mkE . words where mkEx l = unws . bind . mkE . words where
unws = if l == "Tha" then concat else unwords
mkE e = case e of mkE e = case e of
"atomic":"term":_ -> ["*"] "atomic":"term":_ -> ["*"]
"[]":_ -> ["''"] "[]":_ -> ["''"]

View File

@@ -742,7 +742,7 @@ mkAdv during_Prep it_NP
either7or_DConj : Conj -- either...or either7or_DConj : Conj -- either...or
mkAdv either7or_DConj here_Adv there_Adv mkAdv either7or_DConj here_Adv there_Adv
every_Det : Det every_Det : Det
every_Det mkUtt (mkNP every_Det woman_N)
everybody_NP : NP -- everybody everybody_NP : NP -- everybody
mkUtt everybody_NP mkUtt everybody_NP
everything_NP : NP everything_NP : NP
@@ -750,7 +750,7 @@ mkUtt everything_NP
everywhere_Adv : Adv everywhere_Adv : Adv
everywhere_Adv everywhere_Adv
few_Det : Det few_Det : Det
few_Det mkUtt (mkNP few_Det women_N)
for_Prep : Prep for_Prep : Prep
mkAdv for_Prep it_NP mkAdv for_Prep it_NP
from_Prep : Prep from_Prep : Prep
@@ -788,7 +788,7 @@ more_CAdv
most_Predet : Predet most_Predet : Predet
most_Predet most_Predet
much_Det : Det much_Det : Det
much_Det mkUtt (mkNP much_Det wine_N)
must_VV : VV must_VV : VV
must_VV must_VV
no_Utt : Utt no_Utt : Utt
@@ -814,9 +814,9 @@ mkUtt (mkNP she_Pron)
so_AdA : AdA so_AdA : AdA
so_AdA so_AdA
someSg_Det : Det someSg_Det : Det
someSg_Det mkUtt (mkNP someSg_Det wine_N)
somePl_Det : Det somePl_Det : Det
somePl_Det mkUtt (mkNP somePl_Det woman_N)
somebody_NP : NP somebody_NP : NP
mkUtt somebody_NP mkUtt somebody_NP
something_NP : NP something_NP : NP

View File

@@ -23,12 +23,12 @@ constructing trees in them.
- [Chapter 2 #toc5]: syntactic construction functions, with cross-links and - [Chapter 2 #toc5]: syntactic construction functions, with cross-links and
examples. examples.
- [Chapter 3 #toc83]: morphological paradigms. - [Chapter 3 #toc83]: morphological paradigms.
- [Chapter 4 #toc102]: additional libraries. - [Chapter 4 #toc103]: additional libraries.
- [Chapter 5 #toc109]: how to "browse" the library by - [Chapter 5 #toc110]: how to "browse" the library by
loading the grammars into the ``gf`` command editor. loading the grammars into the ``gf`` command editor.
- [Chapter 6 #toc110]: a brief example of how application grammars can - [Chapter 6 #toc111]: a brief example of how application grammars can
use the resource modules. use the resource modules.
- [Detailed table of contents #toc111]. - [Detailed table of contents #toc112].
Other relevant documents: Other relevant documents:

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
--# -path=.:full:alltenses --# -path=.:alltenses
concrete MiniGrammarEng of MiniGrammar = LexiconEng, GrammarEng [ concrete MiniGrammarEng of MiniGrammar = LexiconEng, GrammarEng [

View File

@@ -239,7 +239,7 @@ lin
read_V2 = mkV2 "อ่าน" ; read_V2 = mkV2 "อ่าน" ;
red_A = mkA (thword "สี" "แดง") ; red_A = mkA (thword "สี" "แดง") ;
religion_N = mkN (thword "ศาส" "นา") ; ----? religion_N = mkN (thword "ศาส" "นา") ; ----?
restaurant_N = placeN (thword "ร้าน" "อาหาร") ; restaurant_N = placeN (thword "ร้าน" "อา" "หาร") ;
right_Ord = ss "ขวา" ; right_Ord = ss "ขวา" ;
river_N = mkN (thword "แม่" "น้ำ") ; river_N = mkN (thword "แม่" "น้ำ") ;
road_N = mkN (thword "ถนน") ; road_N = mkN (thword "ถนน") ;

View File

@@ -17,7 +17,7 @@ concrete QuestionTha of Question = CatTha **
QuestIAdv iadv cl = {s = \\p => thbind (cl.s ! ClDecl ! p) iadv.s} ; QuestIAdv iadv cl = {s = \\p => thbind (cl.s ! ClDecl ! p) iadv.s} ;
QuestIComp icomp np = {s = \\p => thbind np.s icomp.s} ; QuestIComp icomp np = {s = \\p => thbind np.s (polStr may_s p) icomp.s} ;
PrepIP p ip = thbind p ip ; PrepIP p ip = thbind p ip ;
@@ -37,9 +37,9 @@ concrete QuestionTha of Question = CatTha **
AdvIAdv i a = thbind i a ; AdvIAdv i a = thbind i a ;
CompIAdv a = a ; CompIAdv a = ss (thbind yuu_s a.s) ;
CompIP ip = ip ; CompIP ip = ss (thbind pen_s ip.s) ;
} }

View File

@@ -94,6 +94,6 @@ yay_s = "ใหญ" ; -- big
yig_s = "หญิง" ; -- woman2 yig_s = "หญิง" ; -- woman2
yii_s = "ยี่" ; -- two' yii_s = "ยี่" ; -- two'
yin_s = "ยิน" ; -- you're-welcome1 yin_s = "ยิน" ; -- you're-welcome1
yuu_s = "ยู" ; -- where0(?) yuu_s = "ยู" ; -- be (in a place)
} }

View File

@@ -13,6 +13,7 @@ allThpron = do
System.system "ls *Tha*.gf ../api/*Tha*.gf >srcThai.txt" System.system "ls *Tha*.gf ../api/*Tha*.gf >srcThai.txt"
files <- readFile "srcThai.txt" >>= return . lines files <- readFile "srcThai.txt" >>= return . lines
mapM_ fileThpron files mapM_ fileThpron files
return ()
fileThpron file = do fileThpron file = do
s <- readFile file s <- readFile file

View File

@@ -73,7 +73,7 @@ concrete VerbTha of Verb = CatTha ** open ResTha, StringsTha, Prelude in {
} }
} ; } ;
CompAdv a = {s = \\p => polStr may_s p ++ a.s} ; --- ?? CompAdv a = {s = \\p => thbind (polStr may_s p) yuu_s a.s} ; --- works for place adverbs
} }