Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Qizx/open 4.1 API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.qizx.api.fulltext
Interface Thesaurus

    public interface Thesaurus

Access to a thesaurus.

Nested Class Summary
`static class` | `Thesaurus.LookupResult` Structure returned by Thesaurus lookup.
`static class` | `Thesaurus.Synonym` A synonym associated with an entry in a Thesaurus.
`static class` | `Thesaurus.TokenSequence` Sequence of tokens.

Method Summary
`Thesaurus.LookupResult` | `lookup(Thesaurus.TokenSequence tokens)` Looks up a thesaurus for a sequence of tokens.

Method Detail

### lookup

    Thesaurus.LookupResult lookup(Thesaurus.TokenSequence tokens)

  Looks up a thesaurus for a sequence of tokens. Returns a list of replacement words or word sequences, and the number of tokens consumed (all this gathered in LookupResult type).

  This method call can consume one or several input tokens, according to the thesaurus entry it recognizes. Therefore, the returned result also contains the number of consumed tokens. Replacement sequences may or may not contain the consumed sequence, this is left to the thesaurus implementation.

  For example, if the thesaurus contains equivalences "wealthy", "well-off" and "well-to-do", then looking up the sequence "well off man" would return a LookupResult where consumedTokens = 2 (length of "well off"), and containing the token sequences "wealthy", "well off" and "well to do". (Note that the TextTokenizer is assumed here to cut on hyphens).

  Parameters:
    `tokens` - sequence of source tokens. Each token is an array of characters rather than a string.
  Returns:
    a list of replacement sequences. If no replacement is found in the thesaurus, null must be returned.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| © 2010 Axyana Software
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD