Class: StanfordParser::DocumentPreprocessor
- Inherits:
-
Rjb::JavaObjectWrapper
- Object
- Rjb::JavaObjectWrapper
- StanfordParser::DocumentPreprocessor
- Defined in:
- lib/stanfordparser.rb
Overview
Tokenizes documents into words and sentences.
This is a wrapper for the edu.stanford.nlp.process.DocumentPreprocessor
object.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Rjb::JavaObjectWrapper
Instance Method Summary collapse
-
#getSentencesFromString(s) ⇒ Object
Returns a list of sentences in a string.
-
#initialize(suppressEscaping = false) ⇒ DocumentPreprocessor
constructor
A new instance of DocumentPreprocessor.
- #inspect ⇒ Object
- #to_s ⇒ Object
Methods inherited from Rjb::JavaObjectWrapper
Constructor Details
#initialize(suppressEscaping = false) ⇒ DocumentPreprocessor
Returns a new instance of DocumentPreprocessor.
221 222 223 |
# File 'lib/stanfordparser.rb', line 221 def initialize(suppressEscaping = false) super("edu.stanford.nlp.process.DocumentPreprocessor", suppressEscaping) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rjb::JavaObjectWrapper
Instance Method Details
#getSentencesFromString(s) ⇒ Object
Returns a list of sentences in a string.
226 227 228 229 |
# File 'lib/stanfordparser.rb', line 226 def getSentencesFromString(s) s = Rjb::JavaObjectWrapper.new("java.io.StringReader", s) _invoke(:getSentencesFromText, "Ljava.io.Reader;", s.java_object) end |
#inspect ⇒ Object
231 232 233 |
# File 'lib/stanfordparser.rb', line 231 def inspect "<#{self.class.to_s.split('::').last}>" end |
#to_s ⇒ Object
235 236 237 |
# File 'lib/stanfordparser.rb', line 235 def to_s inspect end |