mirror of
https://github.com/apache/lucene.git
synced 2025-02-21 09:36:46 +00:00
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:
parent
a26d3d1d4c
commit
8b939cb7d2
@ -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 ==================
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user