Enum Class ReductionMode

java.lang.Object
java.lang.Enum<ReductionMode>
org.egothor.stemmer.ReductionMode
All Implemented Interfaces:
Serializable, Comparable<ReductionMode>, Constable

public enum ReductionMode extends Enum<ReductionMode>
Defines the subtree reduction strategy applied during trie compilation.

All reduction modes operate on the full subtree semantics, not only on the local content of a single node. This is important because trie values may be stored on both internal nodes and leaf nodes.

  • Enum Constant Details

    • MERGE_SUBTREES_WITH_EQUIVALENT_RANKED_GET_ALL_RESULTS

      public static final ReductionMode MERGE_SUBTREES_WITH_EQUIVALENT_RANKED_GET_ALL_RESULTS
      Merges subtrees whose getAll() results are equivalent for every reachable key suffix and whose local result ordering is the same.

      This mode ignores absolute frequencies when comparing subtree signatures, but preserves the value order returned by getAll().

    • MERGE_SUBTREES_WITH_EQUIVALENT_UNORDERED_GET_ALL_RESULTS

      public static final ReductionMode MERGE_SUBTREES_WITH_EQUIVALENT_UNORDERED_GET_ALL_RESULTS
      Merges subtrees whose getAll() results are equivalent for every reachable key suffix, regardless of the local ordering of values.

      This mode ignores both absolute frequencies and local result ordering when comparing subtree signatures.

    • MERGE_SUBTREES_WITH_EQUIVALENT_DOMINANT_GET_RESULTS

      public static final ReductionMode MERGE_SUBTREES_WITH_EQUIVALENT_DOMINANT_GET_RESULTS
      Merges subtrees whose preferred get() results are equivalent for every reachable key suffix, provided that the locally dominant winner satisfies the configured dominance constraints.

      If a node does not satisfy the dominance constraints, the implementation falls back to ranked getAll() semantics for that node in order to avoid unsafe over-reduction.

  • Method Details

    • values

      public static ReductionMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ReductionMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null