diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-01-28 17:41:51 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-01-28 17:41:51 +0000 |
| commit | 4c3aa8c164a920abcbe306c704e6e8229a6d0025 (patch) | |
| tree | c4c903f325507316cc87d223e2458c3356fa6aea /examples/uusisuomi/MkLex.hs | |
| parent | 327c63eb741606adf5d7d98cd32b731f6bda7ae7 (diff) | |
finnish updates
Diffstat (limited to 'examples/uusisuomi/MkLex.hs')
| -rw-r--r-- | examples/uusisuomi/MkLex.hs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/examples/uusisuomi/MkLex.hs b/examples/uusisuomi/MkLex.hs index 9d6525aee..f91f5f585 100644 --- a/examples/uusisuomi/MkLex.hs +++ b/examples/uusisuomi/MkLex.hs @@ -38,7 +38,23 @@ initiate tgt cat i = mapM_ putStrLn [ ] nums = map prt [1 ..] where - prt i = (if i < 10 then "0" else "") ++ show i ++ ". " +---- prt i = (if i < 10 then "0" else "") ++ show i ++ ". " + prt i = let n = show i in replicate (4-length n) '0' ++ n ++ ". " + +-- W is the flag for mixed-class word lists +mkLex "W" 0 line = case words line of + num:cat:sana:_ -> do + let nimi = "n" ++ init num ++ "_" ++ sana + putStrLn $ "fun " ++ nimi ++ "_" ++ cat ++ " : " ++ cat ++ " ;" + _ -> return () + +mkLex "W" 1 line = case words line of + num:cat:sanat@(sana:_) -> do + let nimi = "n" ++ init num ++ "_" ++ sana + putStrLn $ "lin " ++ nimi ++ + "_" ++ cat ++ " = mk" ++ cat ++ " " ++ + unwords (map prQuoted sanat) ++" ;" + _ -> return () mkLex cat 0 line = case words line of num:sana:_ -> do @@ -68,6 +84,7 @@ mkLex "N" 2 line = case words line of _ -> return () mkLex "N" 3 line = case words line of +---- num:sana:sanan:sanoja:_ -> do num:sana:sanan:_:_:_:_:sanoja:_ -> do let nimi = "n" ++ init num ++ "_" ++ sana putStrLn $ "lin " ++ nimi ++ @@ -82,7 +99,6 @@ mkLex "N" 4 line = case words line of "\" \"" ++ sanoja ++ "\" \"" ++ sanaa ++ "\" ;" _ -> return () - -- to initiate from a noun list that has compounds mkLex "N" 11 line = case words line of @@ -94,6 +110,8 @@ mkLex "N" 11 line = case words line of putStrLn $ "lin " ++ nimi ++ "_N = mkN \"" ++ sana ++ "\" ;" _ -> return () +prQuoted s = concat ["\"",s,"\""] + -- from sora+tie to tie uncompound = reverse . takeWhile (/= '+') . reverse |
