Class: InsideSemiring
Instance Attribute Summary
Attributes inherited from Semiring
#add, #convert, #multiply, #null, #one
Instance Method Summary collapse
-
#initialize ⇒ InsideSemiring
constructor
A new instance of InsideSemiring.
Constructor Details
#initialize ⇒ InsideSemiring
Returns a new instance of InsideSemiring.
42 43 44 45 46 47 48 |
# File 'lib/zipf/semirings.rb', line 42 def initialize @add = Proc.new { |a,b| a+b } @multiply = Proc.new { |a,b| a*b } @one = 1.0 @null = 0.0 @convert = Proc.new { |v| v } end |