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

Lexicalized probabalistic parser.

This is an wrapper for the edu.stanford.nlp.parser.lexparser.LexicalizedParser object.

Methods

new   to_s  

Attributes

grammar  [R]  The grammar used by the parser

Public Class methods

Create the parser given a grammar and options. The grammar argument is a path to a grammar file. This path may contain the string $(ROOT), which will be replaced with the root directory of the Stanford Parser. By default, an English PCFG grammar is loaded.

The options argument is a list of string arguments as they would appear on a command line. See the documentaion of edu.stanford.nlp.parser.lexparser.Options.setOptions for more details.

[Source]

# File lib/stanfordparser.rb, line 138
    def initialize(grammar = ENGLISH_PCFG_MODEL, options = [])
      @grammar = Pathname.new(grammar.gsub(/\$\(ROOT\)/, ROOT))
      super("edu.stanford.nlp.parser.lexparser.LexicalizedParser", @grammar.to_s)
      @java_object.setOptionFlags(options)
    end

Public Instance methods

[Source]

# File lib/stanfordparser.rb, line 144
    def to_s
      "LexicalizedParser(#{grammar.basename})"
    end

[Validate]