SOLR-3107: hardwire seed in langdetect langid impl

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1241550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-02-07 18:58:43 +00:00
parent a26d3d1d4c
commit 8b939cb7d2
2 changed files with 6 additions and 2 deletions

View File

@ -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 ==================

View File

@ -119,8 +119,9 @@ public class LangDetectLanguageIdentifierUpdateProcessorFactory extends
};
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 LangDetectLanguageIdentifierUpdateProcessorFactory extends
reader.close();
}
DetectorFactory.loadProfile(profileData);
DetectorFactory.setSeed(0);
}
}