Portability | portable |
---|---|
Stability | experimental |
Maintainer | Timo B. Huebel (tbh@holumbus.org) |
Safe Haskell | None |
The data type for results of Holumbus queries.
The result of a query is defined in terms of two partial results, the documents containing the search terms and the words which are possible completions of the serach terms.
- data Result a = Result {}
- type DocHits a = DocIdMap (DocInfo a, DocContextHits)
- type DocContextHits = Map Context DocWordHits
- type DocWordHits = Map Word Positions
- type WordHits = Map Word (WordInfo, WordContextHits)
- type WordContextHits = Map Context WordDocHits
- type WordDocHits = Occurrences
- data DocInfo a = DocInfo {}
- data WordInfo = WordInfo {}
- type Score = Float
- emptyResult :: Result a
- null :: Result a -> Bool
- sizeDocHits :: Result a -> Int
- sizeWordHits :: Result a -> Int
- maxScoreDocHits :: Result a -> Score
- maxScoreWordHits :: Result a -> Score
- getDocuments :: Result a -> [Document a]
- setDocScore :: Score -> DocInfo a -> DocInfo a
- setWordScore :: Score -> WordInfo -> WordInfo
- xpDocHits :: XmlPickler a => PU (DocHits a)
- xpWordHits :: PU WordHits
Result data types
The combined result type for Holumbus queries.
type DocHits a = DocIdMap (DocInfo a, DocContextHits)Source
A mapping from a document to it's score and the contexts where it was found.
type DocContextHits = Map Context DocWordHitsSource
A mapping from a context to the words of the document that were found in this context.
type DocWordHits = Map Word PositionsSource
A mapping from a word of the document in a specific context to it's positions.
type WordHits = Map Word (WordInfo, WordContextHits)Source
A mapping from a word to it's score and the contexts where it was found.
type WordContextHits = Map Context WordDocHitsSource
A mapping from a context to the documents that contain the word that were found in this context.
type WordDocHits = OccurrencesSource
A mapping from a document containing the word to the positions of the word.
Information about an document.
Information about a word.
Construction
emptyResult :: Result aSource
Create an empty result.
Query
sizeDocHits :: Result a -> IntSource
Query the number of documents in a result.
sizeWordHits :: Result a -> IntSource
Query the number of documents in a result.
maxScoreDocHits :: Result a -> ScoreSource
Query the maximum score of the documents.
maxScoreWordHits :: Result a -> ScoreSource
Query the maximum score of the words.
getDocuments :: Result a -> [Document a]Source
Extract all documents from a result
Transform
setDocScore :: Score -> DocInfo a -> DocInfo aSource
Set the score in a document info.
setWordScore :: Score -> WordInfo -> WordInfoSource
Set the score in a word info.
Picklers
xpDocHits :: XmlPickler a => PU (DocHits a)Source
The XML pickler for the document hits. Will be sorted by score.
xpWordHits :: PU WordHitsSource
The XML pickler for the word hits. Will be sorted alphabetically by the words.