funstaff / funstafftikabundle
FunstaffTikaBundle: Tika的包装器
dev-master
2013-04-02 11:56 UTC
Requires
- php: >=5.3.3
- monolog/monolog: 1.4.*
- symfony/framework-bundle: >=2.0,<2.3-dev
- symfony/monolog-bridge: >=2.0,<2.3-dev
- symfony/security-bundle: >=2.0,<2.3-dev
This package is auto-updated.
Last update: 2024-08-29 03:35:26 UTC
README
此包与Apache Tika一起工作。
配置
文件config.yml
funstaff_tika:
tika_path: /path/to/tika-app-1.0.jar
output_format: ~ # default: xml
output_encoding: ~ # default: UTF-8
logging: ~ # Use the Symfony2 default. Force the logging with this param.
示例
仅提取内容
$tika = $this->get('funstaff.tika')
->setOutputFormat('text')
->addDocument('foo', '/path/to/foo')
->extractContent();
仅提取元数据
$tika = $this->get('funstaff.tika')
...
->extractMetadata();
提取内容和元数据
$tika = $this->get('funstaff.tika')
...
->extractAll();
与数据一起工作
foreach ($tika->getDocuments() as $document) {
$content = $document->getContent();
$metadata = $document->getMetadata();
$author = $metadata->get('Author');
}
致谢
感谢所有提供反馈和提交代码的用户 https://github.com/Funstaff/FunstaffTikaBundle.