Open GoogleCodeExporter opened 9 years ago
As the message mentioned, the same profile was loaded doubly.
Did it call DetectorFactory.loadProfile() twice?
Original comment by nakatani.shuyo
on 7 Jun 2011 at 6:38
Hello,
I have the same problem when i call the detectLanguage function more than one
time
public static String getTextLang(String text) throws LangDetectException{
DetectorFactory.loadProfile(LANGUAGEPROFILE);
Detector detector = DetectorFactory.create();
detector.append(text);
return detector.detect();
}
any solution?
Original comment by Mustafa....@googlemail.com
on 28 Sep 2011 at 8:19
I had same issue n following code worked for me.
DetectorFactory.loadProfile("your/path/to/profiles");
Detector detector = DetectorFactory.create();
detector.append("قال الرئيس اليمني علي عبد الله صالح إنه سيتنحى بعد ");
System.out.println("lang is "+detector.detect());
detector = DetectorFactory.create();
detector.append("hallo world");
System.out.println("lang is "+detector.detect());
output will be like
ar
en
Make sure 2 things
1) profiles are loaded once
2) u recreate detector = DetectorFactory.create(); for each language detection
otherwise it will return language of 1st creaded detector.
Original comment by ali.shan...@gmail.com
on 18 Nov 2011 at 4:00
Sorry, I missed This comment.
You can detect multiplely as Comment 3. Very Thanks!
Original comment by nakatani.shuyo
on 22 Nov 2011 at 5:28
Original issue reported on code.google.com by
mail2gau...@gmail.com
on 6 Jun 2011 at 8:19