example based also with treebank, with real term parser

This commit is contained in:
aarne
2006-03-04 22:14:33 +00:00
parent 84e01c303d
commit 2657c51e04
7 changed files with 95 additions and 102 deletions

View File

@@ -25,6 +25,7 @@ module GF.UseGrammar.Treebank (
readMultiTreebank,
lookupTreebank,
assocsTreebank,
isWordInTreebank,
printAssoc
) where
@@ -45,6 +46,7 @@ import GF.Infra.Ident (Ident)
import GF.Infra.UseIO
import qualified GF.Grammar.Abstract as A
import qualified Data.Map as M
import qualified Data.Set as S
-- Generate a treebank with a multilingual grammar. AR 8/2/2006
-- (c) Aarne Ranta 2006 under GNU GPL
@@ -142,6 +144,9 @@ ret = [] -- return ()
assocsTreebank :: UniTreebank -> [(String,[String])]
assocsTreebank = M.assocs
isWordInTreebank :: UniTreebank -> String -> Bool
isWordInTreebank tb w = S.member w (S.fromList (concatMap words (M.keys tb)))
printAssoc (s, ts) = s ++ concat ["\t" ++ t | t <- ts]
getTreebanks :: [String] -> [(String,String,String)]