Copyright | Copyright (C) 2007, 2008 Timo B. Huebel |
---|---|
License | MIT |
Maintainer | Timo B. Huebel (tbh@holumbus.org) |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Version : 0.2
The unique Holumbus mechanism for generating fuzzy sets.
- type FuzzySet = Map Text FuzzyScore
- type Replacements = [Replacement]
- type Replacement = ((Text, Text), FuzzyScore)
- type FuzzyScore = Float
- data FuzzyConfig = FuzzyConfig {}
- englishReplacements :: Replacements
- germanReplacements :: Replacements
- fuzz :: FuzzyConfig -> Text -> FuzzySet
- toList :: FuzzySet -> [(Text, FuzzyScore)]
Fuzzy types
type FuzzySet = Map Text FuzzyScore Source
A set of string which have been "fuzzed" with an associated score.
type Replacements = [Replacement] Source
Some replacements which can be applied to a string to generate a FuzzySet
. The scores of
the replacements will be normalized to a maximum of 1.0.
type Replacement = ((Text, Text), FuzzyScore) Source
A single replacements, where the first will be replaced by the second and vice versa in the target string. The score indicates the amount of fuzzines that one single application of this replacement in just one direction will cause on the target string.
type FuzzyScore = Float Source
The score indicating an amount of fuzziness.
data FuzzyConfig Source
The configuration of a fuzzy query.
FuzzyConfig | |
|
Predefined replacements
englishReplacements :: Replacements Source
Some default replacements for the english language.
germanReplacements :: Replacements Source
Some default replacements for the german language.
Generation
fuzz :: FuzzyConfig -> Text -> FuzzySet Source
Continue fuzzing a string with the an explicitly specified list of replacements until a given score threshold is reached.
Conversion
toList :: FuzzySet -> [(Text, FuzzyScore)] Source
Transform a fuzzy set into a list (ordered by score).