I believe that it comes down to a sequence of intervals being unioned using a reduceRight, which is not tail recursive. Changing to reduceLeft seems to fix the problem. Unfortunately, multiple dependencies are involved.
The problem can last be detected in this project at
|
val nxmlDoc: NxmlDocument = nxmlReader.read(nxml) |
which leads to the nxmlreader project
https://github.com/lum-ai/nxmlreader/blob/ef7e1440faf5dcae54cc046ba26825b08f1c84e1/src/main/scala/ai/lum/nxmlreader/standoff/Tree.scala#L57
and then to common
https://github.com/lum-ai/common/blob/b7c0b70c460790088d655a98be178cbef9767a24/src/main/scala/ai/lum/common/Interval.scala#L399