adict-0.2.0: Approximate dictionary searching

Safe HaskellNone

NLP.Adict.CostDiv

Synopsis

Documentation

data Group a Source

TODO: Add Choice data contructor together with appropriate implementation: Choice Char Weight

Constructors

Filter 

Fields

predic :: a -> Bool
 
weight :: Weight
 

data CostDiv a Source

Cost function with edit operations divided with respect to weight. Two operations with the same cost should be assigned to the same group.

Constructors

CostDiv 

Fields

insert :: [Group a]
 
delete :: a -> Weight
 
subst :: a -> [Group a]
 
posMod :: Pos -> Weight
 

type Sub a = Map Weight (Set a)Source

Substition desription for some character x.

mkSub :: Ord a => [(a, Weight)] -> Sub aSource

unSub :: Ord a => Sub a -> [Group a]Source

type SubMap a = Map a (Sub a)Source

Susbtitution map for an alphabet.

subOn :: Ord a => a -> SubMap a -> Sub aSource

mkSubMap :: Ord a => [(a, a, Weight)] -> SubMap aSource

toCost :: Double -> CostDiv a -> Cost aSource

Transform CostDiv to plain Cost function with default weight value.

toCostInf :: CostDiv a -> Cost aSource

Transform CostDiv to plain Cost function with default weight value set to +Infinity.