public LanguageIdentifier() throws LangDetectException { DetectorFactory.clear(); try { DetectorFactory.loadProfile(loadProfiles("profiles","profiles.cfg")); } catch (Exception e) { throw new LangDetectException(null, "Error in Initialization: "+e.getMessage()); } } /**
DetectorFactory.clear(); int count = 0; int langsize = profiles.size();
/** * Initializes the language detection.<p> */ private void initLanguageDetection() { try { // use a seed for initializing the language detection for making sure the // same probabilities are detected for the same document contents DetectorFactory.clear(); DetectorFactory.setSeed(42L); DetectorFactory.loadProfile(loadProfiles(getAvailableLocales())); } catch (Exception e) { LOG.error(Messages.get().getBundle().key(Messages.INIT_I18N_LANG_DETECT_FAILED_0), e); } }