Class: StanfordParser::FeatureLabel
- Inherits:
-
Rjb::JavaObjectWrapper
- Object
- Rjb::JavaObjectWrapper
- StanfordParser::FeatureLabel
- Defined in:
- lib/stanfordparser.rb
Overview
This is a wrapper for edu.stanford.nlp.ling.FeatureLabel
objects. It customizes stringification.
Instance Attribute Summary
Attributes inherited from Rjb::JavaObjectWrapper
Instance Method Summary collapse
-
#initialize(obj = "edu.stanford.nlp.ling.FeatureLabel") ⇒ FeatureLabel
constructor
A new instance of FeatureLabel.
-
#inspect ⇒ Object
More verbose stringification with all the fields and their values.
-
#to_s ⇒ Object
Stringify with just the token and its begin and end position.
Methods inherited from Rjb::JavaObjectWrapper
Constructor Details
#initialize(obj = "edu.stanford.nlp.ling.FeatureLabel") ⇒ FeatureLabel
Returns a new instance of FeatureLabel.
196 197 198 |
# File 'lib/stanfordparser.rb', line 196 def initialize(obj = "edu.stanford.nlp.ling.FeatureLabel") super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rjb::JavaObjectWrapper
Instance Method Details
#inspect ⇒ Object
More verbose stringification with all the fields and their values.
210 211 212 |
# File 'lib/stanfordparser.rb', line 210 def inspect toString end |
#to_s ⇒ Object
Stringify with just the token and its begin and end position.
201 202 203 204 205 206 207 |
# File 'lib/stanfordparser.rb', line 201 def to_s # BUGBUG The position values come back as java.lang.Integer though I # would expect Rjb to convert them to Ruby integers. begin_position = get(self.BEGIN_POSITION_KEY) end_position = get(self.END_POSITION_KEY) "#{current} [#{begin_position},#{end_position}]" end |