Portability | portable |
---|---|
Stability | experimental |
Maintainer | Uwe Schmidt (uwe@fh-wedel.de) |
Safe Haskell | None |
A variant of the Inverted.Memory index with an optimized prefix tree instead of a trie as central data structure. This version should be more space efficient as the trie and more runtime efficient when combining whole indexes.
For switching from Memory to this module, only the import has to be modified
- newtype Inverted = Inverted {
- indexParts :: Parts
- type Parts = Map Context Part
- type Part = PrefixTree CompressedOccurrences
- singleton :: Context -> String -> Occurrences -> Inverted
- emptyInverted :: Inverted
Inverted index types
The index consists of a table which maps documents to ids and a number of index parts.
type Parts = Map Context PartSource
The index parts are identified by a name, which should denote the context of the words.
type Part = PrefixTree CompressedOccurrencesSource
The index part is the real inverted index. Words are mapped to their occurrences.
Construction
singleton :: Context -> String -> Occurrences -> InvertedSource
Create an index with just one word in one context.
emptyInverted :: InvertedSource
Create an empty index.