summaryrefslogtreecommitdiff
path: root/src/runtime/haskell
diff options
context:
space:
mode:
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