Module wfst::semiring [] [src]

This module defines the Weight and other traits which specifies a semiring and other properties. See the source files main_semiring.rs and test_semiring.rs for simple examples of intended use.

See Mehryar Mohri, "Semiring Framework and Algorithms for Shortest-Distance Problems", Journal of Automata, Languages and Combinatorics 7(3):321-350, 2002.

Modules

floatweight

This module implements some Weight types based on floating point numbers. See the source files main_semiring.rs and test_semiring.rs for simple examples of intended use.

test

This module implements the generation of random weights for testing purposes. See the source file test_semiring.rs for simple examples of intended use.

Enums

DivideType

Traits

Commutative

∀ a,b: a ⊗ b = b ⊗ a

Idempotent

∀ a: a ⊕ a = a

LeftSemiring

∀ a,b,c: c ⊗ (a ⊕ b) = (c ⊗ a) ⊕ (c ⊗ b)

NaturalLess
Path

∀ a,b: a ⊕ b = a ∨ a ⊕ b = b

RightSemiring

∀ a,b,c: (a ⊕ b) ⊗ c = (a ⊗ c) ⊕ (b ⊗ c)

Semiring

Both LeftSemiring and RightSemiring apply

Weight

Functions

power

Power is the iterated product for arbitrary semirings such that Power(w, 0) is One() for the semiring, and Power(w, n) = Times(Power(w, n-1), w)