Class ContextualTokenFilterFactory

  • Direct Known Subclasses:
    ContextualStopFilterFactory

    public abstract class ContextualTokenFilterFactory
    extends org.apache.lucene.analysis.util.TokenFilterFactory
    Abstract parent class for analysis factories that create TokenFilter instances supporting JCMS contextual language information retrieval.

    Typical use related to all language specific filter such as stop words, stemming, ellision, filter which may be build with language dependent information.
    setCurrentLanguage(String) is invoked by JCMS before factory constructor.
    Use getCurrentLanguage() in your factory constructor to properly initialize parameter

    Since:
    jcms-10.0
    • Field Summary

      • Fields inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory

        LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ContextualTokenFilterFactory​(java.util.Map<java.lang.String,​java.lang.String> args)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getCurrentLanguage()
      Retrieve the current language to be used for next instanciation of ContextualTokenFilterFactory.
      static void setCurrentLanguage​(java.lang.String lang)
      Set the language to be used for next instanciation of ContextualTokenFilterFactory ctor.
      • Methods inherited from class org.apache.lucene.analysis.util.TokenFilterFactory

        availableTokenFilters, create, forName, lookupClass, reloadTokenFilters
      • Methods inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory

        get, get, get, get, get, getBoolean, getChar, getClassArg, getFloat, getInt, getLines, getLuceneMatchVersion, getOriginalArgs, getPattern, getSet, getSnowballWordSet, getWordSet, isExplicitLuceneMatchVersion, require, require, require, requireBoolean, requireChar, requireFloat, requireInt, setExplicitLuceneMatchVersion, splitAt, splitFileNames
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContextualTokenFilterFactory

        protected ContextualTokenFilterFactory​(java.util.Map<java.lang.String,​java.lang.String> args)
    • Method Detail

      • setCurrentLanguage

        public static void setCurrentLanguage​(java.lang.String lang)
        Set the language to be used for next instanciation of ContextualTokenFilterFactory ctor.
        Parameters:
        lang - an ISO-639 language code
      • getCurrentLanguage

        public static java.lang.String getCurrentLanguage()
        Retrieve the current language to be used for next instanciation of ContextualTokenFilterFactory.
        Returns:
        an ISO-639 language code, or null if no contexual language was specified