Code example for InputSource

0
        } 
 
        URL hyphenationPatternsFile = env.resolveConfig(hyphenationPatternsPath);
 
        try { 
            hyphenationTree = HyphenationCompoundWordTokenFilter.getHyphenationTree(new InputSource(hyphenationPatternsFile.toExternalForm()));
        } catch (Exception e) {
            throw new ElasticSearchIllegalArgumentException("Exception while reading hyphenation_patterns_path: " + e.getMessage());
        } 
    } 
 
    @Override 
    public TokenStream create(TokenStream tokenStream) {
        return new HyphenationCompoundWordTokenFilter(version, tokenStream,
                hyphenationTree, wordList,
                minWordSize, minSubwordSize, maxSubwordSize, onlyLongestMatch); 
    } 
}