lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: HighFreqTerms patch
Date Wed, 09 Feb 2011 23:16:48 GMT
Sorry, I mean "let you specify numTerms".

Mike

On Wed, Feb 9, 2011 at 6:16 PM, Michael McCandless
<lucene@mikemccandless.com> wrote:
> Hmm, which version of Lucene are you using?  Newer versions let you
> specify a field...
>
> Mike
>
> On Wed, Feb 9, 2011 at 12:06 PM, Pablo Mendes <pablomendes@gmail.com> wrote:
>> Guys,
>> this is tiny and probably not relevant. But I'll bet a beer that at least a
>> dozen people had to dirtymod this class while they could have run it from
>> command line.
>> A 15 min time save that took 15 min to create. I guess it's a tie.
>>
>> Best,
>> Pablo
>>
>> --- HighFreqTerms.java
>> +++ ExtractStopwords.java
>> @@ -30,7 +30,7 @@
>>  public class HighFreqTerms {
>>
>>   // The top numTerms will be displayed
>> -  public static final int numTerms = 100;
>> +  public static int numTerms = 100;
>>
>>   public static void main(String[] args) throws Exception {
>>     IndexReader reader = null;
>> @@ -40,6 +40,10 @@
>>     } else if (args.length == 2) {
>>       reader = IndexReader.open(args[0]);
>>       field = args[1];
>> +    } else if (args.length == 3) {
>> +      reader = IndexReader.open(args[0]);
>> +      field = args[1];
>> +      numTerms = new Integer(args[2]);
>>     } else {
>>       usage();
>>       System.exit(1);
>> @@ -71,7 +75,7 @@
>>   private static void usage() {
>>     System.out.println(
>>          "\n\n"
>> -         + "java org.apache.lucene.misc.HighFreqTerms <index dir>
>> [field]\n\n");
>> +         + "java org.apache.lucene.misc.HighFreqTerms <index dir> [field]
>> [numTerms] \n\n");
>>   }
>>  }
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message