Class StanfordParser::FeatureLabel
In: lib/stanfordparser.rb
Parent: Rjb::JavaObjectWrapper

This is a wrapper for edu.stanford.nlp.ling.FeatureLabel objects. It customizes stringification.

Methods

inspect   new   to_s  

Public Class methods

[Source]

# File lib/stanfordparser.rb, line 213
    def initialize(obj = "edu.stanford.nlp.ling.FeatureLabel")
      super
    end

Public Instance methods

More verbose stringification with all the fields and their values.

[Source]

# File lib/stanfordparser.rb, line 227
    def inspect
      toString
    end

Stringify with just the token and its begin and end position.

[Source]

# File lib/stanfordparser.rb, line 218
    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

[Validate]