opennlp.tools.chunker
Interface Chunker

All Known Implementing Classes:
ChunkerME

public interface Chunker

The interface for chunkers which provide chunk tags for a sequence of tokens.


Method Summary
 java.util.List<java.lang.String> chunk(java.util.List<java.lang.String> toks, java.util.List<java.lang.String> tags)
          Deprecated. please use chunk(String[], String[]) instead.
 java.lang.String[] chunk(java.lang.String[] toks, java.lang.String[] tags)
          Generates chunk tags for the given sequence returning the result in an array.
 Span[] chunkAsSpans(java.lang.String[] toks, java.lang.String[] tags)
          Generates tagged chunk spans for the given sequence returning the result in a span array.
 Sequence[] topKSequences(java.util.List<java.lang.String> sentence, java.util.List<java.lang.String> tags)
          Deprecated. please use topKSequences(String[], String[]) instead.
 Sequence[] topKSequences(java.lang.String[] sentence, java.lang.String[] tags)
          Returns the top k chunk sequences for the specified sentence with the specified pos-tags
 Sequence[] topKSequences(java.lang.String[] sentence, java.lang.String[] tags, double minSequenceScore)
          Returns the top k chunk sequences for the specified sentence with the specified pos-tags
 

Method Detail

chunk

@Deprecated
java.util.List<java.lang.String> chunk(java.util.List<java.lang.String> toks,
                                                  java.util.List<java.lang.String> tags)
Deprecated. please use chunk(String[], String[]) instead.

Generates chunk tags for the given sequence returning the result in a list.

Parameters:
toks - a list of the tokens or words of the sequence.
tags - a list of the pos tags of the sequence.
Returns:
a list of chunk tags for each token in the sequence.

chunk

java.lang.String[] chunk(java.lang.String[] toks,
                         java.lang.String[] tags)
Generates chunk tags for the given sequence returning the result in an array.

Parameters:
toks - an array of the tokens or words of the sequence.
tags - an array of the pos tags of the sequence.
Returns:
an array of chunk tags for each token in the sequence.

chunkAsSpans

Span[] chunkAsSpans(java.lang.String[] toks,
                    java.lang.String[] tags)
Generates tagged chunk spans for the given sequence returning the result in a span array.

Parameters:
toks - an array of the tokens or words of the sequence.
tags - an array of the pos tags of the sequence.
Returns:
an array of spans with chunk tags for each chunk in the sequence.

topKSequences

@Deprecated
Sequence[] topKSequences(java.util.List<java.lang.String> sentence,
                                    java.util.List<java.lang.String> tags)
Deprecated. please use topKSequences(String[], String[]) instead.

Returns the top k chunk sequences for the specified sentence with the specified pos-tags

Parameters:
sentence - The tokens of the sentence.
tags - The pos-tags for the specified sentence.
Returns:
the top k chunk sequences for the specified sentence.

topKSequences

Sequence[] topKSequences(java.lang.String[] sentence,
                         java.lang.String[] tags)
Returns the top k chunk sequences for the specified sentence with the specified pos-tags

Parameters:
sentence - The tokens of the sentence.
tags - The pos-tags for the specified sentence.
Returns:
the top k chunk sequences for the specified sentence.

topKSequences

Sequence[] topKSequences(java.lang.String[] sentence,
                         java.lang.String[] tags,
                         double minSequenceScore)
Returns the top k chunk sequences for the specified sentence with the specified pos-tags

Parameters:
sentence - The tokens of the sentence.
tags - The pos-tags for the specified sentence.
minSequenceScore - A lower bound on the score of a returned sequence.
Returns:
the top k chunk sequences for the specified sentence.


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