diff --git a/src/runtime/haskell/PGF.hs b/src/runtime/haskell/PGF.hs index e8cfbfb46..b8fd025be 100644 --- a/src/runtime/haskell/PGF.hs +++ b/src/runtime/haskell/PGF.hs @@ -107,7 +107,8 @@ module PGF( -- ** Morphological Analysis Lemma, Analysis, Morpho, - lookupMorpho, buildMorpho, fullFormLexicon, + lookupMorpho, buildMorpho, morphoMissing, morphoKnown, + fullFormLexicon, -- ** Visualizations graphvizAbstractTree, @@ -660,6 +661,16 @@ lookupMorpho :: Morpho -> String -> [(Lemma,Analysis)] lookupMorpho (Morpho cnc) s = [(CId fun,an) | (fun,an,_) <- PGF2.lookupMorpho cnc s] +morphoMissing :: Morpho -> [String] -> [String] +morphoMissing = morphoClassify False + +morphoKnown :: Morpho -> [String] -> [String] +morphoKnown = morphoClassify True + +morphoClassify :: Bool -> Morpho -> [String] -> [String] +morphoClassify k mo ws = [w | w <- ws, k /= null (lookupMorpho mo w), notLiteral w] where + notLiteral w = not (all isDigit w) ---- should be defined somewhere + fullFormLexicon :: Morpho -> [(String,[(Lemma,Analysis)])] fullFormLexicon (Morpho cnc) = [(w,[(CId fun,an) | (fun,an,_) <- ans]) | (w,ans) <- PGF2.fullFormLexicon cnc]