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.



177
178
179
# File 'lib/stanfordparser.rb', line 177

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.



187
188
189
# File 'lib/stanfordparser.rb', line 187

def ==(other)
  word == other
end

#inspectObject

See the word values.



182
183
184
# File 'lib/stanfordparser.rb', line 182

def inspect
  to_s
end