| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
NLP.Scoring.Unigram
Description
This module defines a simple scoring scheme based on pairs of unigrams.
Synopsis
- matchUnigram :: UnigramScoring k l -> IBS k -> IBS l -> Double
- insertUnigramFstK :: UnigramScoring k l -> IBS k -> Double
- insertUnigramSndL :: UnigramScoring k l -> IBS l -> Double
- data UnigramScoring k l = UnigramScoring {
- usUnigramMatch :: !(HashMap (IBS k, IBS l) Double)
- usUnigramInsertFstK :: !(HashMap (IBS k) Double)
- usUnigramInsertSndL :: !(HashMap (IBS l) Double)
- usGapLinear :: !Double
- usGapOpen :: !Double
- usGapExtension :: !Double
- usDefaultMatch :: !Double
- usDefaultMismatch :: !Double
- usPrefixSuffixLinear :: !Double
- usPrefixSuffixOpen :: !Double
- usPrefixSuffixExtension :: !Double
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
| |