Package org.fnlp.ml.types

Examples of org.fnlp.ml.types.DynamicInfo


    ArrayList<DynamicInfo> al = new ArrayList<DynamicInfo>();
    StringBuffer word = new StringBuffer();
    String pos = null;
    if(p > 0) {
      if(isEndLabel(target[p - 1]))
        al.add(new DynamicInfo("", "", 0));
      else
        pos = getLabelName(target[p - 1]);
    }
    for(int l = p - 1; l >= 0; l--) {
      String s = target[l];
      int index = s.indexOf("-");
      String t = index < 0 ? s : s.substring(0, index)
      if(t.equals("S") || t.equals("E")) {
        if(pos != null) {
          word.reverse();
          al.add(new DynamicInfo(pos, word.toString(), word.toString().length()));
          if(al.size() > DynamicTemplet.MAX)
            break;
        }
        pos = index < 0 ? t : s.substring(index + 1, s.length());
        word = new StringBuffer();
      }
      word.append(data[l][0]);
    }
    if(al.size() <= DynamicTemplet.MAX && pos != null) {
      word.reverse();
      al.add(new DynamicInfo(pos, word.toString(), word.toString().length()));
    }
    return al;
  }
View Full Code Here

TOP

Related Classes of org.fnlp.ml.types.DynamicInfo

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.