summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2013-02-03 10:03:15 +0000
committeraarne <aarne@chalmers.se>2013-02-03 10:03:15 +0000
commitf9a32dca3b97e1b73c67c825990977a4b9b26d89 (patch)
treedc7af3611c249840b546f206dd8445391d3d6048 /src
parent5e2474e3467e51d46314745d855d64921e4e0e4c (diff)
pg -lexc now writes a list of multichar symbols and a title ("Root") for the lexicon, as required by Xerox lexc
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/Command/Commands.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index 195caa2e1..172aa9641 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -1362,13 +1362,16 @@ infinity = 256
prLexcLexicon :: Morpho -> String
prLexcLexicon mo =
- unlines $ "LEXICON" : [prLexc l p ++ ":" ++ w ++ " # ;" | (w,lps) <- morpho, (l,p) <- lps] ++ ["END"]
+ unlines $ "Multichar_Symbols":multichars:"":"LEXICON Root" : [prLexc l p ++ ":" ++ w ++ " # ;" | (w,lps) <- morpho, (l,p) <- lps] ++ ["END"]
where
morpho = fullFormLexicon mo
- prLexc l p = showCId l ++ mkTags (words p)
+ prLexc l p = showCId l ++ concat (mkTags (words p))
mkTags p = case p of
"s":ws -> mkTags ws --- remove record field
- ws -> concat $ "+" : intersperse "+" ws
+ ws -> map ('+':) ws
+
+ multichars = unwords $ nub $ concat [mkTags (words p) | (w,lps) <- morpho, (l,p) <- lps]
+ -- thick_A+(AAdj+Posit+Gen):thick's # ;
prFullFormLexicon :: Morpho -> String
prFullFormLexicon mo =