Package org.aksw.gerbil.io.nif.utils
Class NIFPositionHelper
java.lang.Object
org.aksw.gerbil.io.nif.utils.NIFPositionHelper
The positions in NIF are measured in codepoints, while Java counts in terms
of characters. This class offers methods to handle that problem.
- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckPositionsForConspicuity(List<Span> spans, String text) This method checks the givenSpaninstances for simple errors, e.g., markings that start or end with a whitespace instead of an alphanumeric character.static voidcorrectAnnotationPositions(Document document) The positions in NIF are measured in codepoints, while Java counts in terms of characters.private static voidprintWarning(String text, int start, int end, String warningMsg)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
NIFPositionHelper
public NIFPositionHelper()
-
-
Method Details
-
correctAnnotationPositions
The positions in NIF are measured in codepoints, while Java counts in terms of characters. So we have to correct the positions of the annotations.- Parameters:
document- theDocumentfor which the positions should be checked and corrected if necessary
-
checkPositionsForConspicuity
This method checks the givenSpaninstances for simple errors, e.g., markings that start or end with a whitespace instead of an alphanumeric character. If errors are found, a waring is printed. -
printWarning
-