public boolean isSibling(Comma otherComma) { TreeView parseView; if (GOLD) parseView = (TreeView) s.goldTa.getView(ViewNames.PARSE_GOLD); else parseView = (TreeView) s.ta.getView(CONSTITUENT_PARSER); Constituent thisCommaConstituent = getCommaConstituentFromTree(parseView); Constituent otherCommmaConstituent = otherComma.getCommaConstituentFromTree(parseView); return TreeView.getParent(thisCommaConstituent) == TreeView .getParent(otherCommmaConstituent); }
public boolean isSibling(Comma otherComma) { TreeView parseView; if (GOLD) parseView = (TreeView) s.goldTa.getView(ViewNames.PARSE_GOLD); else parseView = (TreeView) s.ta.getView(CONSTITUENT_PARSER); Constituent thisCommaConstituent = getCommaConstituentFromTree(parseView); Constituent otherCommmaConstituent = otherComma.getCommaConstituentFromTree(parseView); return TreeView.getParent(thisCommaConstituent) == TreeView .getParent(otherCommmaConstituent); }
public Constituent getPhraseToRightOfParent(int distance) { TreeView parseView; if (GOLD) parseView = (TreeView) s.goldTa.getView(ViewNames.PARSE_GOLD); else parseView = (TreeView) s.ta.getView(CONSTITUENT_PARSER); Constituent comma = getCommaConstituentFromTree(parseView); Constituent parent = TreeView.getParent(comma); return getSiblingToRight(distance, parent, parseView); }
public Constituent getPhraseToLeftOfParent(int distance) { TreeView parseView; if (GOLD) parseView = (TreeView) s.goldTa.getView(ViewNames.PARSE_GOLD); else parseView = (TreeView) s.ta.getView(CONSTITUENT_PARSER); Constituent comma = getCommaConstituentFromTree(parseView); Constituent parent = TreeView.getParent(comma); return getSiblingToLeft(distance, parent, parseView); }
public Constituent getPhraseToLeftOfParent(int distance) { TreeView parseView; if (GOLD) parseView = (TreeView) s.goldTa.getView(ViewNames.PARSE_GOLD); else parseView = (TreeView) s.ta.getView(CONSTITUENT_PARSER); Constituent comma = getCommaConstituentFromTree(parseView); Constituent parent = TreeView.getParent(comma); return getSiblingToLeft(distance, parent, parseView); }
public Constituent getPhraseToRightOfParent(int distance) { TreeView parseView; if (GOLD) parseView = (TreeView) s.goldTa.getView(ViewNames.PARSE_GOLD); else parseView = (TreeView) s.ta.getView(CONSTITUENT_PARSER); Constituent comma = getCommaConstituentFromTree(parseView); Constituent parent = TreeView.getParent(comma); return getSiblingToRight(distance, parent, parseView); }
public String getBayraktarPattern(TreeView parseView) { String pattern; Constituent comma = getCommaConstituentFromTree(parseView); Constituent parent = TreeView.getParent(comma); if (!ParseTreeProperties.isPunctuationToken(parent.getLabel()) && ParseTreeProperties.isPreTerminal(parent)) { if (parent.getLabel().equals("CC")) pattern = parent.getSurfaceForm(); else pattern = "***"; } else pattern = parent.getLabel().split("-")[0]; pattern += " -->"; for (Relation childRelation : parent.getOutgoingRelations()) { Constituent child = childRelation.getTarget(); if (!POSUtils.isPOSPunctuation(child.getLabel()) && ParseTreeProperties.isPreTerminal(child)) { if (child.getLabel().equals("CC")) { pattern += " " + child.getSurfaceForm(); } else if (!pattern.endsWith("***")) pattern += " ***"; } else pattern += " " + ParseUtils.stripFunctionTags(child.getLabel()); } return pattern; }
public String getBayraktarPattern(TreeView parseView) { String pattern; Constituent comma = getCommaConstituentFromTree(parseView); Constituent parent = TreeView.getParent(comma); if (!ParseTreeProperties.isPunctuationToken(parent.getLabel()) && ParseTreeProperties.isPreTerminal(parent)) { if (parent.getLabel().equals("CC")) pattern = parent.getSurfaceForm(); else pattern = "***"; } else pattern = parent.getLabel().split("-")[0]; pattern += " -->"; for (Relation childRelation : parent.getOutgoingRelations()) { Constituent child = childRelation.getTarget(); if (!POSUtils.isPOSPunctuation(child.getLabel()) && ParseTreeProperties.isPreTerminal(child)) { if (child.getLabel().equals("CC")) { pattern += " " + child.getSurfaceForm(); } else if (!pattern.endsWith("***")) pattern += " ***"; } else pattern += " " + ParseUtils.stripFunctionTags(child.getLabel()); } return pattern; }