Skip to content
Prev 246446 / 398502 Next

openNLP package error

Apologies that I am late on this thread.
On 02/12/10 17:39, Sascha Wolfer wrote:
The correct syntax seems to be

sentDetect(s, model = system.file("models", "de-sent.bin", package = "openNLPmodels.de"))


but unfortunately I get

Error in .jcall(.jnew("opennlp/maxent/io/SuffixSensitiveGISModelReader",  :
   java.io.UTFDataFormatException: malformed input around byte 48


YMMV.  But you get the idea on the syntax of the model= argument.  This 
"works":

sentDetect(s, model = system.file("models", "sentdetect", "EnglishSD.bin.gz", package = "openNLPmodels.en"))
# [1] "Das hier ist ein Satz. "                            
# [2] "Und hier ist noch einer - sogar mit Gedankenstrich. "
# [3] "Ist das nicht toll?"


Hope this helps you a little.

Allan