* @param rules The head rules for the parser.
* @return The new parent node of this node and the specified sister node.
*/
public Parse adjoin(Parse sister, HeadRules rules) {
Parse lastChild = parts.get(parts.size()-1);
Parse adjNode = new Parse(this.text,new Span(lastChild.getSpan().getStart(),sister.getSpan().getEnd()),lastChild.getType(),1,rules.getHead(new Parse[]{lastChild,sister},lastChild.getType()));
adjNode.parts.add(lastChild);
if (sister.prevPunctSet != null) {
adjNode.parts.addAll(sister.prevPunctSet);
}
adjNode.parts.add(sister);
parts.set(parts.size()-1,adjNode);
this.span = new Span(span.getStart(),sister.getSpan().getEnd());
this.head = rules.getHead(getChildren(),type);
this.headIndex = head.headIndex;
return adjNode;
}