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;
}