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

This is a wrapper for edu.stanford.nlp.trees.Tree objects. It customizes stringification.

Methods

inspect   new   to_s  

Public Class methods

[Source]

# File lib/stanfordparser.rb, line 161
    def initialize(obj = "edu.stanford.nlp.trees.Tree")
      super(obj)
    end

Public Instance methods

Return the label along with the score if there is one.

[Source]

# File lib/stanfordparser.rb, line 166
    def inspect
      s = "#{label}" + (score.nan? ? "" : " [#{sprintf '%.2f', score}]")
      "(#{s})"
    end

The Penn treebank representation. This prints with indenting instead of putting everything on one line.

[Source]

# File lib/stanfordparser.rb, line 173
    def to_s
      "#{pennString}"
    end

[Validate]