| java.lang.Object vqwiki.utils.lucene.LuceneTools
LuceneTools | final public class LuceneTools (Code) | | Contains miscellaneous utility methods for use with Lucene.
version: $Id: LuceneTools.java 365 2003-10-05 05:07:32Z garethc $ author: Maik Schreiber (mailto: bZ@iq-computing.de) |
Method Summary | |
public static int | findAfter(String text, int position) TODO: Document this method.
Parameters: text - TODO: Document this parameter. Parameters: position - TODO: Document this parameter. | public static int | findAfter(String text, int position, int howmany) TODO: Document this method.
Parameters: text - TODO: Document this parameter. Parameters: position - TODO: Document this parameter. Parameters: howmany - TODO: Document this parameter. | public static int | findBefore(String text, int position) TODO: Document this method.
Parameters: text - TODO: Document this parameter. Parameters: position - TODO: Document this parameter. | final public static void | getTerms(Query query, HashSet terms, boolean prohibited) Extracts all term texts of a given Query. | public static String | highlightTerm(String term) TODO: Document this method.
Parameters: term - TODO: Document this parameter. | final public static String | highlightTerms(String text, TermHighlighter highlighter, Query query, Analyzer analyzer) Highlights a text in accordance to a given query. | final public static String[] | outputHits(String text, Query query, Analyzer[] analyzer) |
findAfter | public static int findAfter(String text, int position)(Code) | | TODO: Document this method.
Parameters: text - TODO: Document this parameter. Parameters: position - TODO: Document this parameter. TODO: Document the result. |
findAfter | public static int findAfter(String text, int position, int howmany)(Code) | | TODO: Document this method.
Parameters: text - TODO: Document this parameter. Parameters: position - TODO: Document this parameter. Parameters: howmany - TODO: Document this parameter. TODO: Document the result. |
findBefore | public static int findBefore(String text, int position)(Code) | | TODO: Document this method.
Parameters: text - TODO: Document this parameter. Parameters: position - TODO: Document this parameter. TODO: Document the result. |
getTerms | final public static void getTerms(Query query, HashSet terms, boolean prohibited) throws IOException(Code) | | Extracts all term texts of a given Query. Term texts will be returned in lower-case.
Parameters: query - Query to extract term texts from Parameters: terms - HashSet where extracted term texts should be put into (Elements: String) Parameters: prohibited - true to extract "prohibited" terms, too exception: IOException - TODO: Document this exception. |
highlightTerm | public static String highlightTerm(String term)(Code) | | TODO: Document this method.
Parameters: term - TODO: Document this parameter. TODO: Document the result. |
highlightTerms | final public static String highlightTerms(String text, TermHighlighter highlighter, Query query, Analyzer analyzer) throws IOException(Code) | | Highlights a text in accordance to a given query.
Parameters: text - text to highlight terms in Parameters: highlighter - TermHighlighter to use to highlight terms in the text Parameters: query - Query which contains the terms to be highlighted in the text Parameters: analyzer - Analyzer used to construct the Query highlighted text exception: IOException - TODO: Document this exception. |
outputHits | final public static String[] outputHits(String text, Query query, Analyzer[] analyzer) throws IOException(Code) | | Give the text, which is before the highlighted text, the highlighted text
and the text, which is afterwards
Parameters: text - The source text Parameters: query - The query containing the string searched for Parameters: analyzer - Some analyzer An array of 3 strings, with the ten words before (as pos 0), the keyword (as pos 1) and the ten words after (as pos 2) throws: IOException - The stream can throw an IOException |
|
|