SnowballProgram (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.stemmer.snowball, class: SnowballProgram

Package opennlp.tools.stemmer.snowball

# Class SnowballProgram

java.lang.Object
opennlp.tools.stemmer.snowball.SnowballProgram

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `arabicStemmer`, `catalanStemmer`, `danishStemmer`, `dutchStemmer`, `englishStemmer`, `finnishStemmer`, `frenchStemmer`, `germanStemmer`, `greekStemmer`, `hungarianStemmer`, `indonesianStemmer`, `irishStemmer`, `italianStemmer`, `norwegianStemmer`, `porterStemmer`, `portugueseStemmer`, `romanianStemmer`, `russianStemmer`, `spanishStemmer`, `swedishStemmer`, `turkishStemmer`

public class SnowballProgram extends Object implements Serializable
Base class for a snowball stemmer

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SnowballProgram(SnowballProgram other)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getCurrent()`
  Get the current string.
  `char[]`
  `getCurrentBuffer()`
  Get the current buffer containing the stem.
  `int`
  `getCurrentBufferLength()`
  Get the valid length of the character array in `getCurrentBuffer()`.
  `void`
  `setCurrent(char[] text, int length)`
  Set the current string.
  `void`
  `setCurrent(String value)`
  Set the current string.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SnowballProgram

    public SnowballProgram(SnowballProgram other)

- ## Method Details

  - ### setCurrent

    public void setCurrent(String value)
    Set the current string.

  - ### getCurrent

    public String getCurrent()
    Get the current string.

  - ### setCurrent

    public void setCurrent(char[] text, int length)
    Set the current string.
    Parameters:
      `text` - character array containing input
      `length` - valid length of text.

  - ### getCurrentBuffer

    public char[] getCurrentBuffer()
    Get the current buffer containing the stem.

    NOTE: this may be a reference to a different character array than the one originally provided with setCurrent, in the exceptional case that stemming produced a longer intermediate or result string.

    It is necessary to use `getCurrentBufferLength()` to determine the valid length of the returned buffer. For example, many words are stemmed simply by subtracting from the length to remove suffixes.

    See Also:
      - `getCurrentBufferLength()`

  - ### getCurrentBufferLength

    public int getCurrentBufferLength()
    Get the valid length of the character array in `getCurrentBuffer()`.
    Returns:
      valid length of the array.