fromSymbol = e.getLabelSymbol(fromTable); } else if (from.hasLabel(fromTable)) { fromSymbol = from.getLabelSymbol(fromTable); propSymbol = union(fromSymbol, to.getLabelSymbol(toTable)); } else { if (forSet.size() == 0 || forSet.contains(fromSymbol)) {
protected void copyDynamicInput(DependencyStructure source, DependencyStructure target) throws MaltChainedException { for (int index : source.getTokenIndices()) { DependencyNode snode = source.getDependencyNode(index); DependencyNode tnode = target.getDependencyNode(index); for (SymbolTable table : snode.getLabelTypes()) { if (!tnode.hasLabel(table)) { tnode.addLabel(table,snode.getLabelSymbol(table)); } } } } }
public void copyPartialDependencyStructure(DependencyStructure sourceGraph, DependencyStructure targetGraph) throws MaltChainedException { SymbolTable partHead = cachedSource.getSymbolTables().getSymbolTable("PARTHEAD"); SymbolTable partDeprel = cachedSource.getSymbolTables().getSymbolTable("PARTDEPREL"); if (partHead == null || partDeprel == null) { return; } SymbolTable deprel = cachedTarget.getSymbolTables().getSymbolTable("DEPREL"); for (int index : sourceGraph.getTokenIndices()) { DependencyNode snode = sourceGraph.getTokenNode(index); DependencyNode tnode = targetGraph.getTokenNode(index); if (snode != null && tnode != null) { int spartheadindex = Integer.parseInt(snode.getLabelSymbol(partHead)); String spartdeprel = snode.getLabelSymbol(partDeprel); if (spartheadindex > 0) { Edge tedge = targetGraph.addDependencyEdge(spartheadindex, snode.getIndex()); tedge.addLabel(deprel, spartdeprel); } } } }
public void copyTerminalStructure(TokenStructure sourceGraph, TokenStructure targetGraph) throws MaltChainedException { targetGraph.clear(); for (int index : sourceGraph.getTokenIndices()) { DependencyNode gnode = sourceGraph.getTokenNode(index); DependencyNode pnode = targetGraph.addTokenNode(gnode.getIndex()); for (SymbolTable table : gnode.getLabelTypes()) { pnode.addLabel(table, gnode.getLabelSymbol(table)); } } if (sourceGraph.hasComments()) { for (int i = 1; i <= sourceGraph.nTokenNode() + 1; i++) { ArrayList<String> commentList = sourceGraph.getComment(i); if (commentList != null) { for (int j = 0; j < commentList.size();j++) { targetGraph.addComment(commentList.get(j), i); } } } } }
try { SymbolTable symbolTable = tableHandler.getSymbolTable(column.getName()); int head1 = Integer.parseInt(node1.getLabelSymbol(symbolTable)); int head2 = Integer.parseInt(node2.getLabelSymbol(symbolTable)); if (!node1.isRoot() && head1 == node2.getIndex()) { featureValue.setIndexCode(table.getSymbolStringToCode("LEFT"));
if (!column.isInternal()) { if (column.getCategory() == ColumnDescription.INPUT) { columns[i] = gnode.getLabelSymbol(sourceGraph.getSymbolTables().getSymbolTable(column.getName())); } else if (column.getCategory() == ColumnDescription.HEAD) { if (gnode.hasHead()) {
DependencyNode node = (DependencyNode)a.getAddress(); try { int index = Integer.parseInt(node.getLabelSymbol(tableHandler.getSymbolTable(column.getName()))); if (node.isRoot()) { featureValue.setIndexCode(table.getNullValueCode(NullValueId.ROOT_NODE));