public String getStr() { String strValue = this.getForm(); boolean valid = false; while (!valid) { if (strValue.startsWith("-") || strValue.endsWith("-")) { strValue = strValue.replace("-", " - "); } else if (strValue.contains("--")) { strValue = strValue.replace("--", "-"); } else { valid = true; } } return strValue; }
public String getStr() { String strValue = this.getForm(); boolean valid = false; while (!valid) { if (strValue.startsWith("-") || strValue.endsWith("-")) { strValue = strValue.replace("-", " - "); } else if (strValue.contains("--")) { strValue = strValue.replace("--", "-"); } else { valid = true; } } return strValue; }
public String getSpanStr() { String str = ""; for (Term term : mentions.getTargets()) { if (!str.isEmpty()) { str += " "; } str += term.getForm(); } return str; }
public static void printToken(Appendable writer, Term token, int i, String last) throws IOException { writer.append(String.format("%d", i)).append("\t"); writer.append(token.getForm()).append("\t"); writer.append("_").append("\t"); writer.append(token.getForm()).append("\t"); writer.append("_").append("\t"); writer.append(token.getMorphofeat()).append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append(last); writer.append("\n"); }
public static void printToken(Appendable writer, Term token, int i, String last) throws IOException { writer.append(String.format("%d", i)).append("\t"); writer.append(token.getForm()).append("\t"); writer.append("_").append("\t"); writer.append(token.getForm()).append("\t"); writer.append("_").append("\t"); writer.append(token.getMorphofeat()).append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append(last); writer.append("\n"); }
public static void printToken(Appendable writer, Term token, int i, String last) throws IOException { writer.append(String.format("%d", i)).append("\t"); writer.append(token.getForm()).append("\t"); writer.append("_").append("\t"); writer.append(token.getForm()).append("\t"); writer.append("_").append("\t"); writer.append(token.getMorphofeat()).append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append("_").append("\t"); writer.append(last); writer.append("\n"); }
private void renderTerms(final Iterable<Markable> markables) throws IOException { final Markable[] markableIndex = indexMarkables(this.terms, markables); // open the TR row this.out.append("<tr class=\"txt_terms\">\n"); // emit the TD cells for each term, possibly adding entity / predicate highlighting for (int i = 0; i < this.terms.size(); ++i) { final Term term = this.terms.get(i); this.out.append("<td colspan=\"4\"><div class=\""); final Markable markable = markableIndex[i]; if (markable == null) { this.out.append("txt_term_c\">"); } else { final boolean start = i == 0 || markable != markableIndex[i - 1]; final boolean end = i == this.terms.size() - 1 || markable != markableIndex[i + 1]; this.out.append(start ? end ? "txt_term_lcr" : "txt_term_lc" : end ? "txt_term_cr" : "txt_term_c"); this.out.append("\" style=\"background-color: ").append(markable.color) .append("\">"); } this.out.append("<span class=\"txt_term_tip\" title=\""); emitTermTooltip(this.out, this.document, term); this.out.append("\">").append(term.getForm().replace(' ', '_')).append("</span>"); this.out.append("</div></td>\n"); } // close the TR row this.out.append("</tr>\n"); }
if ((!tokens[i].equals("(")) && (!tokens[i].equals(")"))) { if ((!tokens[i-1].equals("(")) && (!tokens[i-1].equals(")"))) { String termForm = terms.get(nextTerm).getForm(); String previousTermForm = ""; if (nextTerm != 0) { previousTermForm = terms.get(nextTerm-1).getForm(); nextTerm++; while (!matched && (nextTerm != terms.size())) { if (terms.get(nextTerm).getForm().equals(tokens[i])) { mapping.put(i, terms.get(nextTerm)); matched = true;
if ((!tokens[i].equals("(")) && (!tokens[i].equals(")"))) { if ((!tokens[i-1].equals("(")) && (!tokens[i-1].equals(")"))) { String termForm = terms.get(nextTerm).getForm(); String previousTermForm = ""; if (nextTerm != 0) { previousTermForm = terms.get(nextTerm-1).getForm(); nextTerm++; while (!matched && (nextTerm != terms.size())) { if (terms.get(nextTerm).getForm().equals(tokens[i])) { mapping.put(i, terms.get(nextTerm)); matched = true;
emitTermTooltip(out, document, term); out.append("\">"); out.append(term.getForm()); out.append("</span>");
for (int j = 0; j < neSpanSize; j++) { thisTerm = sentenceTerms.get(i + j); sb.append(thisTerm.getForm()); sb.append("\t"); sb.append(thisTerm.getLemma()); sb.append(thisTerm.getForm()); sb.append("\t"); sb.append(thisTerm.getLemma()); sb.append(thisTerm.getForm()); sb.append("\t"); sb.append(thisTerm.getLemma());
for (int j = 0; j < neSpanSize; j++) { thisTerm = sentenceTerms.get(i + j); sb.append(thisTerm.getForm()); sb.append("\t"); sb.append(thisTerm.getLemma()); sb.append(thisTerm.getForm()); sb.append("\t"); sb.append(thisTerm.getLemma()); i += neSpanSize - 1; } else { sb.append(thisTerm.getForm()); sb.append("\t"); sb.append(thisTerm.getLemma());
if (dep != null) { out.append(", ").append(dep.getRfunc()).append(" of '") .append(dep.getFrom().getForm().replace("\"", """)).append("' (") .append(dep.getFrom().getId()).append(")");