Examples of EnglishInflection


Examples of com.clearnlp.morphology.english.EnglishInflection

   
    Map<String,String> exceptionMap = (exceptionStream != null) ? UTInput.getStringMap(exceptionStream, PTLib.SPACE) : null;
    List<AbstractAffixMatcher> affixMatchers = new EnglishAffixMatcherFactory().createAffixMatchers(eAffixes);
    Set<String> baseSet = UTInput.getStringSet(baseStream);
   
    return new EnglishInflection(basePOS, baseSet, exceptionMap, affixMatchers);
  }
View Full Code Here

Examples of com.clearnlp.morphology.english.EnglishInflection

   
    Map<String,String> exceptionMap = (exceptionStream != null) ? UTInput.getStringMap(exceptionStream, PTLib.SPACE) : null;
    List<AbstractAffixMatcher> affixMatchers = new EnglishAffixMatcherFactory().createAffixMatchers(eAffixes);
    Set<String> baseSet = UTInput.getStringSet(baseStream);
   
    return new EnglishInflection(basePOS, baseSet, exceptionMap, affixMatchers);
  }
View Full Code Here

Examples of com.clearnlp.morphology.english.EnglishInflection

 
  public void evaluateInflection(InputStream in) throws Exception
  {
    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
    Map<String,Map<String,Prob2DMap>> smap = Maps.newHashMap();
    EnglishInflection inflection;
    String line, f, m, p;
    String[] t;
   
    while ((line = reader.readLine()) != null)
    {
      t = PTLib.splitTabs(line);
      f = t[0];
      m = t[1];
      p = t[2];
     
      if      (MPLibEn.isVerb(p))      inflection = inf_verb;
      else if (MPLibEn.isNoun(p))      inflection = inf_noun;
      else if (MPLibEn.isAdjective(p))  inflection = inf_adjective;
      else if (MPLibEn.isAdverb(p))    inflection = inf_adverb;
      else                continue;
     
      for (AbstractAffixMatcher matcher : inflection.getSuffixMatchers())
        ((EnglishSuffixMatcher)matcher).evaluateInflection(smap, inflection.getBaseSet(), m, f, p);
    }
   
    printEvaluation(smap);
  }
View Full Code Here

Examples of com.clearnlp.morphology.english.EnglishInflection

  {
    Map<String,String> exceptionMap = (exceptionStream != null) ? UTInput.getStringMap(exceptionStream, PTLib.SPACE) : null;
    List<AbstractAffixMatcher> affixMatchers = new EnglishAffixMatcherFactory().createAffixMatchers(eAffixes);
    Set<String> baseSet = UTInput.getStringSet(baseStream);
   
    return new EnglishInflection(basePOS, baseSet, exceptionMap, affixMatchers);
  }
View Full Code Here

Examples of com.clearnlp.morphology.english.EnglishInflection

 
  public void evaluateInflection(InputStream in) throws Exception
  {
    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
    Map<String,Map<String,Prob2DMap>> smap = Maps.newHashMap();
    EnglishInflection inflection;
    String line, f, m, p;
    String[] t;
   
    while ((line = reader.readLine()) != null)
    {
      t = PTLib.splitTabs(line);
      f = t[0];
      m = t[1];
      p = t[2];
     
      if      (MPLibEn.isVerb(p))      inflection = inf_verb;
      else if (MPLibEn.isNoun(p))      inflection = inf_noun;
      else if (MPLibEn.isAdjective(p))  inflection = inf_adjective;
      else if (MPLibEn.isAdverb(p))    inflection = inf_adverb;
      else                continue;
     
      for (AbstractAffixMatcher matcher : inflection.getSuffixMatchers())
        ((EnglishSuffixMatcher)matcher).evaluateInflection(smap, inflection.getBaseSet(), m, f, p);
    }
   
    printEvaluation(smap);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.