lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dor...@apache.org
Subject svn commit: r1067764 - /lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java
Date Sun, 06 Feb 2011 21:15:36 GMT
Author: doronc
Date: Sun Feb  6 21:15:33 2011
New Revision: 1067764

URL: http://svn.apache.org/viewvc?rev=1067764&view=rev
Log:
LUCENE-1540: Improvements to contrib.benchmark for TREC collections - bring back case insensitivity
to path names using Locale.ENGLISH

Modified:
    lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java

Modified: lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java?rev=1067764&r1=1067763&r2=1067764&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/TrecDocParser.java
Sun Feb  6 21:15:33 2011
@@ -20,6 +20,7 @@ package org.apache.lucene.benchmark.byTa
 import java.io.File;
 import java.io.IOException;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 /** 
@@ -29,12 +30,7 @@ import java.util.Map;
 public abstract class TrecDocParser {
 
   /** Types of trec parse paths, */
-  public enum ParsePathType { GOV2("gov2"), FBIS("fbis"), FT("ft"), FR94("fr94"), LATIMES("latimes");

-    public final String dirName;
-    private ParsePathType(String dirName) {
-      this.dirName = dirName;
-    }
-  }
+  public enum ParsePathType { GOV2, FBIS, FT, FR94, LATIMES }
   
   /** trec parser type used for unknown extensions */
   public static final ParsePathType DEFAULT_PATH_TYPE  = ParsePathType.GOV2;
@@ -51,7 +47,7 @@ public abstract class TrecDocParser {
   static final Map<String,ParsePathType> pathName2Type = new HashMap<String,ParsePathType>();
   static {
     for (ParsePathType ppt : ParsePathType.values()) {
-      pathName2Type.put(ppt.dirName,ppt);
+      pathName2Type.put(ppt.name().toUpperCase(Locale.ENGLISH),ppt);
     }
   }
   
@@ -64,7 +60,7 @@ public abstract class TrecDocParser {
   public static ParsePathType pathType(File f) {
     int pathLength = 0;
     while (f != null && ++pathLength < MAX_PATH_LENGTH) {
-      ParsePathType ppt = pathName2Type.get(f.getName());
+      ParsePathType ppt = pathName2Type.get(f.getName().toUpperCase(Locale.ENGLISH));
       if (ppt!=null) {
         return ppt;
       }



Mime
View raw message