semiring-0.2: Semirings, ring-like structures used for dynamic programming applicationsSource codeContentsIndex
NLP.Semiring
Contents
Semiring
Synopsis
Multiplicative (one, times)
Monoid (mempty, mappend, mconcat)
class (Multiplicative a, Monoid a) => Semiring a
class (Semiring a, Ord a) => WeightedSemiring a
newtype Weighted semi1 semi2 = Weighted (semi1, semi2)
getWeight
getInfo
Semiring

Semirings (rings without additive inverses, http://en.wikipedia.org/wiki/Semiring) are a commonly used structure for performing computations over finite state machines, parsers, and other dynamic programmy-systems. This library extends the basic structures defined for Monoids to Semirings and includes implementations of the major semirings for parsing.

This work is based largely on Semiring Parsing by Joshua Goodman. (http://www.ldc.upenn.edu/acl/J/J99/J99-4004.pdf) which describes many of the interesting parsing semirings.

Multiplicative (one, times)
Monoid (mempty, mappend, mconcat)
class (Multiplicative a, Monoid a) => Semiring a Source
A Semiring is made up of an additive Monoid and a Multiplicative. It must also satisfy several other algebraic properties checked by quickcheck.
show/hide Instances
class (Semiring a, Ord a) => WeightedSemiring a Source
A WeightedSemiring also includes a sensical ordering over choices. i.e. out of two choices which is better. This is used for Viterbi selection.
show/hide Instances
newtype Weighted semi1 semi2 Source

The Weighted type is the main type of WeightedSemiring. It combines scoring semiring with a history semiring.

The best example of this is the ViterbiDerivation semiring.

Constructors
Weighted (semi1, semi2)
show/hide Instances
(Eq semi1, Eq semi2) => Eq (Weighted semi1 semi2)
(Ord semi1, Eq semi2) => Ord (Weighted semi1 semi2)
(Show semi1, Show semi2) => Show (Weighted semi1 semi2)
(Monoid semi1, Monoid semi2) => Monoid (Weighted semi1 semi2)
(Multiplicative semi1, Multiplicative semi2) => Multiplicative (Weighted semi1 semi2)
(WeightedSemiring a, Eq b, Semiring b) => WeightedSemiring (Weighted a b)
(Semiring semi1, Semiring semi2) => Semiring (Weighted semi1 semi2)
getWeight
getInfo
Produced by Haddock version 2.4.2