From 3e978f2db152531ba7714e37dc2e52225390aa99 Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 19 Oct 2013 16:00:07 +0000 Subject: [PATCH] more general Pinyin file generation in Chi --- lib/src/chinese/pinyin/MkPinyin.hs | 9 +++++---- lib/src/chinese/pinyin/ResChi.gf | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/src/chinese/pinyin/MkPinyin.hs b/lib/src/chinese/pinyin/MkPinyin.hs index df243ffc3..670fce152 100644 --- a/lib/src/chinese/pinyin/MkPinyin.hs +++ b/lib/src/chinese/pinyin/MkPinyin.hs @@ -1,11 +1,12 @@ import qualified Data.Map as Map import Numeric +import System.Environment main = do + xx <- getArgs s <- readFile pinyinFile let m = c2pMap (mkList (words s)) - mapM_ (mkPinyin m) resModules --- mapM_ (mkPinyin m) ["HSKGrammar"] + mapM_ (mkPinyin m) xx return () pinyinFile = "pinyin.txt" @@ -15,8 +16,8 @@ resModules = [mo | mo <- ] mkPinyin ma mo = do - s <- readFile ("../" ++ mo ++ "Chi.gf") - writeFile (mo ++ "Chi.gf") (useMapGF ma s) + s <- readFile mo + writeFile (mo ++ "-cmn") (useMapGF ma s) --import Pinyin (c2pMap, useMapGF, mkList) diff --git a/lib/src/chinese/pinyin/ResChi.gf b/lib/src/chinese/pinyin/ResChi.gf index c0c1612d0..f72d20790 100644 --- a/lib/src/chinese/pinyin/ResChi.gf +++ b/lib/src/chinese/pinyin/ResChi.gf @@ -252,7 +252,7 @@ oper } ; getAdvType : Str -> AdvType = \s -> case s of { - "在" + _ => ATPlace True ; -- certain that True + "zai4" + _ => ATPlace True ; -- certain that True _ => ATPlace False -- uncertain whether ATPlace } ;