Tika 服务器 - 不带书签和图像标签的解析
Tika Server - Parse without bookmark and image tags
我正在使用 tika server v1.20
提取文本。
Tika在正文中添加[书签:xx]和[图片:xx]。我不要他们。
示例输出:
How the Gifted Brain Learns
David A. Sousa
[image: How the Gifted Brain Learns]
Welcome to our Third Annual GATE Family Book Study.
复制:
运行 服务器 -
java -jar tika-server-1.20.jar -p 5000
放置http://localhost:5000/tika
附加二进制文件和content-type
:application/vnd.openxmlformats-officedocument.wordprocessingml.document
使用正则表达式删除此标签\[(image:|bookmark:).*?\]
是有问题的,因为这样的情况:
[image: **[1].jpg]
如何使用tika服务器不产生这个标签?
如果不可能,如何删除它们?
虽然您可以在 Tika 中通过为 EmbeddedDocumentUtil 添加自定义 DocumentSelector 来覆盖它以在 ParseContext 中使用,但没有什么比目前在 tika-config.xml 中,也不在其命令行参数中。
顺便说一句,在 Tika 1.25 中出现的递归元数据端点有一个 header 设置,它允许您指定最大嵌入式递归(参见下面的示例)。但是,正如您想要的内容,这对您的情况没有帮助:
curl -T test_recursive_embedded.docx --header "maxEmbeddedResources: 0" http://localhost:9998/rmeta
根据您要处理的内容的哪一部分,有一个端点可能就是您要查找的内容。这是 /tika/main 端点。
curl -T website\ book\ study\ how\ the\ brain\ works\ building\ background1.docx http://localhost:9998/tika/main --header "Accept: text/plain"
这旨在复制 Tika 应用程序的 --text-main 功能,并使用专注于文件中主要内容的样板内容处理程序。因此,这不会处理嵌入的图像。
我正在使用 tika server v1.20
提取文本。
Tika在正文中添加[书签:xx]和[图片:xx]。我不要他们。
示例输出:
How the Gifted Brain Learns David A. Sousa [image: How the Gifted Brain Learns] Welcome to our Third Annual GATE Family Book Study.
复制:
运行 服务器 -
java -jar tika-server-1.20.jar -p 5000
放置http://localhost:5000/tika
附加二进制文件和content-type
:application/vnd.openxmlformats-officedocument.wordprocessingml.document
使用正则表达式删除此标签\[(image:|bookmark:).*?\]
是有问题的,因为这样的情况:
[image: **[1].jpg]
如何使用tika服务器不产生这个标签? 如果不可能,如何删除它们?
虽然您可以在 Tika 中通过为 EmbeddedDocumentUtil 添加自定义 DocumentSelector 来覆盖它以在 ParseContext 中使用,但没有什么比目前在 tika-config.xml 中,也不在其命令行参数中。
顺便说一句,在 Tika 1.25 中出现的递归元数据端点有一个 header 设置,它允许您指定最大嵌入式递归(参见下面的示例)。但是,正如您想要的内容,这对您的情况没有帮助:
curl -T test_recursive_embedded.docx --header "maxEmbeddedResources: 0" http://localhost:9998/rmeta
根据您要处理的内容的哪一部分,有一个端点可能就是您要查找的内容。这是 /tika/main 端点。
curl -T website\ book\ study\ how\ the\ brain\ works\ building\ background1.docx http://localhost:9998/tika/main --header "Accept: text/plain"
这旨在复制 Tika 应用程序的 --text-main 功能,并使用专注于文件中主要内容的样板内容处理程序。因此,这不会处理嵌入的图像。