clojure-opennlp icon indicating copy to clipboard operation
clojure-opennlp copied to clipboard

IOException Mark invalid java.BufferedReader.reset (BufferedReader.java:505)

Open goldfeld opened this issue 12 years ago • 2 comments

I'm getting this error when I try to use the following sample code from the readme:

(with-open [rdr (clojure.java.io/reader "/tmp/bigfile")]
  (let [sentences (sentence-seq rdr get-sentences)]
    ;; process your lazy seq of sentences however you desire
    (println "first 5 sentences:")
    (clojure.pprint/pprint (take 5 sentences))))

My file exists and I'm able to do (slurp "/tmp/bigfile") I'm new to Clojure so I'm sorry if it's a basic java interop issue. Nevertheless I successfully imported the get-sentences and sentence-seq functions and have otherwise been able to use the library without problems.

goldfeld avatar Oct 20 '13 23:10 goldfeld

Cool, I'll look into it, thanks for reporting it!

dakrone avatar Oct 22 '13 16:10 dakrone

Hmm.. I'm unable to reproduce it:

user=> (with-open [rdr (clojure.java.io/reader "/tmp/bigfile")]
  #_=>   (let [sentences (sentence-seq rdr get-sentences)]
  #_=>     ;; process your lazy seq of sentences however you desire
  #_=>     (println "first 5 sentences:")
  #_=>     (clojure.pprint/pprint (take 5 sentences))))
first 5 sentences:
("this is a sentence."
 "this is a sentence."
 "this is a sentence."
 "this is a sentence."
 "this is a sentence.")
nil

What version of clojure-opennlp are you using? What are the contents of /tmp/bigfile?

dakrone avatar Oct 25 '13 08:10 dakrone