CategoryWordTag myLabel = new CategoryWordTag(lab); myLabel.setCategory(s); return tf.newTreeNode(myLabel, kidkids); CategoryWordTag myLabel = new CategoryWordTag(lab); myLabel.setCategory("NP"); return tf.newTreeNode(myLabel, newkids); return null; CategoryWordTag newLabel = new CategoryWordTag(lab); newLabel.setCategory(s); if (tag != null) { newLabel.setTag(tag);
/** * Returns a <code>String</code> representation of the label. * If the argument String is "full" then all components of the label * are returned, and otherwise the normal toString() is returned. * * @return The label as a string */ public String toString(String mode) { if ("full".equals(mode)) { return category() + "[" + word() + "/" + tag() + "]"; } return toString(); }
/** * Make a new label with this <code>String</code> as the "name". * * @param labelStr The string to use as a label * @return The newly created Label */ public Label newLabelFromString(String labelStr) { CategoryWordTag cwt = new CategoryWordTag(); cwt.setFromString(labelStr); return cwt; }
public void setCategoryWordTag(String category, String word, String tag) { setCategory(category); setWord(word); setTag(tag); }
/** * Make a new label with this <code>String</code> as the value. * This implementation ignores the options * * @param labelStr The String that will be used for balue * @param options This argument is ignored * @return The newly created Label */ public Label newLabel(String labelStr, int options) { return new CategoryWordTag(labelStr); }
/** * Returns a <code>String</code> representation of the label. * This attempts to be somewhat clever in choosing to print or * suppress null components and the details of words or categories * depending on the setting of <code>printWordTag</code> and * <code>suppressTerminalDetails</code>. * * @return The label as a string */ @Override public String toString() { if (category() != null) { if ((word() == null || tag() == null) || !printWordTag || (suppressTerminalDetails && (word().equals(category()) || tag().equals(category())))) { return category(); } else { return category() + "[" + word() + "/" + tag() + "]"; } } else { if (tag() == null) { return word(); } else { return word() + "/" + tag(); } } }
} else { CategoryWordTag headLabel = (CategoryWordTag) headChild.label(); word = headLabel.word(); tag = headLabel.tag(); Label label = new CategoryWordTag(cat, word, tag); t.setLabel(label);
public void setCategory(String category) { setValue(category); }
public String category() { return value(); }
/** * Create a new <code>CategoryWordTag Label</code>, where the label is * formed from * the <code>Label</code> object passed in. Depending on what fields * each label has, other things will be <code>null</code>. * * @param oldLabel The Label that the new label is being created from * @return a new label of a particular type */ public Label newLabel(Label oldLabel) { return new CategoryWordTag(oldLabel); }
public void setCategoryWordTag(String category, String word, String tag) { setCategory(category); setWord(word); setTag(tag); }
/** * Returns a <code>String</code> representation of the label. * This attempts to be somewhat clever in choosing to print or * suppress null components and the details of words or categories * depending on the setting of <code>printWordTag</code> and * <code>suppressTerminalDetails</code>. * * @return The label as a string */ @Override public String toString() { if (category() != null) { if ((word() == null || tag() == null) || !printWordTag || (suppressTerminalDetails && (word().equals(category()) || tag().equals(category())))) { return category(); } else { return category() + "[" + word() + "/" + tag() + "]"; } } else { if (tag() == null) { return word(); } else { return word() + "/" + tag(); } } }
} else { CategoryWordTag headLabel = (CategoryWordTag) headChild.label(); word = headLabel.word(); tag = headLabel.tag(); Label label = new CategoryWordTag(cat, word, tag); t.setLabel(label);
public void setCategory(String category) { setValue(category); }
public String category() { return value(); }
CategoryWordTag newLabel = new CategoryWordTag(lab); newLabel.setCategory(s); if (lab instanceof HasTag) { String tag = ((HasTag) lab).tag(); tag = treebankLanguagePack().basicCategory(tag); newLabel.setTag(tag);
/** * Returns a <code>String</code> representation of the label. * If the argument String is "full" then all components of the label * are returned, and otherwise the normal toString() is returned. * * @return The label as a string */ public String toString(String mode) { if ("full".equals(mode)) { return category() + "[" + word() + "/" + tag() + "]"; } return toString(); }
/** * Make a new label with this <code>String</code> as the "name". * * @param labelStr The string to use as a label * @return The newly created Label */ public Label newLabel(String labelStr) { return new CategoryWordTag(labelStr); }
public void setCategoryWordTag(String category, String word, String tag) { setCategory(category); setWord(word); setTag(tag); }
/** * Returns a <code>String</code> representation of the label. * This attempts to be somewhat clever in choosing to print or * suppress null components and the details of words or categories * depending on the setting of <code>printWordTag</code> and * <code>suppressTerminalDetails</code>. * * @return The label as a string */ @Override public String toString() { if (category() != null) { if ((word() == null || tag() == null) || !printWordTag || (suppressTerminalDetails && (word().equals(category()) || tag().equals(category())))) { return category(); } else { return category() + "[" + word() + "/" + tag() + "]"; } } else { if (tag() == null) { return word(); } else { return word() + "/" + tag(); } } }