@Test public void testPredictLanguage() { LanguageDetector ld = new LanguageDetectorME(this.model); Language language = ld.predictLanguage("Dove è meglio che giochi"); Assert.assertEquals("ita", language.getLang()); }
@Override public Language predictLanguage(CharSequence content) { return predictLanguages(content)[0]; }
LanguageDetectorME implements LanguageDetector { @Override public Language predictLanguage(CharSequence content) { return predictLanguages(content)[0]; } }
LanguageDetectorME implements LanguageDetector { @Override public Language predictLanguage(CharSequence content) { return predictLanguages(content)[0]; } LanguageDetectorME(LanguageDetectorModel model); }
LanguageDetectorME implements LanguageDetector { @Override public Language predictLanguage(CharSequence content) { return predictLanguages(content)[0]; } LanguageDetectorME(LanguageDetectorModel model); @Override Language[] predictLanguages(CharSequence content); @Override Language predictLanguage(CharSequence content); @Override String[] getSupportedLanguages(); ProbingLanguageDetectionResult probingPredictLanguages(CharSequence content); ProbingLanguageDetectionResult probingPredictLanguages(CharSequence content,
                                                                LanguageDetectorConfig config); static LanguageDetectorModel train(ObjectStream<LanguageSample> samples,
                                            TrainingParameters mlParams,
                                            LanguageDetectorFactory factory); }
LanguageDetectorME implements LanguageDetector { @Override public Language predictLanguage(CharSequence content) { return predictLanguages(content)[0]; } LanguageDetectorME(LanguageDetectorModel model); @Override Language[] predictLanguages(CharSequence content); @Override Language predictLanguage(CharSequence content); @Override String[] getSupportedLanguages(); ProbingLanguageDetectionResult probingPredictLanguages(CharSequence content); ProbingLanguageDetectionResult probingPredictLanguages(CharSequence content,
                                                                LanguageDetectorConfig config); static LanguageDetectorModel train(ObjectStream<LanguageSample> samples,
                                            TrainingParameters mlParams,
                                            LanguageDetectorFactory factory);  }