Class: OpenNlp::NamedEntityDetector
- Defined in:
- lib/open_nlp/named_entity_detector.rb
Instance Attribute Summary
Attributes inherited from Tool
Instance Method Summary collapse
-
#detect(tokens) ⇒ Array<Java::opennlp.tools.util.Span>
Detects names for provided array of tokens.
Methods inherited from Tool
Methods included from JavaClass
Constructor Details
This class inherits a constructor from OpenNlp::Tool
Instance Method Details
#detect(tokens) ⇒ Array<Java::opennlp.tools.util.Span>
Detects names for provided array of tokens
9 10 11 12 |
# File 'lib/open_nlp/named_entity_detector.rb', line 9 def detect(tokens) fail ArgumentError, 'tokens must be an instance of Array' unless tokens.is_a?(Array) j_instance.find(tokens.to_java(:String)).to_ary end |