From 249d506f58a8b5f8ef87295ab3dde2d13ddd3885 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 10 Nov 2003 07:55:45 +0000 Subject: Morphological analysis and glueing. --- src/GF/Canon/CMacros.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/GF/Canon/CMacros.hs') diff --git a/src/GF/Canon/CMacros.hs b/src/GF/Canon/CMacros.hs index 17433e48b..d32f639b4 100644 --- a/src/GF/Canon/CMacros.hs +++ b/src/GF/Canon/CMacros.hs @@ -152,3 +152,15 @@ redirectIdent n f@(CIQ _ c) = CIQ n c ciq n f = CIQ n f +wordsInTerm :: Term -> [String] +wordsInTerm trm = filter (not . null) $ case trm of + K (KS s) -> [s] + S c _ -> wo c + R rs -> concat [wo t | Ass _ t <- rs] + T _ cs -> concat [wo t | Cas _ t <- cs] + C s t -> wo s ++ wo t + FV ts -> concatMap wo ts + K (KP ss vs) -> ss ++ concat [s ++ t | Var s t <- vs] + P t _ -> wo t --- not needed ? + _ -> [] + where wo = wordsInTerm -- cgit v1.2.3