Skip to content

Commit

Permalink
Version 2.6.2.
Browse files Browse the repository at this point in the history
Add exception handling. Although the issue observed was eventually solved in the xml-mapper.
  • Loading branch information
khituras committed Feb 20, 2024
1 parent d2c96cd commit 1abde17
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions jcore-jsbd-ae/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<version>2.6.1</version>
</parent>

<version>2.6.2-SNAPSHOT</version>

<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,16 @@ public void process(JCas aJCas) throws AnalysisEngineProcessException {
while (start < end && (Character.isWhitespace(documentText.getCodensedText().charAt(start))))
++start;

// get the string between the current annotation borders and recognized sentences
String textSpan = documentText.getCodensedText().substring(start, end);
if (!StringUtils.isBlank(textSpan))
doSegmentation(documentText, textSpan, start);
String textSpan;
try {
// get the string between the current annotation borders and recognized sentences
textSpan = documentText.getCodensedText().substring(start, end);
} catch (Exception e) {
LOGGER.error("Document text boundary error. Tried to get substring from {} to {} for text \"{}\". Text condensation is {}", start, end, documentText.getCodensedText(), cutAwayTypes != null && !cutAwayTypes.isEmpty());
throw e;
}
if (!StringUtils.isBlank(textSpan))
doSegmentation(documentText, textSpan, start);
}

} catch (ClassNotFoundException e) {
Expand Down

0 comments on commit 1abde17

Please sign in to comment.