| 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.
| grammar | [R] | The grammar used by the parser |
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.
# 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