Optimizer (Lucene 10.5.1 stempel API)
Description: declaration: package: org.egothor.stemmer, class: Optimizer

Package org.egothor.stemmer

# Class Optimizer

java.lang.Object
org.egothor.stemmer.Reduce
org.egothor.stemmer.Optimizer

Direct Known Subclasses:
  `Optimizer2`

public class Optimizer extends Reduce
The Optimizer class is a Trie that will be reduced (have empty rows removed).

The reduction will be made by joining two rows where the first is a subset of the second.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Optimizer()`
  Constructor for the Optimizer object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `org.egothor.stemmer.Cell`
  `merge(org.egothor.stemmer.Cell m, org.egothor.stemmer.Cell e)`
  Merge the given Cells and return the resulting Cell.
  `Row`
  `merge(Row master, Row existing)`
  Merge the given rows and return the resulting Row.
  `Trie`
  `optimize(Trie orig)`
  Optimize (remove empty rows) from the given Trie and return the resulting Trie.

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

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

- ## Constructor Details

  - ### Optimizer

    public Optimizer()
    Constructor for the Optimizer object.

- ## Method Details

  - ### optimize

    public Trie optimize(Trie orig)
    Optimize (remove empty rows) from the given Trie and return the resulting Trie.
    Overrides:
      `optimize` in class `Reduce`
    Parameters:
      `orig` - the Trie to consolidate
    Returns:
      the newly consolidated Trie

  - ### merge

    public Row merge(Row master, Row existing)
    Merge the given rows and return the resulting Row.
    Parameters:
      `master` - the master Row
      `existing` - the existing Row
    Returns:
      the resulting Row, or `null` if the operation cannot be realized

  - ### merge

    public org.egothor.stemmer.Cell merge(org.egothor.stemmer.Cell m, org.egothor.stemmer.Cell e)
    Merge the given Cells and return the resulting Cell.
    Parameters:
      `m` - the master Cell
      `e` - the existing Cell
    Returns:
      the resulting Cell, or `null` if the operation cannot be realized