PartitionedTextExtractorInterface
interface \
- Extends
- StructuredTextExtractorInterface
A text extractor for documents which are indexed in several parts, such as the page ranges of a PDF. Every part becomes an index entry of its own.
Only PDF files are grouped by their parts in the search result, so this is no extension point for other file types.
Internal
Table of Contents
Methods
- extractStructuredText() : ExtractedText
- The actual text extraction, returning the text and the metadata of the resource
- getSupportedMimeTypes() : array<int, string>
- Lowercase MIME types which this extractor can currently handle. Generic detections, such as "application/zip" for a Word document, are resolved to the concrete MIME type by the file extension via $GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['mimeTypeCompatibility'], so an extractor does not need to declare them.
- withPartitionedDocument() : T
- Provides the document divided into parts to the callback. The file is read once for all parts which the callback extracts.
Methods
extractStructuredText()
The actual text extraction, returning the text and the metadata of the resource
public
extractStructuredText(SystemResourceInterface $resource) : ExtractedText
Parameters
- $resource : SystemResourceInterface
Return values
ExtractedTextgetSupportedMimeTypes()
Lowercase MIME types which this extractor can currently handle. Generic detections, such as "application/zip" for a Word document, are resolved to the concrete MIME type by the file extension via $GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['mimeTypeCompatibility'], so an extractor does not need to declare them.
public
getSupportedMimeTypes() : array<int, string>
An extractor depending on an external tool or on a PHP extension returns an empty list as long as that dependency is not available, so that consumers can list only the file types that are actually supported without having a resource at hand.
Return values
array<int, string>withPartitionedDocument()
Provides the document divided into parts to the callback. The file is read once for all parts which the callback extracts.
public
withPartitionedDocument(SystemResourceInterface $file, callable(PartitionedDocument): T $callback) : T
Parameters
- $file : SystemResourceInterface
- $callback : callable(PartitionedDocument): T