Rand Stats

The uploading author of cpan:AZAWAWI does not match the META author of github:azawawi.

Tika

cpan:AZAWAWI

Tika

Build Status Build status

This is a Perl 6 library for using the Apache Tika Server REST API. Apache Tika server JAR is already included. You just need to install Java runtime or JDK to be able to use it.

Example

use v6;
use Tika;

my $t = TikaWrapper.new;
$t.start;

say "Found {$t.version} server";

say $t.parsers;
say $t.detectors;

my $filename     = 'demo.docx';
my $content-type = $t.mime-type($filename);
say "Detected stream type $content-type";

my $metadata = $t.meta($filename, $content-type);
say "Metadata for $filename:\n{$t._truncate($metadata, 40)}";

my $text = $t.text($filename, $content-type);
say "Found {$text.chars} plain text";

my $language = $t.language($text);
say "Detected language #{$language}";

For more examples, please take a look at examples.

Dependencies

Please follow the instructions for your platform to be able to install Java:

PlatformInstallation command
Debianapt-get install default-jre
macOSbrew tap caskroom/versions
brew cask install java8
WindowsInstall Oracle 8 Java SE from here.

Installation

$ zef install Tika

Testing

$ AUTHOR_TESTING=1 zef test --verbose .
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -e "perl6 -Ilib"

See Also

Author

Ahmad M. Zawawi, azawawi on #perl6.

License

MIT License