Class TypeAsSynonymFilter

All Implemented Interfaces:
Closeable, AutoCloseable, Unwrappable<TokenStream>

public final class TypeAsSynonymFilter extends TokenFilter
Adds the TypeAttribute.type() as a synonym, i.e. another token at the same position, optionally with a specified prefix prepended, optionally transfering flags, and optionally ignoring some types. See TypeAsSynonymFilterFactory for full details.
  • Constructor Details

    • TypeAsSynonymFilter

      public TypeAsSynonymFilter(TokenStream input)
    • TypeAsSynonymFilter

      public TypeAsSynonymFilter(TokenStream input, String prefix)
      Parameters:
      input - input tokenstream
      prefix - Prepend this string to every token type emitted as token text. If null, nothing will be prepended.
    • TypeAsSynonymFilter

      public TypeAsSynonymFilter(TokenStream input, String prefix, Set<String> ignore, int synFlagsMask)
      Parameters:
      input - input tokenstream
      prefix - Prepend this string to every token type emitted as token text. If null, nothing will be prepended.
      ignore - types to ignore (and not convert to a synonym)
      synFlagsMask - a mask to control what flags are propagated to the synonym.
  • Method Details