Exemplo n.º 1
0
  @Deprecated
  public IntOpenHashSet getNonProjectiveSet() {
    IntObjectOpenHashMap<IntOpenHashSet> map = new IntObjectOpenHashMap<IntOpenHashSet>();
    int i, j, bIdx, eIdx, size = size();
    DEPNode curr, head, dep;

    for (i = 1; i < size; i++) {
      curr = get(i);
      head = curr.getHead();

      if (curr.id < head.id) {
        bIdx = curr.id;
        eIdx = head.id;
      } else {
        bIdx = head.id;
        eIdx = curr.id;
      }

      for (j = bIdx + 1; j < eIdx; j++) {
        curr = get(j);
        head = curr.getHead();

        if (head.id < bIdx || head.id > eIdx) {
          addNonProjectiveMap(map, i, j);
          addNonProjectiveMap(map, j, i);
        }

        for (DEPArc arc : curr.getDependents()) {
          dep = arc.getNode();

          if (dep.id < bIdx || dep.id > eIdx) {
            addNonProjectiveMap(map, i, dep.id);
            addNonProjectiveMap(map, dep.id, i);
          }
        }
      }
    }

    return getNonProjectiveMapAux(map);
  }