dice-group / dice-group/gerbil

Exception when trying to print a result of FRED as NIF output

Open
#209 0 comments 0 reactions 1 assignee Claimed by @nikit-srivastava View on GitHub
type:bug
Dominant language
Java
Stars
231
Forks
55
PR merge metrics
No merged PRs in 30d

Description

## Problem

For some datasets, the result of FRED can not be printed as NIF file (e.g., for further analysis) because the printing crashes.
```
2017-08-14 17:35:13,600 [pool-1-thread-1] ERROR [org.aksw.gerbil.execute.AnnotatorOutputWriter] -
java.lang.IndexOutOfBoundsException
at java.lang.String.codePointCount(String.java:733)
at org.aksw.gerbil.io.nif.AnnotationWriter.addSpan(AnnotationWriter.java:72)
at org.aksw.gerbil.io.nif.DocumentWriter.writeDocumentToModel(DocumentWriter.java:67)
at org.aksw.gerbil.io.nif.DocumentListWriter.writeDocumentsToModel(DocumentListWriter.java:39)
at org.aksw.gerbil.io.nif.AbstractNIFWriter.createNIFModel(AbstractNIFWriter.java:42)
at org.aksw.gerbil.io.nif.AbstractNIFWriter.writeNIF(AbstractNIFWriter.java:60)
at org.aksw.gerbil.execute.AnnotatorOutputWriter.storeAnnotatorOutput(AnnotatorOutputWriter.java:63)
at org.aksw.gerbil.execute.ExperimentTask.runExperiment(ExperimentTask.java:398)
at org.aksw.gerbil.execute.ExperimentTask.run(ExperimentTask.java:136)
at org.aksw.simba.topicmodeling.concurrent.workers.WorkerImpl.run(WorkerImpl.java:44)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
It seems like FRED has created an annotation with a position that exceeds the length of the original text String.

## Solution
The writing of annotations should be able to handle such a problem, e.g., by logging the problem but still writing the annotation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.