Examples of HunspellDictionary


Examples of org.apache.lucene.analysis.hunspell.HunspellDictionary

            throw new ElasticSearchException("invalid locale '" + locale + "' for hunspell aff/dic");
        }
        try {
            InputStream affixStream = HunspellStemFilterFactory.class.getResourceAsStream(locale + ".aff");
            InputStream dictStream = HunspellStemFilterFactory.class.getResourceAsStream(locale + ".dic");
            this.dictionary = new HunspellDictionary(affixStream, dictStream, version, ignoreCase);
            affixStream.close();
            dictStream.close();
        } catch (IOException ex) {
            logger.error("hunspell aff/dic stream I/O error for locale " + locale, ex);
        } catch (ParseException ex) {
View Full Code Here

Examples of org.apache.lucene.analysis.hunspell.HunspellDictionary

    try {
      List<InputStream> dictionaries = new ArrayList<InputStream>();
      for (String file : dictionaryFiles) {
        dictionaries.add(loader.openResource(file));
      }
      this.dictionary = new HunspellDictionary(loader.openResource(affixFile), dictionaries, luceneMatchVersion, ignoreCase);
    } catch (Exception e) {
      throw new RuntimeException("Unable to load hunspell data! [dictionary=" + args.get("dictionary") + ",affix=" + affixFile + "]", e);
    }
  }
View Full Code Here

Examples of org.apache.lucene.analysis.hunspell.HunspellDictionary

      for (String file : dictionaryFiles) {
        dictionaries.add(loader.openResource(file));
      }
      affix = loader.openResource(affixFile);

      this.dictionary = new HunspellDictionary(affix, dictionaries, luceneMatchVersion, ignoreCase, strictAffixParsing);
    } catch (ParseException e) {
      throw new IOException("Unable to load hunspell data! [dictionary=" + args.get("dictionary") + ",affix=" + affixFile + "]", e);
    } finally {
      IOUtils.closeWhileHandlingException(affix);
      IOUtils.closeWhileHandlingException(dictionaries);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.