1
0
forked from GitHub/gf-rgl

updated Spa and Swe Extend

This commit is contained in:
Aarne Ranta
2017-08-23 22:08:24 +03:00
parent 6c6141befd
commit 2313f6ee40
9 changed files with 259 additions and 29 deletions

View File

@@ -1,3 +1,8 @@
module Main where
import Data.List
import Data.Ord (comparing)
main = docExtend
docExtend = do
@@ -22,13 +27,15 @@ docExtend = do
--- mapM print fundefs
-- read the functor exclusion lists for each language
let langs = [("Eng","english"),("Dut","dutch"),("Spa","spanish")] --,("Swe","swedish")]
let langs = [("Eng","english"),("Dut","dutch"),("Spa","spanish"),("Swe","swedish")]
funss <- mapM getExclusions langs
mapM_ print funss
--- mapM_ print funss
let langfuns = zip (map fst langs) funss
let funlangs = [(fu,[lang | (lang,fs) <- langfuns, elem fu fs]) | fu:_ <- funs]
let fundeflangs = [[fu,ty,co,de,unwords ls] | fu:ty:co:de:_ <- fundefs, (f,ls) <- funlangs, f==fu]
mapM print fundeflangs
--- mapM print fundeflangs
writeFile "GF-RGL-Extend.html" $ printHTML $ sortBy (comparing (\z -> (last (words (z !! 1)), z!!0))) fundeflangs
putStrLn "wrote file GF-RGL-Extend.html"
-- exclusion format:
-- concrete ExtendEng of Extend =
@@ -42,4 +49,17 @@ getExclusions (lan,language) = do
let excls = case dropWhile (/=["["]) rs of
[] -> []
_:es -> map (filter (/=',')) $ concat $ takeWhile (/= ["]"]) es
return excls
return excls
printHTML fs = unlines $
"<html>" :
"<body>" :
"<table>" :
map prRow fs ++ [
"</table>",
"</body>",
"</html>"
]
where
prRow ss = concat $ "<tr>" : ["<td>" ++ s ++ "</td>" | s <- ss] ++ ["</tr>"]