public final class AnalyzerUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
displayTokens(org.apache.lucene.analysis.Analyzer analyzer,
String field,
String text) |
static void |
displayTokensWithFullDetails(org.apache.lucene.analysis.Analyzer analyzer,
String field,
String text) |
static void |
displayTokensWithPositions(org.apache.lucene.analysis.Analyzer analyzer,
String field,
String text,
PrintStream printTo)
Utility to print out the tokens generated by a specific Analyzer on an example text.
|
static String |
getTermText(org.apache.lucene.analysis.Token token) |
static List<String> |
tokenizedTermValues(org.apache.lucene.analysis.Analyzer analyzer,
String field,
String text) |
static org.apache.lucene.analysis.Token[] |
tokensFromAnalysis(org.apache.lucene.analysis.Analyzer analyzer,
String field,
String text) |
public static final Log log
public static List<String> tokenizedTermValues(org.apache.lucene.analysis.Analyzer analyzer, String field, String text) throws IOException
IOException
public static org.apache.lucene.analysis.Token[] tokensFromAnalysis(org.apache.lucene.analysis.Analyzer analyzer, String field, String text) throws IOException
IOException
public static void displayTokens(org.apache.lucene.analysis.Analyzer analyzer, String field, String text) throws IOException
IOException
public static void displayTokensWithPositions(org.apache.lucene.analysis.Analyzer analyzer, String field, String text, PrintStream printTo) throws IOException
analyzer
- the Analyzer to usefield
- the name of the field: might affect the Analyzer behaviourtext
- some sample inputprintTo
- Human readable text will be printed to this output. Passing System.out
might be a good idea.IOException
- if an I/O error occurspublic static void displayTokensWithFullDetails(org.apache.lucene.analysis.Analyzer analyzer, String field, String text) throws IOException
IOException
public static String getTermText(org.apache.lucene.analysis.Token token)
Copyright © 2006–2016 Hibernate. All rights reserved.