Safe Haskell | None |
---|---|
Language | Haskell2010 |
Basic types for dictionary handling.
Synopsis
- type NeType = Text
- type Form = Text
- isMultiWord :: Form -> Bool
- data Entry = Entry {}
- type Label = Text
- type DAWG = DAWG Trans Char ()
- type Dict = DAWG (Set Label)
- fromPairs :: [(Form, Label)] -> Dict
- fromEntries :: [Entry] -> Dict
- siftDict :: (Form -> Set Label -> Bool) -> Dict -> Dict
- saveDict :: FilePath -> Dict -> IO ()
- loadDict :: FilePath -> IO Dict
- merge :: [Dict] -> Dict
- diff :: [Dict] -> [Dict]
Lexicon entry
isMultiWord :: Form -> Bool Source #
Is the form a multiword one?
A Named Entity entry from the LMF dictionary.
Dictionary
type DAWG = DAWG Trans Char () Source #
A Dict
is a map from forms to labels. Each form may be annotated
with multiple labels. The map is represented using the directed acyclic
word graph.
type Dict = D.DAWG (S.Set Label)
fromPairs :: [(Form, Label)] -> Dict Source #
Construct dictionary from the list of form/label pairs.
fromEntries :: [Entry] -> Dict Source #
Construct dictionary from the list of entries.
siftDict :: (Form -> Set Label -> Bool) -> Dict -> Dict Source #
Remove dictionary entries which do not satisfy the predicate.