}
//if(surface.matches("([Pp]oly).+")) features.add("polymer");
//if(surface.matches(".+\\(\\d\\d\\d+\\)")) features.add("surfacenotation");
Token t = state.procDoc.getTokenByStart(annot.getAttributeValue("from"));
if(fPrevious && t != null) {
Token tt = t.getNAfter(-1);
if(tt != null) {
for(int i=1;i<=1;i++) {
if(TokenTypes.isRef(tt) && tt.getNAfter(-1) != null) {
// features.add(prefix + "skiprefprev");
tt = tt.getNAfter(-1);
}
String ttv = tt.getValue();
ttv = ttv.replaceAll("\\s+", "_");
//if(i == 1) features.add("prev" + 1 + "=" + ttv);
features.add("pbg" + i + "=" + ttv + "_" + surface.replaceAll("\\s+", "_"));
//features.add("pbg" + (i+1) + "=" + ttv + "_" + surface.replaceAll("\\s+", "_"));
//features.add("pbg" + 0 + "=" + ttv + "_" + surface.replaceAll("\\s+", "_"));
//features.add("uibg" + 0 + "=" + ttv + "_" + surface.replaceAll("\\s+", "_"));
tt = tt.getNAfter(-1);
if(tt == null) break;
}
//if(ttv.length() > 4) features.add("prevs=" + ttv.substring(ttv.length()-4) + "_" + surface.replaceAll("\\s+", "_"));
//features.add("psbg=" + ttv + "_" + suffix.replaceAll("\\s+", "_"));
//features.add("pstbg=" + ttv + "_" + stem);
}
}
t = state.procDoc.getTokenByEnd(annot.getAttributeValue("to"));
if(fNext && t != null) {
Token tt = t.getNAfter(1);
//if(tt != null && tt.getValue().equals("-")) {
// tt = t.getNAfter(2);
//}
if(tt != null) {
for(int i=1;i<=1;i++) {
if(TokenTypes.isRef(tt) && tt.getNAfter(1) != null) {
tt = tt.getNAfter(1);
}
String ttv = tt.getValue();
ttv = ttv.replaceAll("\\s+", "_");
//if(i == 1) features.add("next=" + ttv);
features.add("nbg" + i + "=" + surface.replaceAll("\\s+", "_") + "_" + ttv);
//features.add("uibg" + 0 + "=" + ttv + "_" + surface.replaceAll("\\s+", "_"));
tt = tt.getNAfter(1);
if(tt == null) break;
}
//if(ttv.length() > 4) features.add("nexts=" + surface.replaceAll("\\s+", "_") + "_" + ttv.substring(ttv.length()-4));
//features.add("nsbg=" + suffix.replaceAll("\\s+", "_") + "_" + ttv);
//features.add("nstbg=" + stem + "_" + ttv);