Package org.apache.uima.tutorial

Examples of org.apache.uima.tutorial.Meeting


              // span must be smaller than the window size?
              if (maxEnd - minBegin < mWindowSize) {
                // span must not overlap the last annotation we made
                if (minBegin > lastMeetingEnd) {
                  // annotate
                  Meeting mtg = new Meeting(aJCas, minBegin, maxEnd, room, date, time1, time2);
                  mtg.addToIndexes();
                  lastMeetingEnd = maxEnd;
                }
              }
            }
          }
View Full Code Here


    List uimaMeetings = new ArrayList();

    FSIndex meetingIndex = aJCas.getAnnotationIndex(Meeting.type);
    FSIterator iter = meetingIndex.iterator();
    while (iter.isValid()) {
      Meeting meeting = (Meeting) iter.get();
      // get span of text within 50 chars on either side of meeting
      // (window size should probably be a config. param)
      int begin = meeting.getBegin() - 50;
      int end = meeting.getEnd() + 50;
      if (begin < 0) {
        begin = 0;
      }
      if (end > text.length()) {
        end = text.length();
      }
      String window = text.substring(begin, end);

      // look for UIMA acronyms within this window
      StringTokenizer tokenizer = new StringTokenizer(window, " \t\n\r.<.>/?\";:[{]}\\|=+()!");
      while (tokenizer.hasMoreTokens()) {
        String token = tokenizer.nextToken();
        // look up token in map to see if it is an acronym
        if (mMap.get(token) != null) {
          // create annotation
          UimaMeeting annot = new UimaMeeting(aJCas, meeting.getBegin(), meeting.getEnd(), meeting
                  .getRoom(), meeting.getDate(), meeting.getStartTime(), meeting.getEndTime());
          // Add annotation to a list, to be later added to the indexes.
          // We need to do this because it's not allowed to add to an
          // index that you're currently iterating over.
          uimaMeetings.add(annot);
          break;
View Full Code Here

TOP

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

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.