Package org.apache.uima.jcas

Examples of org.apache.uima.jcas.JFSIndexRepository


    String text = jcas.getDocumentText();

    try {
      if (useSegments) {
        JFSIndexRepository indexes = jcas.getJFSIndexRepository();
        Iterator segmentItr = indexes.getAnnotationIndex(Segment.type)
            .iterator();
        while (segmentItr.hasNext()) {
          Segment segmentAnnotation = (Segment) segmentItr.next();
          String segmentID = segmentAnnotation.getId();
View Full Code Here


  /**
   * A utility method that annotates a given range.
   */
  protected void annotateRange(JCas jcas, String text, int rangeBegin,
      int rangeEnd) throws AnalysisEngineProcessException {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator tokenItr = indexes.getAnnotationIndex(BaseToken.type)
        .iterator();
    while (tokenItr.hasNext()) {
      BaseToken tokenAnnotation = (BaseToken) tokenItr.next();
      if (tokenAnnotation.getBegin() >= rangeBegin
          && tokenAnnotation.getEnd() <= rangeEnd) {
View Full Code Here

    */
   @Override
   public Iterator<LookupToken> getLookupTokenIterator( final JCas jcas ) throws AnnotatorInitializationException {
      final List<LookupToken> ltList = new ArrayList<LookupToken>();

      final JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      final AnnotationIndex<Annotation> annotationIndex = indexes.getAnnotationIndex( BaseToken.type );
      for ( Annotation annotation : annotationIndex ) {
         if ( !(annotation instanceof BaseToken) ) {
            iv_logger.warn( getClass().getName() + " getLookupTokenIterator(..) Annotation is not a BaseToken" );
            continue;
         }
View Full Code Here

   /**
    * {@inheritDoc}
    */
   @Override
   public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException {
      final JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      return indexes.getAnnotationIndex( Sentence.type ).iterator();
   }
View Full Code Here

      System.out.println(" jcas "+ jcas.getViewName());
      if (!useSegments) {
        // annotate over full doc text
        annotateRange(jcas, text, 0, text.length());
      } else {
        JFSIndexRepository indexes = jcas.getJFSIndexRepository();
        Iterator<?> segmentItr = indexes.getAnnotationIndex(
            Segment.type).iterator();
        while (segmentItr.hasNext()) {
          Segment segmentAnnotation = (Segment) segmentItr.next();
          String segmentID = segmentAnnotation.getId();
View Full Code Here

  protected void annotateRange(JCas jcas, String text, int rangeBegin,
      int rangeEnd) throws AnnotatorContextException {
    if (iv_logger.isInfoEnabled())
      iv_logger.info("started Sentence merging process.");

    JFSIndexRepository indexes = jcas.getJFSIndexRepository();

    Iterator<?> sentItr = indexes.getAnnotationIndex(Sentence.type)
        .iterator();
    Sentence prevSent = null;
    Sentence currSent = null;

    Map<Integer, Sentence> sentences = getSentencesOrderById(sentItr);
View Full Code Here

    try {
     
        iv_logger.info("process(JCas)");

      JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      Iterator<?> sentItr = indexes.getAnnotationIndex(Sentence.type).iterator();
      AnnotationIndex baseTokenIndex = jcas.getJFSIndexRepository().getAnnotationIndex(
          org.apache.ctakes.typesystem.type.syntax.BaseToken.type);
     
      while (sentItr.hasNext()) {
        Sentence sentAnnot = (Sentence) sentItr.next();
View Full Code Here

    return -1;// screams error!
  }

  private Segment getSegmentContainingOffsets(JCas jcas, int start, int end)
  {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator segmentItr = indexes.getAnnotationIndex(Segment.type).iterator();

    while (segmentItr.hasNext())
    {
      Segment seg = (Segment) segmentItr.next();
View Full Code Here

        boolean statusFound = false;
        if (!keepNoChangeStatus) {
          // All entries may not be appropriate, so some
          // filtering
          // may need to be implemented here
          JFSIndexRepository indexes = jcas.getJFSIndexRepository();
          Iterator subSectionItr = indexes.getAnnotationIndex(
              SubSectionAnnotation.type).iterator();

          String statusKey = null;
          while (subSectionItr.hasNext() && !statusFound)
          {
View Full Code Here

   * @param end
   * @return int[] - int[0] is begin offset and int[1] is end offset
   */
  private int[] getSentenceSpanContainingGivenSpan(JCas jcas, int begin, int end)
  {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator iter = indexes.getAnnotationIndex(Sentence.type).iterator();
    int[] span = new int[2];

    while (iter.hasNext())
    {
      Sentence sa = (Sentence) iter.next();
View Full Code Here

TOP

Related Classes of org.apache.uima.jcas.JFSIndexRepository

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.