summaryrefslogtreecommitdiff
path: root/examples/big/MkDict.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
commite9e80fc389365e24d4300d7d5390c7d833a96c50 (patch)
treef0b58473adaa670bd8fc52ada419d8cad470ee03 /examples/big/MkDict.hs
parentb96b36f43de3e2f8b58d5f539daa6f6d47f25870 (diff)
changed names of resource-1.3; added a note on homepage on release
Diffstat (limited to 'examples/big/MkDict.hs')
-rw-r--r--examples/big/MkDict.hs48
1 files changed, 0 insertions, 48 deletions
diff --git a/examples/big/MkDict.hs b/examples/big/MkDict.hs
deleted file mode 100644
index babf7809f..000000000
--- a/examples/big/MkDict.hs
+++ /dev/null
@@ -1,48 +0,0 @@
-import Char
-
-infile = "mywordlist1"
-
-main = do
- s <- readFile infile
- mapM_ (putStrLn . mkOne) $ lines s
-
-mkOne s = case words s of
- "--":_ -> ""
- ('(':_):w:cat:ws -> unwords $ mkCatf (nopar cat) (more ws) w
- _ -> "-- " ++ s
- where
- more ws = case ws of
- _ | elem "(REG" ws -> "irreg"
- _ -> "reg"
- nopar = filter (flip notElem "()")
- mkCatf c r w = case c of
- "Noun" -> ["N","regN",w]
- "PRT" -> ["Adv","mkAdv",w] ----
- "TITLE" -> ["N","regN",w] ----
- "Adject" -> ["A","regA",w]
- "AdjInf" -> ["A","regA",w] ----
- "AdjInf_LONG" -> ["A","longA",w] ----
- "AdjPrd" -> ["A","regA",w] ----
- "AdjPrd_LONG" -> ["A","longA",w] ----
- "Adject_LONG" -> ["A","longA",w]
- "Verb" | r == "irreg" -> []
- "Verb" -> ["V","regV",w]
- "V2" | r == "irreg" -> ["V2","irreg", w, "_V"]
- "V2" -> ["V2","regV2", w]
- "PNoun" -> ["PN","regPN",toUpper (head w): tail w]
- 'V':'2':'_':prep | r == "irreg" ->
- let p = map toLower prep in ["V2","mkV2_"++p, w, "_V", p]
- x:'2':'_':prep ->
- let p = map toLower prep in [[x]++"2","prep" ++[x]++"2"++p, w, p]
- "V3_NP" | r == "irreg" -> ["V3","irreg", w, "_V"]
- "V3_NP" -> ["V3","regV3", w]
- 'V':'3':'_':'P':'P':prep | r == "irreg" ->
- let p = map toLower prep in ["V3","mkV3_"++p, w, "_V", p]
- 'V':'3':'_':'P':'P':prep ->
- let p = map toLower prep in ["V3","mkV3_"++p, w, p]
- 'V':'3':'_':'S':_ | r == "irreg" -> ["V2","mkV2_S", w, "_V"] ----
- 'V':'3':'_':'S':_ -> ["V2","mkV2_S", w] ----
- 'V':'3':'_':_ -> ["V3","mkV3", w] ----
-
- _ -> [c,"mk" ++ c, w]
-