Package org.apache.uima.jcas

Examples of org.apache.uima.jcas.JFSIndexRepository


    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

   * @param end
   * @return int[] - int[0] is begin offset and int[1] is end offset of subsequent sentence end (if available)
   */
private int[] getNarrativeSpansContainingGivenSpanType(JCas jcas, int begin, int annotType)
{
  JFSIndexRepository indexes = jcas.getJFSIndexRepository();
  Iterator iter = indexes.getAnnotationIndex(annotType).iterator();
  int[] span = new int[2];
  boolean foundFirstTypeSpan = false;
  boolean foundSecondTypeSpan = false;
  int spanSizeCount = 0;
  while (iter.hasNext() && !foundSecondTypeSpan)
View Full Code Here

   * @param begin
   * @param end
   * @return
   */
  private int [] findOffsetsInPattern(JCas jcas, int begin, int end, int elementType, int[][] location, boolean highest) {
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator neItr = indexes.getAnnotationIndex(elementType).iterator();//FSUtil.getAnnotationsInSpanIterator(jcas, elementType, begin, end);
    int [] lastLocation =  {-1,-1};
    boolean wantMuliple = true;
    if (elementType == StrengthUnitAnnotation.type) {
      while (neItr.hasNext() && wantMuliple) {
        StrengthUnitAnnotation nea = (StrengthUnitAnnotation) neItr.next();
View Full Code Here

      JCas jcas;
      if (iv_useCDAProcess)
        jcas = cas.getJCas().getView("plaintext");
      else
        jcas = cas.getJCas();
      JFSIndexRepository indexes = jcas.getJFSIndexRepository();
     
     FSIterator<TOP> documentIDIterator = indexes.getAllIndexedFS(DocumentID.type);
      if(documentIDIterator.hasNext())
      {
        DocumentID dia = (DocumentID)documentIDIterator.next();
        iv_sb.append(dia.getDocumentID());
      }
      else
      {
        iv_sb.append("Error in CasInitializer(?) NO_DOC_ID");
      }
     
      iv_sb.append(iv_delimiter);
     
      Iterator<?> docClsItr = indexes.getAnnotationIndex(SmokingDocumentClassification.type).iterator();
     
      //there should be just one SmokingDocumentClassification
      if (docClsItr.hasNext())
      {
        SmokingDocumentClassification dc = (SmokingDocumentClassification)docClsItr.next();
View Full Code Here

  throws AnalysisEngineProcessException;

  protected List<WordToken> getTokenData(JCas jcas, Annotation locationTerm)
  {
    List<WordToken> list = new ArrayList<WordToken>();
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator<?> annotItr = indexes.getAnnotationIndex(WordToken.type).iterator();
   
    while (annotItr.hasNext())
    {
      WordToken ann = (WordToken)annotItr.next();
View Full Code Here

  public String getSegmentIdContaining(Annotation ann, JCas jcas)
  {
    int begin = ann.getBegin();
    int end = ann.getEnd();
   
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator<?> secItr = indexes.getAnnotationIndex(SubSection.type).iterator();
     
    while(secItr.hasNext())
    {
      SubSection sa = (SubSection)secItr.next();
      if(sa.getBegin() <= begin && end <= sa.getEnd())
View Full Code Here

  }
 
  public int findOriginalReportSubSection( JCas jcas)
  {
   
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator<?> secItr = indexes.getAnnotationIndex(SubSection.type).iterator();
     
    while(secItr.hasNext())
    {
      SubSection sa = (SubSection)secItr.next();
View Full Code Here

public String getSubSectionStatus(Annotation ann, JCas jcas, int cutOff)
  {
    int begin = ann.getBegin();
    int end = ann.getEnd();
   
    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator<?> secItr = indexes.getAnnotationIndex(SubSection.type).iterator();
     
    while(secItr.hasNext())
    {
      SubSection sa = (SubSection) secItr.next();
      // Don't look in sections after a cut off revision point
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.