summaryrefslogtreecommitdiff
path: root/src/GF/API.hs
diff options
context:
space:
mode:
authoraarne <unknown>2003-11-10 14:57:51 +0000
committeraarne <unknown>2003-11-10 14:57:51 +0000
commit7a44450b34f80b156b8d663d3310e33aa7519910 (patch)
tree155a6c5163c0076e4c6e1ed4ba5fdc2898deced5 /src/GF/API.hs
parentc84ce99de2e9a17e2413f2f81cae0088170cc3b9 (diff)
Lin to tables.
Lin to tables. New unicode flag.
Diffstat (limited to 'src/GF/API.hs')
-rw-r--r--src/GF/API.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/GF/API.hs b/src/GF/API.hs
index dfaf3bd27..29474585f 100644
--- a/src/GF/API.hs
+++ b/src/GF/API.hs
@@ -178,6 +178,8 @@ optLinearizeTree opts0 gr t = case getOptVal opts transferFun of
lin mk
| oElem showRecord opts = liftM prt . linearizeNoMark g c
+ | oElem tableLin opts = liftM (unlines . map untok . prLinTable) .
+ allLinTables g c
| otherwise = return . untok . linTree2string mk g c
g = grammar gr
c = cncId gr
@@ -288,9 +290,10 @@ optTransfer opts g = case getOptVal opts transferFun of
optTokenizer :: Options -> GFGrammar -> String -> String
optTokenizer opts gr = show . customOrDefault opts useTokenizer customTokenizer gr
--- performs UTF8 if the language name is not *U.gf ; should be by gr option ---
-optEncodeUTF8 :: Language -> GFGrammar -> String -> String
-optEncodeUTF8 lang gr = case reverse (prLanguage lang) of
- 'U':_ -> id
+-- performs UTF8 if the language does not have flag coding=utf8; replaces name*U
+
+optEncodeUTF8 :: GFGrammar -> String -> String
+optEncodeUTF8 gr = case getOptVal (stateOptions gr) uniCoding of
+ Just "utf8" -> id
_ -> encodeUTF8