Package edu.stanford.nlp.util

Examples of edu.stanford.nlp.util.IntPair


          double val = Double.parseDouble(line.substring(0, indSp));

          if (indSp < line.length()) {
            line = line.substring(indSp + 1);
          }
          arrIndexes[current] = instanceIndex.indexOf(new IntPair(x, y));
          arrValues[current] = val;
          current++;
        }
        int[] indValues = new int[current];
        double[] values = new double[current];
View Full Code Here


    domain = e;
  }


  int indexOf(int x, int y) {
    IntPair iP = new IntPair(x, y);
    return instanceIndex.indexOf(iP);
  }
View Full Code Here

  IntPair getPair(int index) {
    return instanceIndex.get(index);
  }

  int getXInstance(int index) {
    IntPair iP = getPair(index);
    return iP.get(0);
  }
View Full Code Here

    IntPair iP = getPair(index);
    return iP.get(0);
  }

  int getYInstance(int index) {
    IntPair iP = getPair(index);
    return iP.get(1);
  }
View Full Code Here

  }

  public void print(PrintStream pf) {
    for (int i = 0; i < indexedValues.length; i++) {
      IntPair iP = getPair(indexedValues[i]);
      int x = iP.get(0);
      int y = iP.get(1);
      // int y=indexedValues[i]-x*domain.ySize;
      pf.println(x + ", " + y + ' ' + valuesI[i]);
    }
  }
View Full Code Here

      // lexical leaves do not add any Constituents
      // but increment position
      // System.err.println("In bracketing trees leaf is " + label());

      CyclicCoreLabel l = (CyclicCoreLabel) label();
      l.set(SpanAnnotation.class, new IntPair(left, left));
      return (left + 1);
    }
    int position = left;

    // System.err.println("In bracketing trees left is " + left);
    // System.err.println("  label is " + label() +
    //                       "; num daughters: " + children().length);
    // enumerate through daughter trees
    Tree[] kids = children();
    for (int i = 0; i < kids.length; i++) {
      // compute bracketings for daughter tree
      // update position to end of daughter tree
      position = kids[i].constituentsNodes(position);
      // System.err.println("  position went to " + position);
    }
    // need to wait until result position is known in order to
    // calculate span of whole tree
    CyclicCoreLabel l = (CyclicCoreLabel) label();
    l.set(SpanAnnotation.class, new IntPair(left, position - 1));

    return position;
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.util.IntPair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.