hunt-searchengine-0.3.0.1: A search and indexing engine.

CopyrightCopyright (C) 2007, 2008 Timo B. Huebel
LicenseMIT
MaintainerTimo B. Huebel (tbh@holumbus.org)
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Hunt.Query.Fuzzy

Contents

Description

Version : 0.2

The unique Holumbus mechanism for generating fuzzy sets.

Synopsis

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.

Constructors

FuzzyConfig 

Fields

applyReplacements :: Bool

Indicates whether the replacements should be applied.

applySwappings :: Bool

Indicates whether the swapping of adjacent characters should be applied.

maxFuzziness :: FuzzyScore

The maximum allowed fuzziness.

customReplacements :: Replacements

The replacements that should be applied.

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).