/** @param form the lower simplified word-form. */ private String getBaseFormFromInflection(String form, String pos) { if (pos.startsWith(VERB_POS)) return inf_verb.getBaseForm(form, pos); if (pos.startsWith(NOUN_POS)) return inf_noun.getBaseForm(form, pos); if (pos.startsWith(ADJECTIVE_POS)) return inf_adjective.getBaseForm(form, pos); if (pos.startsWith(ADVERB_POS)) return inf_adverb.getBaseForm(form, pos); return 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 EnglishInflection(String basePOS, Set<String> baseSet, Map<String,String> exceptionMap, List<AbstractAffixMatcher> affixMatchers) { init(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); }
public String toVerb(String lemma) { Set<String> verbSet = inf_verb.getBaseSet(); return verbSet.contains(lemma) ? lemma : der_n2v.getBaseForm(null, null); } }
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); } }
/** @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; }
/** @param form the lower simplified word-form. */ private String getBaseFormFromInflection(String form, String pos) { if (pos.startsWith(VERB_POS)) return inf_verb.getBaseForm(form, pos); if (pos.startsWith(NOUN_POS)) return inf_noun.getBaseForm(form, pos); if (pos.startsWith(ADJECTIVE_POS)) return inf_adjective.getBaseForm(form, pos); if (pos.startsWith(ADVERB_POS)) return inf_adverb.getBaseForm(form, pos); return null; }
public EnglishInflection(String basePOS, Set<String> baseSet, Map<String,String> exceptionMap, List<AbstractAffixMatcher> affixMatchers) { init(basePOS, baseSet, exceptionMap, affixMatchers); }