mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-30 18:28:55 -06:00
instructions for generating lexicon spreadsheets
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user