Package com.code972.elasticsearch.rest.action

Examples of com.code972.elasticsearch.rest.action.RestHebrewAnalyzerCheckWordAction


        }
    }

    static private DictRadix<MorphData> loadFromPath(final File path) {
        try {
            Loader loader = new Loader(path, true);
            return loader.loadDictionaryFromHSpellData();
        } catch (IOException ex) {
            throw new IllegalStateException("Failed to read data", ex);
        }
    }
View Full Code Here


         String hspellPath = System.getenv(DEFAULT_HSPELL_ENV_VARIABLE);
         if (hspellPath == null) {
           throw new IllegalStateException("Failed to load hspell dictionary files. They should be configured " +
               "in classpath or by " + DEFAULT_HSPELL_ENV_VARIABLE + " environment variable");
         }
         Loader loader = new Loader(new File(hspellPath), true);
        return loader.loadDictionaryFromHSpellData();
    }
View Full Code Here

        return synonymMap.build();
    }

    static private DictRadix<MorphData> loadFromClasspath(final String pathInClasspath) {
        try {
            Loader loader = new Loader(Thread.currentThread().getContextClassLoader(), pathInClasspath, true);
            return loader.loadDictionaryFromHSpellData();
        } catch (IOException ex) {
           try {
             // Try to use environment variable if failed with classpath
        return loadFromEnvVariable();
      } catch (IOException e) {
View Full Code Here

        }
    }

    static private DictRadix<MorphData> loadFromPath(final File path) {
        try {
            Loader loader = new Loader(path, true);
            return loader.loadDictionaryFromHSpellData();
        } catch (IOException ex) {
            throw new IllegalStateException("Failed to read data", ex);
        }
    }
View Full Code Here

         String hspellPath = System.getenv(DEFAULT_HSPELL_ENV_VARIABLE);
         if (hspellPath == null) {
           throw new IllegalStateException("Failed to load hspell dictionary files. They should be configured " +
               "in classpath or by " + DEFAULT_HSPELL_ENV_VARIABLE + " environment variable");
         }
         Loader loader = new Loader(new File(hspellPath), true);
        return loader.loadDictionaryFromHSpellData();
    }
View Full Code Here

    public static void setCustomWords(InputStream input) throws IOException {
        customWords = Loader.loadCustomWords(input, dictRadix);
    }

    protected HebrewAnalyzer() throws IOException {
        lemmaFilter = new BasicLemmaFilter();
    }
View Full Code Here

        customWords = Loader.loadCustomWords(input, dictRadix);
        return customWords;
    }

    protected HebrewAnalyzer() throws IOException {
        lemmaFilter = new BasicLemmaFilter();
    }
View Full Code Here

        @Override
        protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
            StreamLemmasFilter src = null;
            try {
                src = new StreamLemmasFilter(reader, getDictionary(false), null, new BasicLemmaFilter());
                src.setKeepOriginalWord(true);
                src.setSuffixForExactMatch('$');
            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

            this.commonWords = commonWords;
        }

        @Override
        protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
            final StreamLemmasFilter src = new StreamLemmasFilter(reader, dict, specialTokenizationCases, commonWords, new BasicLemmaFilter());
            src.setKeepOriginalWord(true);

            return new TokenStreamComponents(src) {
                @Override
                protected void setReader(final Reader reader) throws IOException {
View Full Code Here

    public static void setCustomWords(InputStream input) throws IOException {
        customWords = Loader.loadCustomWords(input, dictRadix);
    }

    protected HebrewAnalyzer() throws IOException {
        lemmaFilter = new BasicLemmaFilter();
    }
View Full Code Here

TOP

Related Classes of com.code972.elasticsearch.rest.action.RestHebrewAnalyzerCheckWordAction

Copyright © 2018 www.massapicom. 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.