1
0
forked from GitHub/gf-core

modify glosses.hs to merge several examples into one

This commit is contained in:
krasimir
2015-11-24 19:30:19 +00:00
parent 0a38e137b6
commit 9b742e6b0d

View File

@@ -14,8 +14,8 @@ gloss l =
_ -> Nothing
glossTriples fn s =
(if null gs then [] else ["<"++fn++",gloss,"++show (mergeGloss gs)++">"])++
["<"++fn++",example,"++e++">" | e <- es]
(if null gs then [] else ["<"++fn++",gloss,"++show (merge gs)++">"])++
(if null es then [] else ["<"++fn++",example,"++show (merge (map (init . tail) es))++">"])
where
(es,gs) = partition isExample (splitGloss s)
@@ -27,6 +27,6 @@ splitGloss s =
where
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
mergeGloss = intercalate "; "
merge = intercalate "; "
isExample s = not (null s) && head s == '"' && last s == '"'