Package com.code972.elasticsearch.plugins

Examples of com.code972.elasticsearch.plugins.HebrewExactAnalyzerProvider


        this(input, dict, null, null, null);
    }


    public StreamLemmasFilter(final Reader input, final DictRadix<MorphData> dict, final HashMap<String,Integer> pref, DictRadix<Byte> specialTokenizationCases, final CharArraySet commonWords, final LemmaFilterBase lemmaFilter) {
        this(input, new DictHebMorph(dict,pref), null, commonWords, lemmaFilter);
    }
View Full Code Here


            if (allowHeHasheela) {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_H);
            } else {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_NOH);
            }
            dict = new DictHebMorph(radix, prefs);
        }
        return dict;
    }
View Full Code Here

        // Verify the cached counter equals to the count of elements retrieved by actual enumeration,
        // and that the nodes are alphabetically sorted
        int enCount = 0;
        String nodeText = "";
        RadixEnumerator en = (RadixEnumerator) d.iterator();
        while (en.hasNext()) {
            en.next();
            assertTrue(cSharpStringCompare(nodeText, en.getCurrentKey()) < 0);
            nodeText = en.getCurrentKey();
            enCount++;
        }
        assertEquals(counter.val, enCount);

        assertEquals(d.lookup("abcdefg"), abcdefgValue);
View Full Code Here

public abstract class TestBase {
    private static DictHebMorph dict;

    protected synchronized DictHebMorph getDictionary(boolean allowHeHasheela) throws IOException {
        if (dict == null) {
            DictRadix<MorphData> radix = new HSpellLoader(new File(HSpellLoader.getHspellPath()), true).loadDictionaryFromHSpellData();
            HashMap<String, Integer> prefs = null;
            if (allowHeHasheela) {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_H);
            } else {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_NOH);
View Full Code Here

public abstract class TestBase {
    private static DictHebMorph dict;

    protected synchronized DictHebMorph getDictionary(boolean allowHeHasheela) throws IOException {
        if (dict == null) {
            DictRadix<MorphData> radix = new HSpellLoader(new File(HSpellLoader.getHspellPath()), true).loadDictionaryFromHSpellData();
            HashMap<String, Integer> prefs = null;
            if (allowHeHasheela) {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_H);
            } else {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_NOH);
View Full Code Here

        return synonymMap.build();
    }

    static private DictRadix<MorphData> loadFromClasspath(final String pathInClasspath) {
        try {
            HSpellLoader loader = new HSpellLoader(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 {
            HSpellLoader loader = new HSpellLoader(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");
        }
        HSpellLoader loader = new HSpellLoader(new File(hspellPath), true);
        return loader.loadDictionaryFromHSpellData();
    }
View Full Code Here

public abstract class BaseTokenStreamWithDictionaryTestCase extends BaseTokenStreamTestCase {
    private static DictHebMorph dict;

    protected synchronized DictHebMorph getDictionary(boolean allowHeHasheela) throws IOException {
        if (dict == null) {
            DictRadix<MorphData> radix = new HSpellLoader(new File(HSpellLoader.getHspellPath()), true).loadDictionaryFromHSpellData();
            HashMap<String, Integer> prefs = null;
            if (allowHeHasheela) {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_H);
            } else {
                prefs = HSpellLoader.readPrefixesFromFile(HSpellLoader.getHspellPath() + HSpellLoader.PREFIX_NOH);
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

TOP

Related Classes of com.code972.elasticsearch.plugins.HebrewExactAnalyzerProvider

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.