/** * Computes the head parses for this parse and its sub-parses and stores this information * in the parse data structure. * * @param rules The head rules which determine how the head of the parse is computed. */ public void updateHeads(HeadRules rules) { if (parts != null && parts.size() != 0) { for (int pi = 0, pn = parts.size(); pi < pn; pi++) { Parse c = parts.get(pi); c.updateHeads(rules); } this.head = rules.getHead(parts.toArray(new Parse[parts.size()]), type); if (head == null) { head = this; } else { this.headIndex = head.headIndex; } } else { this.head = this; } }
public void add(Parse daughter, HeadRules rules) { if (daughter.prevPunctSet != null) { parts.addAll(daughter.prevPunctSet); } parts.add(daughter); this.span = new Span(span.getStart(),daughter.getSpan().getEnd()); this.head = rules.getHead(getChildren(),type); this.headIndex = head.headIndex; }
public Parse adjoinRoot(Parse node, HeadRules rules, int parseIndex) { Parse lastChild = parts.get(parseIndex); Parse adjNode = new Parse(this.text,new Span(lastChild.getSpan().getStart(), node.getSpan().getEnd()),lastChild.getType(),1, rules.getHead(new Parse[]{lastChild,node},lastChild.getType())); adjNode.parts.add(lastChild); if (node.prevPunctSet != null) { adjNode.parts.addAll(node.prevPunctSet); } adjNode.parts.add(node); parts.set(parseIndex,adjNode); return adjNode; }
/** * Sister adjoins this node's last child and the specified sister node and returns their * new parent node. The new parent node replace this nodes last child. * * @param sister The node to be adjoined. * @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; }
p2.getSpan().getEnd()), type, 1, headRules.getHead(cons, type)); chunk.isChunk(true); newParses[si].insert(chunk);
/** * Computes the head parses for this parse and its sub-parses and stores this information * in the parse data structure. * * @param rules The head rules which determine how the head of the parse is computed. */ public void updateHeads(HeadRules rules) { if (parts != null && parts.size() != 0) { for (int pi = 0, pn = parts.size(); pi < pn; pi++) { Parse c = parts.get(pi); c.updateHeads(rules); } this.head = rules.getHead(parts.toArray(new Parse[parts.size()]), type); if (head == null) { head = this; } else { this.headIndex = head.headIndex; } } else { this.head = this; } }
/** * Computes the head parses for this parse and its sub-parses and stores this information * in the parse data structure. * * @param rules The head rules which determine how the head of the parse is computed. */ public void updateHeads(HeadRules rules) { if (parts != null && parts.size() != 0) { for (int pi = 0, pn = parts.size(); pi < pn; pi++) { Parse c = parts.get(pi); c.updateHeads(rules); } this.head = rules.getHead(parts.toArray(new Parse[parts.size()]), type); if (head == null) { head = this; } else { this.headIndex = head.headIndex; } } else { this.head = this; } }
public void add(Parse daughter, HeadRules rules) { if (daughter.prevPunctSet != null) { parts.addAll(daughter.prevPunctSet); } parts.add(daughter); this.span = new Span(span.getStart(),daughter.getSpan().getEnd()); this.head = rules.getHead(getChildren(),type); this.headIndex = head.headIndex; }
public void add(Parse daughter, HeadRules rules) { if (daughter.prevPunctSet != null) { parts.addAll(daughter.prevPunctSet); } parts.add(daughter); this.span = new Span(span.getStart(),daughter.getSpan().getEnd()); this.head = rules.getHead(getChildren(),type); this.headIndex = head.headIndex; }
public Parse adjoinRoot(Parse node, HeadRules rules, int parseIndex) { Parse lastChild = parts.get(parseIndex); Parse adjNode = new Parse(this.text,new Span(lastChild.getSpan().getStart(), node.getSpan().getEnd()),lastChild.getType(),1, rules.getHead(new Parse[]{lastChild,node},lastChild.getType())); adjNode.parts.add(lastChild); if (node.prevPunctSet != null) { adjNode.parts.addAll(node.prevPunctSet); } adjNode.parts.add(node); parts.set(parseIndex,adjNode); return adjNode; }
public Parse adjoinRoot(Parse node, HeadRules rules, int parseIndex) { Parse lastChild = parts.get(parseIndex); Parse adjNode = new Parse(this.text,new Span(lastChild.getSpan().getStart(), node.getSpan().getEnd()),lastChild.getType(),1, rules.getHead(new Parse[]{lastChild,node},lastChild.getType())); adjNode.parts.add(lastChild); if (node.prevPunctSet != null) { adjNode.parts.addAll(node.prevPunctSet); } adjNode.parts.add(node); parts.set(parseIndex,adjNode); return adjNode; }
/** * Sister adjoins this node's last child and the specified sister node and returns their * new parent node. The new parent node replace this nodes last child. * * @param sister The node to be adjoined. * @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; }
/** * Sister adjoins this node's last child and the specified sister node and returns their * new parent node. The new parent node replace this nodes last child. * * @param sister The node to be adjoined. * @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; }
p2.getSpan().getEnd()), type, 1, headRules.getHead(cons, type)); chunk.isChunk(true); newParses[si].insert(chunk);
p2.getSpan().getEnd()), type, 1, headRules.getHead(cons, type)); chunk.isChunk(true); newParses[si].insert(chunk);