Liking cljdoc? Tell your friends :D
Clojure only.

bosquet.read.document

Document reader wrapping Apache Tika parser https://tika.apache.org/

Tika supports lots of different file formats https://tika.apache.org/2.9.1/formats.html

parse function will use Tika capabilities to convert provided document data to a map containing text and metadata fields.

(parse (clojure.java.io/input-stream "data/memory.pdf"))
=>
{:text     "Memory, reasoning, and categorization: parallels and
common mechanisms
Brett K. ..."
 :metadata {:dc:creator "Brett K. Hayes"
            :dc:description "Traditionally, memory, reasoning, and categorization have been "}
Document reader wrapping Apache Tika parser
  https://tika.apache.org/

  Tika supports lots of different file formats
  https://tika.apache.org/2.9.1/formats.html

  `parse` function will use Tika capabilities to convert provided
  document data to a map containing `text` and `metadata` fields.

  ```clojure
  (parse (clojure.java.io/input-stream "data/memory.pdf"))
  =>
  {:text     "Memory, reasoning, and categorization: parallels and
common mechanisms
Brett K. ..."
   :metadata {:dc:creator "Brett K. Hayes"
              :dc:description "Traditionally, memory, reasoning, and categorization have been "}
  ```
raw docstring

parseclj

(parse stream-or-file-name)

Extract text and metadata from doc-input-stream. The stream can contain and data of a file formats supported by Tika. File format detection will be done automatcaly by Tika.

Returns a map with

  • text field containing document in a plain text format
  • metadata Dublin Core defined metadata fields if document has those defined
Extract text and metadata from `doc-input-stream`. The stream can contain
and data of a file formats supported by Tika. File format detection will be
done automatcaly by Tika.

Returns a map with
- `text` field containing document in a plain text format
- `metadata` Dublin Core defined metadata fields if document has those defined
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close