@Test public void testPredictLanguages() { LanguageDetector ld = new LanguageDetectorME(this.model); Language[] languages = ld.predictLanguages("estava em uma marcenaria na Rua Bruno"); Assert.assertEquals(4, languages.length); Assert.assertEquals("pob", languages[0].getLang()); Assert.assertEquals("ita", languages[1].getLang()); Assert.assertEquals("spa", languages[2].getLang()); Assert.assertEquals("fra", languages[3].getLang()); }
@Override public Language[] predictLanguages(CharSequence content) { return predict(arrayToCounts( mContextGenerator.getContext(content))); }
LanguageDetectorME implements LanguageDetector { @Override public Language[] predictLanguages(CharSequence content) { return predict(arrayToCounts( mContextGenerator.getContext(content))); } }
LanguageDetectorME implements LanguageDetector { @Override public Language[] predictLanguages(CharSequence content) { return predict(arrayToCounts( mContextGenerator.getContext(content))); } LanguageDetectorME(LanguageDetectorModel model); }
LanguageDetectorME implements LanguageDetector { @Override public Language[] predictLanguages(CharSequence content) { return predict(arrayToCounts( mContextGenerator.getContext(content))); } 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[] predictLanguages(CharSequence content) { return predict(arrayToCounts( mContextGenerator.getContext(content))); } 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);  }