Class DirectCandidateGenerator

    • Constructor Summary

      Constructors 
      Constructor Description
      DirectCandidateGenerator​(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, java.lang.String field, org.apache.lucene.search.spell.SuggestMode suggestMode, org.apache.lucene.index.IndexReader reader, double nonErrorLikelihood, int numCandidates)  
      DirectCandidateGenerator​(org.apache.lucene.search.spell.DirectSpellChecker spellchecker, java.lang.String field, org.apache.lucene.search.spell.SuggestMode suggestMode, org.apache.lucene.index.IndexReader reader, double nonErrorLikelihood, int numCandidates, org.apache.lucene.analysis.Analyzer preFilter, org.apache.lucene.analysis.Analyzer postFilter, org.apache.lucene.index.Terms terms)  
    • Constructor Detail

      • DirectCandidateGenerator

        public DirectCandidateGenerator​(org.apache.lucene.search.spell.DirectSpellChecker spellchecker,
                                        java.lang.String field,
                                        org.apache.lucene.search.spell.SuggestMode suggestMode,
                                        org.apache.lucene.index.IndexReader reader,
                                        double nonErrorLikelihood,
                                        int numCandidates)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • DirectCandidateGenerator

        public DirectCandidateGenerator​(org.apache.lucene.search.spell.DirectSpellChecker spellchecker,
                                        java.lang.String field,
                                        org.apache.lucene.search.spell.SuggestMode suggestMode,
                                        org.apache.lucene.index.IndexReader reader,
                                        double nonErrorLikelihood,
                                        int numCandidates,
                                        org.apache.lucene.analysis.Analyzer preFilter,
                                        org.apache.lucene.analysis.Analyzer postFilter,
                                        org.apache.lucene.index.Terms terms)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • isKnownWord

        public boolean isKnownWord​(org.apache.lucene.util.BytesRef term)
                            throws java.io.IOException
        Specified by:
        isKnownWord in class CandidateGenerator
        Throws:
        java.io.IOException
      • termStats

        public org.apache.lucene.codecs.TermStats termStats​(org.apache.lucene.util.BytesRef term)
                                                     throws java.io.IOException
        Specified by:
        termStats in class CandidateGenerator
        Throws:
        java.io.IOException
      • internalTermStats

        public org.apache.lucene.codecs.TermStats internalTermStats​(org.apache.lucene.util.BytesRef term)
                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getField

        public java.lang.String getField()
      • preFilter

        protected org.apache.lucene.util.BytesRef preFilter​(org.apache.lucene.util.BytesRef term,
                                                            org.apache.lucene.util.CharsRefBuilder spare,
                                                            org.apache.lucene.util.BytesRefBuilder byteSpare)
                                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • analyze

        public static int analyze​(org.apache.lucene.analysis.Analyzer analyzer,
                                  org.apache.lucene.util.BytesRef toAnalyze,
                                  java.lang.String field,
                                  DirectCandidateGenerator.TokenConsumer consumer,
                                  org.apache.lucene.util.CharsRefBuilder spare)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • analyze

        public static int analyze​(org.apache.lucene.analysis.TokenStream stream,
                                  DirectCandidateGenerator.TokenConsumer consumer)
                           throws java.io.IOException
        NOTE: this method closes the TokenStream, even on exception, which is awkward because really the caller who called Analyzer.tokenStream(java.lang.String, java.io.Reader) should close it, but when trying that there are recursion issues when we try to use the same TokenStream twice in the same recursion...
        Throws:
        java.io.IOException