mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
modify glosses.hs to merge several examples into one
This commit is contained in:
@@ -14,8 +14,8 @@ gloss l =
|
|||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
glossTriples fn s =
|
glossTriples fn s =
|
||||||
(if null gs then [] else ["<"++fn++",gloss,"++show (mergeGloss gs)++">"])++
|
(if null gs then [] else ["<"++fn++",gloss,"++show (merge gs)++">"])++
|
||||||
["<"++fn++",example,"++e++">" | e <- es]
|
(if null es then [] else ["<"++fn++",example,"++show (merge (map (init . tail) es))++">"])
|
||||||
where
|
where
|
||||||
(es,gs) = partition isExample (splitGloss s)
|
(es,gs) = partition isExample (splitGloss s)
|
||||||
|
|
||||||
@@ -27,6 +27,6 @@ splitGloss s =
|
|||||||
where
|
where
|
||||||
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
|
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
|
||||||
|
|
||||||
mergeGloss = intercalate "; "
|
merge = intercalate "; "
|
||||||
|
|
||||||
isExample s = not (null s) && head s == '"' && last s == '"'
|
isExample s = not (null s) && head s == '"' && last s == '"'
|
||||||
|
|||||||
Reference in New Issue
Block a user