Apache Open Source Project--tika

Source: Internet
Author: User

Tika is a collection of tools for content extraction (a toolkit for text extracting). It integrates the POI, PDFBox and provides a unified interface for text extraction work. Second, Tika also provides a convenient extension API to enrich its support for third-party file formats.

In the current version of 0.2-snapshot, Tika provides support for the following file formats:

  • PDF-Via PDFBox
  • ms-*-Via POI
  • HTML-use nekohtml to defragment an irregular HTML into XHTML
  • OpenOffice Format-Tika offers
  • Archive-zip, TAR, gzip, bzip, etc.
  • Rtf-tika offers
  • Java Class-class parsing is done by ASM
  • Image-only meta-data extraction for images is supported
  • Xml

The Tika API is very handy, and the core is parser interface, which defines a parse method:
public void parse(InputStream stream, ContentHandler handler, Metadata metadata)
Use the stream parameter to pass the file stream that needs to be parsed, the text content is passed into the handler, and the metadata is updated to metadata.

You can use the Tika parserutils tool to get an appropriate parser based on the file to mime-type parse the work. Or Tika also provides a autodetectparser to find the right parser, depending on the particular format of the binary file (for example, Magic Code).

Apache Open Source Project--tika

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.