Class: BooleanSemiring
Instance Attribute Summary
Attributes inherited from Semiring
#add, #convert, #multiply, #null, #one
Instance Method Summary collapse
-
#initialize ⇒ BooleanSemiring
constructor
A new instance of BooleanSemiring.
Constructor Details
#initialize ⇒ BooleanSemiring
Returns a new instance of BooleanSemiring.
12 13 14 15 16 17 18 |
# File 'lib/zipf/semirings.rb', line 12 def initialize @add = Proc.new { |a,b| a||b } @multiply = Proc.new { |a,b| a&&b } @one = true @null = false @convert = Proc.new { |v| true && v!=0 } end |