NaturalLanguageAlphabets-0.2.1.0: Simple scoring schemes for word alignments

Safe HaskellNone
LanguageHaskell2010

NLP.Scoring.Unigram

Description

This module defines a simple scoring scheme based on pairs of unigrams.

Synopsis

Documentation

matchUnigram :: UnigramScoring k l -> IBS k -> IBS l -> Double Source #

Score IBSs x and y based on the simple scoring system: (i) lookup (x,y) and use the score if found; (ii) if (x,y) is not in the database, then return the default matching defaultMatch score if x==y, otherwise return the default mismatch defaultMismatch score. Note that even though IBS k and IBS l have different types, mismatches are checked using the underlying Int representation.

insertUnigramFstK :: UnigramScoring k l -> IBS k -> Double Source #

Provides a score for the unigram characters in an in/del environment. In case the character x in the pairing x == - is found in the unigramInsert database, that score is used, otherwise the gapLinear score is used.

insertUnigramSndL :: UnigramScoring k l -> IBS l -> Double Source #

Analog to insertUnigramSndL, but works on the IBS l with phantom type l.

data UnigramScoring k l Source #

Collect the hashtable and scalar values for simple scoring.

TODO binary and cereal instances

Constructors

UnigramScoring 

Fields

Instances
Eq (UnigramScoring k2 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram

Methods

(==) :: UnigramScoring k2 l -> UnigramScoring k2 l -> Bool #

(/=) :: UnigramScoring k2 l -> UnigramScoring k2 l -> Bool #

Read (UnigramScoring k2 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram

Show (UnigramScoring k2 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram

Generic (UnigramScoring k2 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram

Associated Types

type Rep (UnigramScoring k2 l) :: Type -> Type #

Methods

from :: UnigramScoring k2 l -> Rep (UnigramScoring k2 l) x #

to :: Rep (UnigramScoring k2 l) x -> UnigramScoring k2 l #

Hashable (UnigramScoring k3 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram

Methods

hashWithSalt :: Int -> UnigramScoring k3 l -> Int #

hash :: UnigramScoring k3 l -> Int #

ToJSON (UnigramScoring k3 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram

FromJSON (UnigramScoring k3 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram

type Rep (UnigramScoring k2 l) Source # 
Instance details

Defined in NLP.Scoring.Unigram