Sha256: b2e786dd625dab1e1a5b80d85f75483401edaf4422bc453665e52e227f276a31
Contents?: true
Size: 740 Bytes
Versions: 2
Compression:
Stored size: 740 Bytes
Contents
class OpenNlp::Util::Span include OpenNlp::JavaClass self.java_class = Java::opennlp.tools.util.Span attr_reader :j_instance def initialize(s, e) fail ArgumentError, 's should be an integer' unless s.is_a?(Fixnum) fail ArgumentError, 'e should be an integer' unless e.is_a?(Fixnum) @j_instance = self.class.java_class.new(s, e) end def start j_instance.getStart end def end j_instance.getEnd end def type j_instance.getType end def length j_instance.length end def ==(obj) return false unless obj.is_a?(self.class) [:start, :end, :type].each_with_object(true) do |method, acc| acc = acc && self.public_send(method) == obj.public_send(method) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
open_nlp-0.2.0-java | lib/open_nlp/util/span.rb |
open_nlp-0.1.0-java | lib/open_nlp/util/span.rb |