Package com.clearnlp.morphology

Examples of com.clearnlp.morphology.AbstractAffixMatcher


    String    pos = UTXml.getTrimmedAttribute(eAffix, ATTR_POS);
    String orgPOS = UTXml.getTrimmedAttribute(eAffix, ATTR_ORG_POS);
    Pattern  oPOS = orgPOS.equals(UNConstant.EMPTY) ? null : Pattern.compile("^("+orgPOS+")$");
   
    boolean bSuffix = type.equals(VAL_SUFFIX);
    AbstractAffixMatcher matcher;
   
    if (bSuffixmatcher = new EnglishSuffixMatcher(form, pos, oPOS);
    else      throw new IllegalArgumentException("Invalid affix type: "+type);
   
    NodeList list = eAffix.getElementsByTagName(ELEM_RULE);
    AbstractAffixReplacer replacer;
    int i, size = list.getLength();
   
    for (i=0; i<size; i++)
    {
      replacer = getAffixReplacer(bSuffix, (Element)list.item(i));
      if (replacer != null) matcher.addReplacer(replacer);
    }
   
    return matcher;
  }
View Full Code Here

TOP

Related Classes of com.clearnlp.morphology.AbstractAffixMatcher

Copyright © 2018 www.massapicom. 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.