/** Called by {@link #EnglishMPAnalyzer(ZipFile)}. */ private EnglishDerivation getDerivationalRules(Element eDerivation, String type) throws IOException { Element eAffixes = XMLUtils.getFirstElementByTagName(eDerivation, type); return new EnglishDerivation(new EnglishAffixMatcherFactory().createAffixMatchers(eAffixes)); }
/** Called by {@link #EnglishMPAnalyzer(ZipFile)}. */ private EnglishDerivation getDerivationalRules(Element eDerivation, String type) throws IOException { Element eAffixes = XMLUtils.getFirstElementByTagName(eDerivation, type); return new EnglishDerivation(new EnglishAffixMatcherFactory().createAffixMatchers(eAffixes)); }
private EnglishInflection getInflection(InputStream baseStream, InputStream exceptionStream, Element eAffixes, String basePOS) throws IOException { Map<String,String> exceptionMap = (exceptionStream != null) ? DSUtils.createStringHashMap(exceptionStream, Splitter.T_SPACE) : null; List<AbstractAffixMatcher> affixMatchers = new EnglishAffixMatcherFactory().createAffixMatchers(eAffixes); Set<String> baseSet = DSUtils.createStringHashSet(baseStream); return new EnglishInflection(basePOS, baseSet, exceptionMap, affixMatchers); }
private EnglishInflection getInflection(InputStream baseStream, InputStream exceptionStream, Element eAffixes, String basePOS) throws IOException { Map<String,String> exceptionMap = (exceptionStream != null) ? DSUtils.createStringHashMap(exceptionStream, Splitter.T_SPACE) : null; List<AbstractAffixMatcher> affixMatchers = new EnglishAffixMatcherFactory().createAffixMatchers(eAffixes); Set<String> baseSet = DSUtils.createStringHashSet(baseStream); return new EnglishInflection(basePOS, baseSet, exceptionMap, affixMatchers); }