Class Classifier

java.lang.Object
eu.bandm.tools.lexic.Classifier
All Implemented Interfaces:
Serializable, IntUnaryOperator

public class Classifier extends Object implements IntUnaryOperator, Serializable
A function on code points that substitutes representatives.

The function is backed by a substitution map on code points; the function returns the input code point where the map is undefined.

See Also:
  • Constructor Details

    • Classifier

      public Classifier(CodePointMap<Integer> map)
      Creates a new instance.
      Parameters:
      map - the substitution map
  • Method Details

    • applyAsInt

      public int applyAsInt(int codePoint)
      Maps one code point to another.
      Specified by:
      applyAsInt in interface IntUnaryOperator
      Parameters:
      codePoint - a code point
      Returns:
      a substituted code point if found in the substitution map, or codePoint otherwise