Examples of moveToFirst()


Examples of org.apache.uima.cas.FSIterator.moveToFirst()

      FSIndex tokenIndex = cas.getAnnotationIndex(tokenType);
      FSIterator tokenIt = tokenIndex.iterator();
      // Create a counter.
      int theCount = 0;
      // Iterate over the tokens.
      for (tokenIt.moveToFirst(); tokenIt.isValid(); tokenIt.moveToNext()) {
        AnnotationFS tok = (AnnotationFS) tokenIt.get();
        if (tok.getStringValue(lemmaFeat).equals(lemma)) {
          ++theCount;
          // System.out.println("Found token: " + tok.getCoveredText());
        }
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

      ArrayList path = new ArrayList();
      path.add(tokenTypeFeat.getShortName());
      FSMatchConstraint cons = cf.embedConstraint(path, tc);
      it = this.cas.createFilteredIterator(it, cons);
      int count = 0;
      for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
        ++count;
      }
      assertTrue(count == 4);

    } catch (Exception e) {
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    assertTrue(down == 0);

    // Get all indexed, create copy and iterate in parallel.
    it = getAllIndexed();
    FSIterator copy = it.copy();
    copy.moveToFirst();
    for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
      assertTrue(copy.isValid());
      assertTrue(it.get().equals(copy.get()));
      copy.moveToNext();
    }
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    FSIterator it = this.cas.getIndexRepository().getIndex(TYPE_ORDER_INDEX).iterator();

    // it = cas.getAnnotationIndex().iterator();
    AnnotationFS fs;
    for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
      fs = (AnnotationFS) it.get();
      fileWriter.write(
       fs.getType().getName()
       + ": "
       + fs.getBegin()
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    // assert(it != null);
    // Now create sentences. We do this as follows: a sentence starts where
    // the first token after an EOS starts, and ends with an EOS.
    long time = System.currentTimeMillis();
    int endOfSentenceCounter = 0;
    it.moveToFirst();
    boolean lookForStart = true;
    int start = 0, end; // Initialize start to pacify compiler.
    FeatureStructure tokenFS, sentFS;
    while (it.isValid()) {
      if (lookForStart) {
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    // /////////////////////////////////////////////////////////////////////////
    // Use an iterator to move forwards and backwards and make sure the
    // sequence
    // remains constant.
    it = setIndex.iterator();
    it.moveToFirst(); // This is redundant.
    current = 1;
    // System.out.println("Codes: " + v);
    while (current < (v.size() - 1)) {
      it.moveToNext();
      assertTrue(it.isValid());
View Full Code Here

Examples of org.apache.uima.internal.util.ComparableIntPointerIterator.moveToFirst()

      // Set all iterators to insertion point.
      int i = 0;
      while (i <= lvi) {
        final ComparableIntPointerIterator it = this.indexes[i];
        it.resetConcurrentModification();
        it.moveToFirst();
        if (it.isValid()) {
          heapify_up(it, i, 1);
          ++i;
        } else {
          // swap this iterator with the last possibly valid one
View Full Code Here

Examples of org.apache.uima.internal.util.ComparableIntPointerIterator.moveToFirst()

          // greater than the current element.
          final ComparableIntPointerIterator it = checkConcurrentModification(i);
          // If the iterator we're considering is not valid, we
          // set it to the first element. This should be it for this iterator...
          if (!it.isValid()) {
            it.moveToFirst();
          }
          // Increment the iterator while it is valid and pointing
          // at something smaller than the current element.
          while (it.isValid() && is_before(it, it0, 1)) {
            it.inc();
View Full Code Here

Examples of org.apache.uima.internal.util.ComparableIntPointerIterator.moveToFirst()

      // Set all iterators to insertion point.
      int i = 0;
      while (i <= lvi) {
        final ComparableIntPointerIterator it = this.indexes[i];
        it.resetConcurrentModification();
        it.moveToFirst();
        if (it.isValid()) {
          heapify_up(it, i, 1);
          ++i;
        } else {
          // swap this iterator with the last possibly valid one
View Full Code Here

Examples of org.apache.uima.internal.util.ComparableIntPointerIterator.moveToFirst()

          // greater than the current element.
          final ComparableIntPointerIterator it = checkConcurrentModification(i);
          // If the iterator we're considering is not valid, we
          // set it to the first element. This should be it for this iterator...
          if (!it.isValid()) {
            it.moveToFirst();
          }
          // Increment the iterator while it is valid and pointing
          // at something smaller than the current element.
          while (it.isValid() && is_before(it, it0, 1)) {
            it.inc();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.