mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
pg -lexc now writes a list of multichar symbols and a title ("Root") for the lexicon, as required by Xerox lexc
This commit is contained in:
@@ -1362,13 +1362,16 @@ infinity = 256
|
|||||||
|
|
||||||
prLexcLexicon :: Morpho -> String
|
prLexcLexicon :: Morpho -> String
|
||||||
prLexcLexicon mo =
|
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
|
where
|
||||||
morpho = fullFormLexicon mo
|
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
|
mkTags p = case p of
|
||||||
"s":ws -> mkTags ws --- remove record field
|
"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 :: Morpho -> String
|
||||||
prFullFormLexicon mo =
|
prFullFormLexicon mo =
|
||||||
|
|||||||
Reference in New Issue
Block a user