SnowballProgram (Lucene 10.5.0 common API)
Description: declaration: package: org.tartarus.snowball, class: SnowballProgram

Package org.tartarus.snowball

# Class SnowballProgram

java.lang.Object
org.tartarus.snowball.SnowballProgram

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `SnowballStemmer`

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

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `bra`
  `protected int`
  `cursor`
  `protected int`
  `ket`
  `protected int`
  `length`
  `protected int`
  `limit`
  `protected int`
  `limit_backward`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `SnowballProgram()`
  ``
  `SnowballProgram(SnowballProgram other)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `assign_to(StringBuilder s)`
  `protected void`
  `copy_from(SnowballProgram other)`
  `protected boolean`
  `eq_s(CharSequence s)`
  `protected boolean`
  `eq_s_b(CharSequence s)`
  `protected int`
  `find_among(Among[] v)`
  `protected int`
  `find_among_b(Among[] v)`
  `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()`.
  `protected boolean`
  `in_grouping(char[] s, int min, int max)`
  `protected boolean`
  `in_grouping_b(char[] s, int min, int max)`
  `protected void`
  `insert(int c_bra, int c_ket, CharSequence s)`
  `protected boolean`
  `out_grouping(char[] s, int min, int max)`
  `protected boolean`
  `out_grouping_b(char[] s, int min, int max)`
  `protected int`
  `replace_s(int c_bra, int c_ket, CharSequence s)`
  `void`
  `setCurrent(char[] text, int length)`
  Set the current string.
  `void`
  `setCurrent(String value)`
  Set the current string.
  `protected void`
  `slice_check()`
  `protected void`
  `slice_del()`
  `protected void`
  `slice_from(CharSequence s)`
  `protected void`
  `slice_to(StringBuilder s)`

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

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

- ## Field Details

  - ### cursor

    protected int cursor

  - ### length

    protected int length

  - ### limit

    protected int limit

  - ### limit_backward

    protected int limit_backward

  - ### bra

    protected int bra

  - ### ket

    protected int ket

- ## Constructor Details

  - ### SnowballProgram

    protected SnowballProgram()

  - ### 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.

  - ### copy_from

    protected void copy_from(SnowballProgram other)

  - ### in_grouping

    protected boolean in_grouping(char[] s, int min, int max)

  - ### in_grouping_b

    protected boolean in_grouping_b(char[] s, int min, int max)

  - ### out_grouping

    protected boolean out_grouping(char[] s, int min, int max)

  - ### out_grouping_b

    protected boolean out_grouping_b(char[] s, int min, int max)

  - ### eq_s

    protected boolean eq_s(CharSequence s)

  - ### eq_s_b

    protected boolean eq_s_b(CharSequence s)

  - ### find_among

    protected int find_among(Among[] v)

  - ### find_among_b

    protected int find_among_b(Among[] v)

  - ### replace_s

    protected int replace_s(int c_bra, int c_ket, CharSequence s)

  - ### slice_check

    protected void slice_check()

  - ### slice_from

    protected void slice_from(CharSequence s)

  - ### slice_del

    protected void slice_del()

  - ### insert

    protected void insert(int c_bra, int c_ket, CharSequence s)

  - ### slice_to

    protected void slice_to(StringBuilder s)

  - ### assign_to

    protected void assign_to(StringBuilder s)