Skip to content

duke-libraries/tika-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tika::App

Ruby bindings for Tika (tika-app.jar).

Compatible with Tika 1.9.

Installation

Add this line to your application's Gemfile:

gem 'tika-app'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tika-app

Configuration

Set path to Tika jar file:

Tika::App.path = "/path/to/tika-app.jar"

Alternatively, you can set the TIKA_APP environment variable to the jar file path.

Usage

>> require "tika/app"
 => true

>> resource = Tika::Resource.new("README.md")
 => #<Tika::Resource:0x007f996a04fbe0 @file="README.md", @app=#<Tika::App:0x007f996a04fb68 @path="/path/to/tika-app.jar">, @opts={}> 

>> resource.metadata
 => {"Content-Encoding"=>"ISO-8859-1", "Content-Length"=>"580", "Content-Type"=>"text/plain; charset=ISO-8859-1", "X-Parsed-By"=>["org.apache.tika.parser.DefaultParser", "org.apache.tika.parser.txt.TXTParser"], "resourceName"=>"README.md"} 

>> resource.language
 => "en" 

>> resource.content_type
 => "text/x-web-markdown" 

>> resource.text
 => "# Tika::App\n\nRuby bindings for Tika command-line API.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'tika-app'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install tika-app\n\n## Usage\n\nTODO: Write usage instructions here\n\n## Contributing\n\n1. Fork it ( https://github.com/[my-github-username]/tika-app/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request" 

Contributing

  1. Fork it ( https://github.com/[my-github-username]/tika-app/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Ruby bindings for Tika (tika-app.jar)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages