Skip to content

Commit

Permalink
bug fix to avoid NPE, issue #65
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStroetgen committed Nov 2, 2017
1 parent d0bb539 commit 7290d49
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ public List<Sentence> sentenceTokenize(JCas jcas) {
*/
if(!tokIt.hasNext() ||
(t.getCoveredText().matches("[.:!\\?]+") &&
(!((tOld.getCoveredText().matches("[\\d]+")) || ((jcas.getDocumentText().substring(t.getEnd()).length() > 2) && (jcas.getDocumentText().substring(t.getEnd(),t.getEnd()+3)).matches(" [A-Z][.-]")))))){
(!((tOld != null && tOld.getCoveredText().matches("[\\d]+")) ||
((jcas.getDocumentText().substring(t.getEnd()).length() > 2) && (jcas.getDocumentText().substring(t.getEnd(),t.getEnd()+3)).matches(" [A-Z][.-]")))))){
// ((!(tOld.getCoveredText().matches("[\\d]+")))) && (!((jcas.getDocumentText().substring(t.getEnd())).matches("^[\\s]*"))))) {
// (t.getCoveredText().matches("[.:!\\?]+") && (!(tOld.getCoveredText().matches("[\\d]+"))))) { // das funktioniert ok
sentenceStarted = false;
Expand Down

0 comments on commit 7290d49

Please sign in to comment.