Package org.apache.uima.tutorial

Examples of org.apache.uima.tutorial.RoomNumber


    // loop over patterns
    for (int i = 0; i < mPatterns.length; i++) {
      Matcher matcher = mPatterns[i].matcher(docText);
      while (matcher.find()) {
        // found one - create annotation
        RoomNumber annotation = new RoomNumber(aJCas);
        annotation.setBegin(matcher.start());
        annotation.setEnd(matcher.end());
        annotation.addToIndexes();
        annotation.setBuilding(mLocations[i]);
        getContext().getLogger().log(Level.FINEST, "Found: " + annotation);
      }
    }
  }
View Full Code Here


    String docText = aJCas.getDocumentText();
    // search for Yorktown room numbers
    Matcher matcher = mYorktownPattern.matcher(docText);
    while (matcher.find()) {
      // found one - create annotation
      RoomNumber annotation = new RoomNumber(aJCas);
      annotation.setBegin(matcher.start());
      annotation.setEnd(matcher.end());
      annotation.setBuilding("Yorktown");
      annotation.addToIndexes();
    }
    // search for Hawthorne room numbers
    matcher = mHawthornePattern.matcher(docText);
    while (matcher.find()) {
      // found one - create annotation
      RoomNumber annotation = new RoomNumber(aJCas);
      annotation.setBegin(matcher.start());
      annotation.setEnd(matcher.end());
      annotation.setBuilding("Hawthorne");
      annotation.addToIndexes();
    }
  }
View Full Code Here

    // loop over patterns
    for (int i = 0; i < mPatterns.length; i++) {
      Matcher matcher = mPatterns[i].matcher(docText);
      while (matcher.find()) {
        // found one - create annotation
        RoomNumber annotation = new RoomNumber(aJCas);
        annotation.setBegin(matcher.start());
        annotation.setEnd(matcher.end());
        annotation.addToIndexes();
        annotation.setBuilding(mLocations[i]);
        getContext().getLogger().log(Level.FINEST, "Found: " + annotation);
      }
    }
  }
View Full Code Here

    int lastMeetingEnd = -1;

    // iterate over all combinations
    Iterator roomNumberIter = roomNumberIndex.iterator();
    while (roomNumberIter.hasNext()) {
      RoomNumber room = (RoomNumber) roomNumberIter.next();

      Iterator dateIter = dateIndex.iterator();
      while (dateIter.hasNext()) {
        DateAnnot date = (DateAnnot) dateIter.next();

        Iterator time1Iter = timeIndex.iterator();
        while (time1Iter.hasNext()) {
          TimeAnnot time1 = (TimeAnnot) time1Iter.next();

          Iterator time2Iter = timeIndex.iterator();
          while (time2Iter.hasNext()) {
            TimeAnnot time2 = (TimeAnnot) time2Iter.next();

            // times must be different annotations
            if (time1 != time2) {
              // compute the begin and end of the span
              int minBegin = Math.min(Math.min(time1.getBegin(), time2.getBegin()), Math.min(date
                      .getBegin(), room.getBegin()));
              int maxEnd = Math.max(Math.max(time1.getEnd(), time2.getEnd()), Math.max(date
                      .getEnd(), room.getEnd()));

              // span must be smaller than the window size?
              if (maxEnd - minBegin < mWindowSize) {
                // span must not overlap the last annotation we made
                if (minBegin > lastMeetingEnd) {
View Full Code Here

TOP

Related Classes of org.apache.uima.tutorial.RoomNumber

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.