public class JCoReCondensedDocumentText extends Object
| Constructor and Description |
|---|
JCoReCondensedDocumentText(org.apache.uima.jcas.JCas cas,
Set<String> cutAwayTypes)
Cuts away the covered text of annotations of a type in cutAwayTypes
from the cas document text.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildMap(org.apache.uima.jcas.JCas cas,
Set<String> cutAwayTypes)
Creates a map that maps those positions of the small-cut text that correspond
to an intermediate next position after a cut-away annotation in the original
text to the sum of ranges covered by cut-away annotations up to the original
offset.
|
org.apache.uima.jcas.JCas |
getCas() |
String |
getCodensedText() |
int |
getCondensedOffsetForOriginalOffset(int originalOffset)
Given a character offset relative to the original CAS document text, this method
returns the corresponding offset in the condensed document text.
|
int |
getOriginalOffsetForCondensedOffset(int condensedOffset)
Given a character offset relative to the condensed document text, this method
returns the corresponding offset in the original CAS document text.
|
public JCoReCondensedDocumentText(org.apache.uima.jcas.JCas cas,
Set<String> cutAwayTypes)
throws ClassNotFoundException
Cuts away the covered text of annotations of a type in cutAwayTypes from the cas document text. If cutAwayTypes is null or empty, this class' methods will return the original CAS data.
cas - The CAS for which the document text should be cut.cutAwayTypes - The types for cutting. May be null.ClassNotFoundException - If cutAwayTypes contains non-existing type names.public org.apache.uima.jcas.JCas getCas()
public void buildMap(org.apache.uima.jcas.JCas cas,
Set<String> cutAwayTypes)
throws ClassNotFoundException
Creates a map that maps those positions of the small-cut text that correspond to an intermediate next position after a cut-away annotation in the original text to the sum of ranges covered by cut-away annotations up to the original offset.
If cutAwayTypes is empty, no work will be done and the methods of this class we return the original text and offets of the CAS.
cas - The CAS for create a cut-away document text for.cutAwayTypes - The qualified type names of the annotations whose covered text
should be cut away.ClassNotFoundException - If cutAwayTypes contains type identifiers to
non-existing types.public int getOriginalOffsetForCondensedOffset(int condensedOffset)
condensedOffset - The character offset in the condensed document text string.public int getCondensedOffsetForOriginalOffset(int originalOffset)
originalOffset - The character offset in the originalOffset document CAS text string.public String getCodensedText()
Copyright © 2018 JULIE Lab Jena, Germany. All rights reserved.