summaryrefslogtreecommitdiff
path: root/src/runtime/haskell
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2011-02-06 16:19:24 +0000
committeraarne <aarne@chalmers.se>2011-02-06 16:19:24 +0000
commit7445e5638713276b471a0c8d5a53940704e8239d (patch)
tree2797d77952099e99da827824afdbf2c72b59b7b7 /src/runtime/haskell
parent878fefc6f5d2c706faafb218a99432e896109d1f (diff)
a simple clitic analysis command 'ca'
Diffstat (limited to 'src/runtime/haskell')
-rw-r--r--src/runtime/haskell/PGF/Morphology.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime/haskell/PGF/Morphology.hs b/src/runtime/haskell/PGF/Morphology.hs
index d5a2d28bc..70fa70458 100644
--- a/src/runtime/haskell/PGF/Morphology.hs
+++ b/src/runtime/haskell/PGF/Morphology.hs
@@ -1,5 +1,5 @@
module PGF.Morphology(Lemma,Analysis,Morpho,
- buildMorpho,
+ buildMorpho,isInMorpho,
lookupMorpho,fullFormLexicon,
morphoMissing,missingWordMsg) where
@@ -42,6 +42,9 @@ collectWords pinfo = Map.fromListWith (++)
lookupMorpho :: Morpho -> String -> [(Lemma,Analysis)]
lookupMorpho (Morpho mo) s = maybe [] id $ Map.lookup s mo
+isInMorpho :: Morpho -> String -> Bool
+isInMorpho (Morpho mo) s = maybe False (const True) $ Map.lookup s mo
+
fullFormLexicon :: Morpho -> [(String,[(Lemma,Analysis)])]
fullFormLexicon (Morpho mo) = Map.toList mo