@Override public String getBaseForm(Set<String> baseSet, String form, String pos) { return matchesOriginalPOS(pos) ? getBaseForm(baseSet, form) : null; }
/** @param form the word-form in lower-case. */ public String getBaseForm(String form, String pos) { String token; if ((token = getBaseFormFromExceptions(form)) != null) return token; if ((token = getBaseFormFromSuffixes(form, pos)) != null) return token; return null; }
public EnglishDerivation(List<AbstractAffixMatcher> affixMatchers) { init(affixMatchers); }
@Override public String lemmatize(String simplifiedWordForm, String pos) { String lemma = StringUtils.toLowerCase(simplifiedWordForm), t; if ((t = getAbbreviation(lemma, pos)) != null || (t = getBaseFormFromInflection(lemma, pos)) != null) lemma = t; if (isCardinal(lemma)) return MetaConst.CARDINAL; else if (isOrdinal (lemma)) return MetaConst.ORDINAL; return lemma; }
/** 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); }
public String toVerb(String lemma) { Set<String> verbSet = inf_verb.getBaseSet(); return verbSet.contains(lemma) ? lemma : der_n2v.getBaseForm(null, null); } }
public EnglishInflection(String basePOS, Set<String> baseSet, Map<String,String> exceptionMap, List<AbstractAffixMatcher> affixMatchers) { init(basePOS, baseSet, exceptionMap, affixMatchers); }
public MorphologicalAnalyzer(Language language) { analyzer = new EnglishMorphAnalyzer(); }
@Override public String getBaseForm(Map<String,Set<String>> baseMap, String form) { return getBaseForm(baseMap.get(s_basePOS), form); }
@Override public String getBaseForm(Map<String,Set<String>> baseMap, String form, String pos) { if (!matchesOriginalPOS(pos)) return null; String base; for (AbstractAffixReplacer replacer : l_replacers) { base = replacer.getBaseForm(baseMap, form); if (base != null) return base; } return null; }
@Override public String lemmatize(String simplifiedWordForm, String pos) { String lemma = StringUtils.toLowerCase(simplifiedWordForm), t; if ((t = getAbbreviation(lemma, pos)) != null || (t = getBaseFormFromInflection(lemma, pos)) != null) lemma = t; if (isCardinal(lemma)) return MetaConst.CARDINAL; else if (isOrdinal (lemma)) return MetaConst.ORDINAL; return lemma; }
/** 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); }
@Override public String getBaseForm(Set<String> baseSet, String form, String pos) { return matchesOriginalPOS(pos) ? getBaseForm(baseSet, form) : null; }
/** @param form the word-form in lower-case. */ public String getBaseForm(String form, String pos) { String token; if ((token = getBaseFormFromExceptions(form)) != null) return token; if ((token = getBaseFormFromSuffixes(form, pos)) != null) return token; return null; }
public String toVerb(String lemma) { Set<String> verbSet = inf_verb.getBaseSet(); return verbSet.contains(lemma) ? lemma : der_n2v.getBaseForm(null, null); } }
public EnglishDerivation(List<AbstractAffixMatcher> affixMatchers) { init(affixMatchers); }
public EnglishInflection(String basePOS, Set<String> baseSet, Map<String,String> exceptionMap, List<AbstractAffixMatcher> affixMatchers) { init(basePOS, baseSet, exceptionMap, affixMatchers); }
public MorphologicalAnalyzer(Language language) { analyzer = new EnglishMorphAnalyzer(); }