Changeset 12653 for trunk/gsdl


Ignore:
Timestamp:
2006-09-01T14:51:21+12:00 (18 years ago)
Author:
mdewsnip
Message:

Made it a little bit easier to use a custom set of stop words with Lucene.

Location:
trunk/gsdl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/java/org/nzdl/gsdl/LuceneWrap/GS2LuceneQuery.java

    r12429 r12653  
    3434public class GS2LuceneQuery
    3535{
    36     public static void main (String args[])
     36    // Use the standard set of English stop words by default
     37    static private String[] stop_words = StandardAnalyzer.STOP_WORDS;
     38
     39
     40    static public void main (String args[])
    3741    {
    3842    if (args.length == 0) {
     
    4549        IndexReader reader = ((IndexSearcher) searcher).getIndexReader();
    4650
    47         // Create one query parser with the standard set of stop words, and one with none
    48         QueryParser query_parser = new QueryParser("TX", new StandardAnalyzer());
     51        // Create one query parser with stop words, and one with none
     52        QueryParser query_parser = new QueryParser("TX", new StandardAnalyzer(stop_words));
    4953        QueryParser query_parser_no_stop_words = new QueryParser("TX", new StandardAnalyzer(new String[] { }));
    5054
Note: See TracChangeset for help on using the changeset viewer.