Examples of BeginAndEndCharacterOffsetPair


Examples of org.mitre.medfacts.zoner.LineTokenToCharacterOffsetConverter.BeginAndEndCharacterOffsetPair

//       // 5802 would be the end of the word

    LineAndTokenPosition beginPosition = new LineAndTokenPosition();
    beginPosition.setLine(111);
    beginPosition.setTokenOffset(20);
    BeginAndEndCharacterOffsetPair firstWordPosition = c.convert(beginPosition);
    Integer beginActualOutputFirstCharacter = firstWordPosition.getBegin();
    Integer beginActualOutputLastCharacter = firstWordPosition.getEnd();

    assertEquals("111:20's output first character offset did not match", beginExpectedOutputFirstCharacter, beginActualOutputFirstCharacter);
    assertEquals("111:20's output last character offset did not match", beginExpectedOutputLastCharacter, beginActualOutputLastCharacter);


    Integer endExpectedOutputFirstCharacter = 5909; //5813;
    Integer endExpectedOutputLastCharacter = 5913;
       // 5909 would be the beginning of the word;
       // 5913 would be the end of the word
//       // 5813 would be the beginning of the word;
//       // 5817 would be the end of the word

    LineAndTokenPosition endPosition = new LineAndTokenPosition();
    endPosition.setLine(111);
    endPosition.setTokenOffset(23);
    BeginAndEndCharacterOffsetPair lastWordPosition = c.convert(endPosition);
    Integer endActualOutputFirstCharacter = lastWordPosition.getBegin();
    Integer endActualOutputLastCharacter = lastWordPosition.getEnd();

    assertEquals("111:23's output character offset did not match", endExpectedOutputFirstCharacter, endActualOutputFirstCharacter);
    assertEquals("111:23's output character offset did not match", endExpectedOutputLastCharacter, endActualOutputLastCharacter);
  }
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.