/** * @throws IllegalStateException if no LanguageProfile was {@link #withProfile added}. */ public LanguageDetector build() throws IllegalStateException { if (languageProfiles.isEmpty()) throw new IllegalStateException(); return new LanguageDetectorImpl( NgramFrequencyData.create(languageProfiles, ngramExtractor.getGramLengths()), alpha, seed, shortTextAlgorithm, prefixFactor, suffixFactor, probabilityThreshold, minimalConfidence, langWeightingMap, ngramExtractor ); }
/** * @throws IllegalStateException if no LanguageProfile was {@link #withProfile added}. */ public LanguageDetector build() throws IllegalStateException { if (languageProfiles.isEmpty()) throw new IllegalStateException(); return new LanguageDetectorImpl( NgramFrequencyData.create(languageProfiles, ngramExtractor.getGramLengths()), alpha, seed, shortTextAlgorithm, prefixFactor, suffixFactor, probabilityThreshold, minimalConfidence, langWeightingMap, ngramExtractor ); }