Джексон / apache nlp Не могу написать JSON - PullRequest
0 голосов
/ 12 октября 2019

Я продолжаю получать эти предупреждения, и после нескольких часов поиска я все еще не могу понять их источник:

2019-10-12 17:04:36.223  WARN 2170 --- [nio-5432-exec-9] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: The span [8..13) is outside the given text which has length 10!; nested exception is com.fasterxml.jackson.databind.JsonMappingException: The span [8..13) is outside the given text which has length 10! (through reference chain: RestNER.parse_input["content"])]
2019-10-12 17:04:36.297  WARN 2170 --- [nio-5432-exec-4] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: The span [41..49) is outside the given text which has length 41!; nested exception is com.fasterxml.jackson.databind.JsonMappingException: The span [41..49) is outside the given text which has length 41! (through reference chain: RestNER.parse_input["content"])]
2019-10-12 17:04:36.956  WARN 2170 --- [nio-5432-exec-2] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: The span [48..54) is outside the given text which has length 51!; nested exception is com.fasterxml.jackson.databind.JsonMappingException: The span [48..54) is outside the given text which has length 51! (through reference chain: RestNER.parse_input["content"])]

Я смог точно указать его на эту строку кода:

String[] tokens = this.tokenizer.tokenize(sentence);

Где токенизатор является экземпляром opennlp.tools.tokenize.TokenizerME;, а предложение является строкой ... Любая помощь будет оценена

...