You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/02/07 19:59:19 UTC

svn commit: r1241551 - in /lucene/dev/branches/branch_3x: ./ solr/ solr/contrib/langid/CHANGES.txt solr/contrib/langid/src/java/org/apache/solr/update/processor/LangDetectLanguageIdentifierUpdateProcessorFactory.java

Author: rmuir
Date: Tue Feb  7 18:59:19 2012
New Revision: 1241551

URL: http://svn.apache.org/viewvc?rev=1241551&view=rev
Log:
SOLR-3107: hardwire seed in langdetect langid impl

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/solr/   (props changed)
    lucene/dev/branches/branch_3x/solr/contrib/langid/CHANGES.txt
    lucene/dev/branches/branch_3x/solr/contrib/langid/src/java/org/apache/solr/update/processor/LangDetectLanguageIdentifierUpdateProcessorFactory.java

Modified: lucene/dev/branches/branch_3x/solr/contrib/langid/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/contrib/langid/CHANGES.txt?rev=1241551&r1=1241550&r2=1241551&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/contrib/langid/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/solr/contrib/langid/CHANGES.txt Tue Feb  7 18:59:19 2012
@@ -9,7 +9,9 @@ $Id$
 
 ================== Release 3.6.0 ==================
 
-(No Changes)
+* SOLR-3107: When using the LangDetect implementation of langid, set the random
+  seed to 0, so that the same document is detected as the same language with
+  the same probability every time.  (Christian Moen via rmuir)
 
 ================== Release 3.5.0 ==================
 

Modified: lucene/dev/branches/branch_3x/solr/contrib/langid/src/java/org/apache/solr/update/processor/LangDetectLanguageIdentifierUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/contrib/langid/src/java/org/apache/solr/update/processor/LangDetectLanguageIdentifierUpdateProcessorFactory.java?rev=1241551&r1=1241550&r2=1241551&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/contrib/langid/src/java/org/apache/solr/update/processor/LangDetectLanguageIdentifierUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/branch_3x/solr/contrib/langid/src/java/org/apache/solr/update/processor/LangDetectLanguageIdentifierUpdateProcessorFactory.java Tue Feb  7 18:59:19 2012
@@ -119,8 +119,9 @@ public class LangDetectLanguageIdentifie
   };
 
   public static synchronized void loadData() throws IOException, LangDetectException {
-    if (loaded)
+    if (loaded) {
       return;
+    }
     loaded = true;
     List<String> profileData = new ArrayList<String>();
     Charset encoding = Charset.forName("UTF-8");
@@ -131,5 +132,6 @@ public class LangDetectLanguageIdentifie
       reader.close();
     }
     DetectorFactory.loadProfile(profileData);
+    DetectorFactory.setSeed(0);
   }
 }