Interface TaggingAttribute

  • All Superinterfaces:
    org.apache.lucene.util.Attribute
    All Known Implementing Classes:
    TaggingAttributeImpl

    public interface TaggingAttribute
    extends org.apache.lucene.util.Attribute
    Attribute used by the Tagger to decide if a token can start a new tag.

    By default this Attribute will return true, but it might be reset by some TokenFilter added to the TokenStream used to analyze the parsed text. Typically this will be done based on NLP processing results (e.g. to only lookup Named Entities).

    NOTE: that all Tokens are used to advance existing tags.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean DEFAULT_TAGGABLE
      By default this Attribute will be initialised with true.
    • Field Detail

      • DEFAULT_TAGGABLE

        static final boolean DEFAULT_TAGGABLE
        By default this Attribute will be initialised with true. This ensures that all tokens are taggable by default (especially if the TaggingAttribute is not set by any component in the configured TokenStream
        See Also:
        Constant Field Values
    • Method Detail

      • isTaggable

        boolean isTaggable()
        Getter for the taggable state of the current Token
        Returns:
        the state
      • setTaggable

        void setTaggable​(boolean lookup)
        Setter for the taggable state. Typically called by code within TokenStream.incrementToken().
        Parameters:
        lookup - the state