static public IntOpenHashSet intersection(IntContainer c1, IntContainer c2) { IntOpenHashSet s1 = new IntOpenHashSet(c1); IntOpenHashSet s2 = new IntOpenHashSet(c2); s1.retainAll(s2); return s1; }
static public IntOpenHashSet intersection(IntContainer c1, IntContainer c2) { IntOpenHashSet s1 = new IntOpenHashSet(c1); IntOpenHashSet s2 = new IntOpenHashSet(c2); s1.retainAll(s2); return s1; }
static public IntOpenHashSet intersection(IntContainer c1, IntContainer c2) { IntOpenHashSet s1 = new IntOpenHashSet(c1); IntOpenHashSet s2 = new IntOpenHashSet(c2); s1.retainAll(s2); return s1; }
public IntOpenHashSet getSubIdSet() { IntOpenHashSet set = new IntOpenHashSet(); getSubIdSetAux(set, this); return set; }
public void addEdge(int from, int to) { int max = Math.max(from, to); while (max >= successors.size()) { successors.add(new IntOpenHashSet(1)); predecessors.add(new IntOpenHashSet(1)); } successors.get(from).add(to); predecessors.get(to).add(from); }
private void init(DEPTree tree) { initPrimitives(); l_branches = Lists.newArrayList(); l_states = Lists.newArrayList(); l_2ndHeads = Lists.newArrayList(); n_2ndPos = new double[t_size]; s_reduce = new IntOpenHashSet(); int i; for (i=0; i<t_size; i++) l_2ndHeads.add(new ArrayList<DEPHead>()); }
private void init(DEPTree tree) { initPrimitives(); l_branches = Lists.newArrayList(); l_states = Lists.newArrayList(); l_2ndHeads = Lists.newArrayList(); n_2ndPos = new double[t_size]; s_reduce = new IntOpenHashSet(); int i; for (i=0; i<t_size; i++) l_2ndHeads.add(new ArrayList<DEPHead>()); }
public SRLState(DEPTree tree) { super(tree); d_tree = tree; i_pred = 0; s_skip = new IntOpenHashSet(); l_argns = Lists.newArrayList(); m_argns = Maps.newHashMap(); m_refs = Maps.newHashMap(); initArcs(tree); }
private void init(DEPTree tree) { initPrimitives(); l_branches = Lists.newArrayList(); l_states = Lists.newArrayList(); l_2ndHeads = Lists.newArrayList(); n_2ndPos = new double[t_size]; s_reduce = new IntOpenHashSet(); int i; for (i=0; i<t_size; i++) l_2ndHeads.add(new ArrayList<DEPHead>()); }
public SRLState(DEPTree tree) { super(tree); d_tree = tree; i_pred = 0; s_skip = new IntOpenHashSet(); l_argns = Lists.newArrayList(); m_argns = Maps.newHashMap(); m_refs = Maps.newHashMap(); initArcs(tree); }
private int[] withoutCopies(int[] nodesWithCopies) { IntSet visited = new IntOpenHashSet(); int[] nodes = new int[nodesWithCopies.length]; int sz = 0; for (int node : nodesWithCopies) { node = nodeOriginals.get(node); if (visited.add(node)) { nodes[sz++] = node; } } return Arrays.copyOf(nodes, sz); }
private IntSet nodesToCopy() { IntSet result = new IntOpenHashSet(); for (int node : nodes.toArray()) { if (node == head || (node != bodyStart && !dom.dominates(bodyStart, node))) { result.add(node); } } return result; }
/** * Returns a set of terminal IDs belonging to this argument given the specific tree. * @param tree the constituent tree. * @return a set of terminal IDs belonging to this argument. */ public IntOpenHashSet getTerminalIdSet(CTTree tree) { IntOpenHashSet set = new IntOpenHashSet(); for (PBLoc loc : l_locs) set.addAll(tree.getNode(loc).getSubTerminalIdSet()); return set; }
/** * Returns a set of terminal IDs belonging to this argument given the specific tree. * @param tree the constituent tree. * @return a set of terminal IDs belonging to this argument. */ public IntOpenHashSet getTerminalIdSet(CTTree tree) { IntOpenHashSet set = new IntOpenHashSet(); for (PBLoc loc : l_locs) set.addAll(tree.getNode(loc).getSubTerminalIdSet()); return set; }
public IntOpenHashSet getSubTerminalIdSet() { IntOpenHashSet set = new IntOpenHashSet(); for (CTNode node : getSubTerminals()) set.add(node.getTerminalId()); return set; }
/** * Returns a set of terminal IDs belonging to this argument given the specific tree. * @param tree the constituent tree. * @return a set of terminal IDs belonging to this argument. */ public IntOpenHashSet getTerminalIdSet(CTTree tree) { IntOpenHashSet set = new IntOpenHashSet(); for (PBLoc loc : l_locs) set.addAll(tree.getNode(loc).getSubTerminalIdSet()); return set; }
private BitSet[] createBitSets( ObjectObjectOpenHashMap<String, IntOpenHashSet> wordDocMapping, String[] wordset) { IntOpenHashSet hashSets[] = new IntOpenHashSet[wordset.length]; IntOpenHashSet mergedHashSet = new IntOpenHashSet(); for (int i = 0; i < hashSets.length; ++i) { hashSets[i] = wordDocMapping.get(wordset[i]); mergedHashSet.addAll(hashSets[i]); } return createBitSets(hashSets, mergedHashSet); }
/** Returns the set of terminal IDs associated with this argument. */ private IntOpenHashSet getTerminalIdSet(PBArg arg, CTTree tree) { IntOpenHashSet set = new IntOpenHashSet(); for (PBLoc loc : arg.getLocs()) { if (!loc.isType(";")) set.addAll(tree.getNode(loc).getSubTerminalIdSet()); } return set; }
/** Returns the set of terminal IDs associated with this argument. */ private IntOpenHashSet getTerminalIdSet(PBArg arg, CTTree tree) { IntOpenHashSet set = new IntOpenHashSet(); for (PBLoc loc : arg.getLocs()) { if (!loc.isType(";")) set.addAll(tree.getNode(loc).getSubTerminalIdSet()); } return set; }
/** Returns the set of terminal IDs associated with this argument. */ private IntOpenHashSet getTerminalIdSet(PBArg arg, CTTree tree) { IntOpenHashSet set = new IntOpenHashSet(); for (PBLoc loc : arg.getLocs()) { if (!loc.isType(";")) set.addAll(tree.getNode(loc).getSubTerminalIdSet()); } return set; }