Class TokenStreamToTermAutomatonQuery


  • public class TokenStreamToTermAutomatonQuery
    extends java.lang.Object
    Consumes a TokenStream and creates an TermAutomatonQuery where the transition labels are tokens from the TermToBytesRefAttribute.

    This code is very new and likely has exciting bugs!

    • Field Detail

      • preservePositionIncrements

        private boolean preservePositionIncrements
    • Constructor Detail

      • TokenStreamToTermAutomatonQuery

        public TokenStreamToTermAutomatonQuery()
        Sole constructor.
    • Method Detail

      • setPreservePositionIncrements

        public void setPreservePositionIncrements​(boolean enablePositionIncrements)
        Whether to generate holes in the automaton for missing positions, true by default.
      • toQuery

        public TermAutomatonQuery toQuery​(java.lang.String field,
                                          TokenStream in)
                                   throws java.io.IOException
        Pulls the graph (including PositionLengthAttribute) from the provided TokenStream, and creates the corresponding automaton where arcs are bytes (or Unicode code points if unicodeArcs = true) from each term.
        Throws:
        java.io.IOException