mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-18 09:19:32 -06:00
20 lines
534 B
Haskell
20 lines
534 B
Haskell
main = interact (concat . map mkOne . zip [10001..] . lines)
|
|
|
|
mkOne (i,line) = case line of
|
|
'<':cs -> case pos line of
|
|
"nuon" -> entry (show i) (word line) "N"
|
|
"brev" -> entry (show i) (word line) "V"
|
|
"evitcejda" -> entry (show i) (word line) "A"
|
|
_ -> ""
|
|
_ -> ""
|
|
|
|
pos line = case reverse line of
|
|
'>':cs -> takeWhile (/='<') cs
|
|
_ -> ""
|
|
|
|
word line = takeWhile (/='>') line
|
|
|
|
entry i w c =
|
|
"fun w" ++ i ++ "_" ++ c ++ " : " ++ c ++ " ;\n" ++
|
|
"lin w" ++ i ++ "_" ++ c ++ " = mk" ++ c ++ " \"" ++ w ++ "\" ;\n"
|