Package org.mitre.medfacts.zoner

Examples of org.mitre.medfacts.zoner.CharacterOffsetToLineTokenConverterDefaultImpl.convert()


          AnnotationIndex<Annotation> aIndex = jcas.getAnnotationIndex(assertionType);
          for (Annotation a : aIndex) {
            Assertion ai = (Assertion) a;
            int begin = ai.getBegin();
            int end = ai.getEnd();
            LineAndTokenPosition begPos = converter.convert(begin);
            LineAndTokenPosition endPos = converter.convert(end);
            writer.println("c=\"" + sofaString.substring(begin,end) + "\" " + begPos.getLine() + ":" + begPos.getTokenOffset() +
                " " + endPos.getLine() + ":" + endPos.getTokenOffset() + "||t=\"problem\"||a=\"" + ai.getAssertionType() + "\"");
          }
          writer.close();
View Full Code Here


          for (Annotation a : aIndex) {
            Assertion ai = (Assertion) a;
            int begin = ai.getBegin();
            int end = ai.getEnd();
            LineAndTokenPosition begPos = converter.convert(begin);
            LineAndTokenPosition endPos = converter.convert(end);
            writer.println("c=\"" + sofaString.substring(begin,end) + "\" " + begPos.getLine() + ":" + begPos.getTokenOffset() +
                " " + endPos.getLine() + ":" + endPos.getTokenOffset() + "||t=\"problem\"||a=\"" + ai.getAssertionType() + "\"");
          }
          writer.close();
        } catch (Exception e) {
View Full Code Here

    }

    public void addConceptAnnotation(int startCharOffset, int endCharOffset, String typ, ConceptTypeParam conceptType) {
      CharacterOffsetToLineTokenConverter converter = new CharacterOffsetToLineTokenConverterDefaultImpl(wholeText);

      LineAndTokenPosition startLineAndTokenPosition = converter.convert(startCharOffset);
      LineAndTokenPosition endLineAndTokenPosition = converter.convert(endCharOffset);

      ConceptAnnotation conceptAnnotation = new ConceptAnnotation();

      Location beginLocation = new Location();
View Full Code Here

    public void addConceptAnnotation(int startCharOffset, int endCharOffset, String typ, ConceptTypeParam conceptType) {
      CharacterOffsetToLineTokenConverter converter = new CharacterOffsetToLineTokenConverterDefaultImpl(wholeText);

      LineAndTokenPosition startLineAndTokenPosition = converter.convert(startCharOffset);
      LineAndTokenPosition endLineAndTokenPosition = converter.convert(endCharOffset);

      ConceptAnnotation conceptAnnotation = new ConceptAnnotation();

      Location beginLocation = new Location();
      beginLocation.setLine(startLineAndTokenPosition.getLine());
View Full Code Here

          AnnotationIndex<Annotation> aIndex = jcas.getAnnotationIndex(assertionType);
          for (Annotation a : aIndex) {
            Assertion ai = (Assertion) a;
            int begin = ai.getBegin();
            int end = ai.getEnd();
            LineAndTokenPosition begPos = converter.convert(begin);
            LineAndTokenPosition endPos = converter.convert(end);
            writer.println("c=\"" + sofaString.substring(begin,end) + "\" " + begPos.getLine() + ":" + begPos.getTokenOffset() +
                " " + endPos.getLine() + ":" + endPos.getTokenOffset() + "||t=\"problem\"||a=\"" + ai.getAssertionType() + "\"");
          }
          writer.close();
View Full Code Here

          for (Annotation a : aIndex) {
            Assertion ai = (Assertion) a;
            int begin = ai.getBegin();
            int end = ai.getEnd();
            LineAndTokenPosition begPos = converter.convert(begin);
            LineAndTokenPosition endPos = converter.convert(end);
            writer.println("c=\"" + sofaString.substring(begin,end) + "\" " + begPos.getLine() + ":" + begPos.getTokenOffset() +
                " " + endPos.getLine() + ":" + endPos.getTokenOffset() + "||t=\"problem\"||a=\"" + ai.getAssertionType() + "\"");
          }
          writer.close();
        } catch (Exception e) {
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.