opennlp.tools.namefind
Class RegexNameFinder

java.lang.Object
  extended by opennlp.tools.namefind.RegexNameFinder
All Implemented Interfaces:
TokenNameFinder

public final class RegexNameFinder
extends Object
implements TokenNameFinder

Name finder based on a series of regular expressions.


Constructor Summary
RegexNameFinder(Pattern[] patterns)
           
RegexNameFinder(Pattern[] patterns, String type)
           
 
Method Summary
 void clearAdaptiveData()
          Forgets all adaptive data which was collected during previous calls to one of the find methods.
 Span[] find(String[] tokens)
          Generates name tags for the given sequence, typically a sentence, returning token spans for any identified names.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexNameFinder

public RegexNameFinder(Pattern[] patterns,
                       String type)

RegexNameFinder

public RegexNameFinder(Pattern[] patterns)
Method Detail

find

public Span[] find(String[] tokens)
Description copied from interface: TokenNameFinder
Generates name tags for the given sequence, typically a sentence, returning token spans for any identified names.

Specified by:
find in interface TokenNameFinder
Parameters:
tokens - an array of the tokens or words of the sequence, typically a sentence.
Returns:
an array of spans for each of the names identified.

clearAdaptiveData

public void clearAdaptiveData()
Description copied from interface: TokenNameFinder
Forgets all adaptive data which was collected during previous calls to one of the find methods. This method is typical called at the end of a document.

Specified by:
clearAdaptiveData in interface TokenNameFinder


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.