1
0
forked from GitHub/gf-core

check dict: multiline changes

This commit is contained in:
aarne
2014-05-21 08:17:42 +00:00
parent cf7c3785ef
commit 971ad62913

View File

@@ -1,13 +1,14 @@
import qualified Data.Map
import qualified Data.Set
import Data.List
langs = words "Bul Chi Dut Eng Fin Fre Ger Hin Ita Spa Swe"
-- apply a function to every line
changeLinesLang :: (String -> String) -> String -> IO ()
-- apply a function to every line, changing it to a list
changeLinesLang :: (String -> [String]) -> String -> IO ()
changeLinesLang f lang = do
dict <- readFile (gfFile "Dictionary" lang) >>= return . lines
writeFile (gfFile "tmp/Dictionary" lang) $ unlines $ map f dict
writeFile (gfFile "tmp/Dictionary" lang) $ unlines $ concatMap f dict
createAllConcretes = do
createAbstract
@@ -115,3 +116,20 @@ statLang lang = do
statAll = mapM_ statLang langs
{-
-- lin f = def ; -- comment
analyseLine :: String -> (String,String,String,String,String)
analyseLine s = case words s of
k:f:s:dc -> (k,f,s)
-------
-- handle split senses: remove the unsplit variant ; if the split ones are empty, copy the unsplit to them
handleSplit :: Data.Set.Set String -> String -> [String]
handleSplit sset line =
let (keyw,fun,sep,def,comment) = analyseLine line
-}