1
0
forked from GitHub/gf-core

utf8 adjustments

This commit is contained in:
aarne
2008-06-26 06:52:01 +00:00
parent 75c08292e3
commit 712717e461
2 changed files with 7 additions and 5 deletions

View File

@@ -58,4 +58,5 @@ outputConcr pgf = case cncnames pgf of
cnc:_ -> cnc
printPGF :: PGF -> String
printPGF = encodeUTF8 . printTree . fromPGF
printPGF = ---- encodeUTF8 . -- out by AR26/6/2008: the PGF may already be UTF8
printTree . fromPGF

View File

@@ -99,15 +99,16 @@ canon2gfcc opts pars cgr@(M.MGrammar ((a,M.ModMod abm):cms)) =
opers = Map.fromAscList [] -- opers will be created as optimization
utf = if moduleFlag optEncoding (moduleOptions (M.flags mo)) == UTF_8
then D.convertStringsInTerm decodeUTF8 else id
umkTerm = utf . mkTerm
lins = Map.fromAscList
[(i2i f, utf (mkTerm tr)) | (f,CncFun _ (Yes tr) _) <- js]
[(i2i f, umkTerm tr) | (f,CncFun _ (Yes tr) _) <- js]
lincats = Map.fromAscList
[(i2i c, mkCType ty) | (c,CncCat (Yes ty) _ _) <- js]
lindefs = Map.fromAscList
[(i2i c, mkTerm tr) | (c,CncCat _ (Yes tr) _) <- js]
[(i2i c, umkTerm tr) | (c,CncCat _ (Yes tr) _) <- js]
printnames = Map.union
(Map.fromAscList [(i2i f, mkTerm tr) | (f,CncFun _ _ (Yes tr)) <- js])
(Map.fromAscList [(i2i f, mkTerm tr) | (f,CncCat _ _ (Yes tr)) <- js])
(Map.fromAscList [(i2i f, umkTerm tr) | (f,CncFun _ _ (Yes tr)) <- js])
(Map.fromAscList [(i2i f, umkTerm tr) | (f,CncCat _ _ (Yes tr)) <- js])
params = Map.fromAscList
[(i2i c, pars lang0 c) | (c,CncCat (Yes ty) _ _) <- js]
fcfg = Nothing