Portability | portable |
---|---|
Stability | experimental |
Maintainer | Timo B. Huebel (tbh@holumbus.org) |
Safe Haskell | None |
Version : 0.3
The ranking mechanism for Holumbus.
Customized ranking functions for both documents and suggested words can be provided by the user. Some predefined ranking functions are avaliable, too.
- data RankConfig a = RankConfig {}
- type DocRanking a = DocId -> DocInfo a -> DocContextHits -> Score
- type WordRanking = Word -> WordInfo -> WordContextHits -> Score
- rank :: RankConfig a -> Result a -> Result a
- docRankByCount :: DocId -> DocInfo a -> DocContextHits -> Score
- docRankWeightedByCount :: [(Context, Score)] -> DocId -> DocInfo a -> DocContextHits -> Score
- wordRankByCount :: Word -> WordInfo -> WordContextHits -> Score
- wordRankWeightedByCount :: [(Context, Score)] -> Word -> WordInfo -> WordContextHits -> Score
Ranking types
data RankConfig a Source
The configuration of the ranking mechanism.
RankConfig | |
|
type DocRanking a = DocId -> DocInfo a -> DocContextHits -> ScoreSource
The signature of a function to determine the score of a document.
type WordRanking = Word -> WordInfo -> WordContextHits -> ScoreSource
The signature of a function to determine the score of a word.
Ranking
rank :: RankConfig a -> Result a -> Result aSource
Rank the result with custom ranking functions.
Predefined document rankings
docRankByCount :: DocId -> DocInfo a -> DocContextHits -> ScoreSource
Rank documents by count.
docRankWeightedByCount :: [(Context, Score)] -> DocId -> DocInfo a -> DocContextHits -> ScoreSource
Rank documents by context-weighted count. The weights will be normalized to a maximum of 1.0. Contexts with no weight (or a weight of zero) will be ignored.
Predefined word rankings
wordRankByCount :: Word -> WordInfo -> WordContextHits -> ScoreSource
Rank words by count.
wordRankWeightedByCount :: [(Context, Score)] -> Word -> WordInfo -> WordContextHits -> ScoreSource
Rank words by context-weighted count. The weights will be normalized to a maximum of 1.0. Contexts with no weight (or a weight of zero) will be ignored.