Class: StanfordParser::Word

Inherits:
Rjb::JavaObjectWrapper show all
Defined in:
lib/stanfordparser.rb

Overview

This is a wrapper for edu.stanford.nlp.ling.Word objects. It customizes stringification and adds an equivalence operator.

Instance Attribute Summary

Attributes inherited from Rjb::JavaObjectWrapper

#java_object

Instance Method Summary collapse

Methods inherited from Rjb::JavaObjectWrapper

#each, #method_missing, #to_s

Constructor Details

#initialize(obj = "edu.stanford.nlp.ling.Word", *args) ⇒ Word

Returns a new instance of Word.



194
195
196
# File 'lib/stanfordparser.rb', line 194

def initialize(obj = "edu.stanford.nlp.ling.Word", *args)
  super(obj, *args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rjb::JavaObjectWrapper

Instance Method Details

#==(other) ⇒ Object

Equivalence is defined relative to the word value.



204
205
206
# File 'lib/stanfordparser.rb', line 204

def ==(other)
  word == other
end

#inspectObject

See the word values.



199
200
201
# File 'lib/stanfordparser.rb', line 199

def inspect
  to_s
end