lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dor...@apache.org
Subject svn commit: r1127466 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/contrib/benchmark/CHANGES.txt lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractReuters.java solr/
Date Wed, 25 May 2011 10:31:54 GMT
Author: doronc
Date: Wed May 25 10:31:54 2011
New Revision: 1127466

URL: http://svn.apache.org/viewvc?rev=1127466&view=rev
Log:
LUCENE-3137: ExtractReuters supports out-dir param suffixed by a slash - backport from r1127436
(from trunk).

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt
    lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractReuters.java
    lucene/dev/branches/branch_3x/solr/   (props changed)

Modified: lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt?rev=1127466&r1=1127465&r2=1127466&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/benchmark/CHANGES.txt Wed May 25 10:31:54
2011
@@ -2,6 +2,9 @@ Lucene Benchmark Contrib Change Log
 
 The Benchmark contrib package contains code for benchmarking Lucene in a variety of ways.
 
+05/25/2011
+  LUCENE-3137: ExtractReuters supports out-dir param suffixed by a slash. (Doron Cohen)
+
 03/24/2011
   LUCENE-2977: WriteLineDocTask now automatically detects how to write -
   GZip or BZip2 or Plain-text - according to the output file extension.

Modified: lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractReuters.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractReuters.java?rev=1127466&r1=1127465&r2=1127466&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractReuters.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/utils/ExtractReuters.java
Wed May 25 10:31:54 2011
@@ -122,17 +122,19 @@ public class ExtractReuters {
 
   public static void main(String[] args) {
     if (args.length != 2) {
-      printUsage();
+      usage("Wrong number of arguments ("+args.length+")");
+      return;
     }
     File reutersDir = new File(args[0]);
     if (!reutersDir.exists()) {
-      printUsage();
+      usage("Cannot find Path to Reuters SGM files ("+reutersDir+")");
       return;
     }
     
     // First, extract to a tmp directory and only if everything succeeds, rename
     // to output directory.
-    File outputDir = new File(args[1] + "-tmp");
+    File outputDir = new File(args[1]);
+    outputDir = new File(outputDir.getAbsolutePath() + "-tmp");
     outputDir.mkdirs();
     ExtractReuters extractor = new ExtractReuters(reutersDir, outputDir);
     extractor.extract();
@@ -140,8 +142,8 @@ public class ExtractReuters {
     outputDir.renameTo(new File(args[1]));
   }
 
-  private static void printUsage() {
-    System.err.println("Usage: java -cp <...> org.apache.lucene.benchmark.utils.ExtractReuters
<Path to Reuters SGM files> <Output Path>");
+  private static void usage(String msg) {
+    System.err.println("Usage: "+msg+" :: java -cp <...> org.apache.lucene.benchmark.utils.ExtractReuters
<Path to Reuters SGM files> <Output Path>");
   }
   
 }



Mime
View raw message