Class PreprocessingContext

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public final class PreprocessingContext
    extends Object
    implements Closeable
    Document preprocessing context provides low-level (usually integer-coded) data structures useful for further processing.

    Internals of PreprocessingContext

    • Constructor Detail

      • PreprocessingContext

        public PreprocessingContext​(LanguageComponents languageComponents)
        Creates a preprocessing context for the provided documents and with the provided languageModel.
    • Method Detail

      • hasWords

        public boolean hasWords()
        Returns true if this context contains any words.
      • hasLabels

        public boolean hasLabels()
        Returns true if this context contains any label candidates.
      • format

        public String format​(LabelFormatter formatter,
                             int featureIndex)
        Applies label formatter to a given word or phrase (depending on the feature index provided).
      • toFieldIndexes

        public static int[] toFieldIndexes​(byte b)
        Convert the selected bits in a byte to an array of indexes.
      • close

        public void close()
        This method should be invoked after all preprocessing contributors have been executed to release temporary data structures.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
      • intern

        public char[] intern​(MutableCharArray chs)
        Return a unique char buffer representing a given character sequence.