Class: ViterbiSemiring
Instance Attribute Summary
Attributes inherited from Semiring
#add, #convert, #multiply, #null, #one
Instance Method Summary collapse
-
#initialize ⇒ ViterbiSemiring
constructor
A new instance of ViterbiSemiring.
Constructor Details
#initialize ⇒ ViterbiSemiring
Returns a new instance of ViterbiSemiring.
22 23 24 25 26 27 28 |
# File 'lib/zipf/semirings.rb', line 22 def initialize @add = Proc.new { |a,b| [a,b].max } @multiply = Proc.new { |a,b| a*b } @one = 1.0 @null = 0.0 @convert = Proc.new { |v| v } end |