instructions for generating lexicon spreadsheets

This commit is contained in:
aarne
2014-03-31 07:13:02 +00:00
parent 154a65cc3e
commit c77b137c14

View File

@@ -56,5 +56,18 @@ Or take note of the last word that was checked already.
6. Generate a spreadsheet view
Here for Swe and Bul:
do
bnc <- readFile "bnc-to-check.txt" >>= return . words
swe <- readFile "DictionarySwe.gf" >>= return . map words . lines
let swemap = Data.Map.fromList [(f,unwords ws) | "lin":f:"=":ws <- swe]
bul <- readFile "DictionaryBul.gf" >>= return . map words . lines
let bulmap = Data.Map.fromList [(f,unwords ws) | "lin":f:"=":ws <- bul]
let look f m = maybe "-" id $ Data.Map.lookup f m
let line f = f ++ "\t" ++ look f swemap ++ "\t" ++ look f bulmap
writeFile "bnc-swe-bul.tsv" $ unlines $ map line bnc