Class: ViterbiLogSemiring
Instance Attribute Summary
Attributes inherited from Semiring
#add, #convert, #multiply, #null, #one
Instance Method Summary collapse
-
#initialize ⇒ ViterbiLogSemiring
constructor
A new instance of ViterbiLogSemiring.
Constructor Details
#initialize ⇒ ViterbiLogSemiring
Returns a new instance of ViterbiLogSemiring.
32 33 34 35 36 37 38 |
# File 'lib/zipf/semirings.rb', line 32 def initialize @add = Proc.new { |a,b| [a,b].max } @multiply = Proc.new { |a,b| a+b } @one = 0.0 @null = -1.0/0.0 @convert = Proc.new { |v| v } end |