@Test public void testSupportedLanguages() { LanguageDetector ld = new LanguageDetectorME(this.model); String[] supportedLanguages = ld.getSupportedLanguages(); Assert.assertEquals(4, supportedLanguages.length); }
@Override public String[] getSupportedLanguages() { int numberLanguages = model.getMaxentModel().getNumOutcomes(); String[] languages = new String[numberLanguages]; for (int i = 0; i < numberLanguages; i++) { languages[i] = model.getMaxentModel().getOutcome(i); } return languages; }
LanguageDetectorME implements LanguageDetector { @Override public String[] getSupportedLanguages() { int numberLanguages = model.getMaxentModel().getNumOutcomes(); String[] languages = new String[numberLanguages]; for (int i = 0; i < numberLanguages; i++) { languages[i] = model.getMaxentModel().getOutcome(i); } return languages; } }
LanguageDetectorME implements LanguageDetector { @Override public String[] getSupportedLanguages() { int numberLanguages = model.getMaxentModel().getNumOutcomes(); String[] languages = new String[numberLanguages]; for (int i = 0; i < numberLanguages; i++) { languages[i] = model.getMaxentModel().getOutcome(i); } return languages; } LanguageDetectorME(LanguageDetectorModel model); }
LanguageDetectorME implements LanguageDetector { @Override public String[] getSupportedLanguages() { int numberLanguages = model.getMaxentModel().getNumOutcomes(); String[] languages = new String[numberLanguages]; for (int i = 0; i < numberLanguages; i++) { languages[i] = model.getMaxentModel().getOutcome(i); } return languages; } 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 String[] getSupportedLanguages() { int numberLanguages = model.getMaxentModel().getNumOutcomes(); String[] languages = new String[numberLanguages]; for (int i = 0; i < numberLanguages; i++) { languages[i] = model.getMaxentModel().getOutcome(i); } return languages; } 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);  }