Convert plain text to internal format. Args: text: Plain text to extract Returns: ConversionResult containing the processed content
(self, text: str)
| 260 | return url_processor.process(url) |
| 261 | |
| 262 | def extract_text(self, text: str) -> ConversionResult: |
| 263 | """Convert plain text to internal format. |
| 264 | |
| 265 | Args: |
| 266 | text: Plain text to extract |
| 267 | |
| 268 | Returns: |
| 269 | ConversionResult containing the processed content |
| 270 | """ |
| 271 | # Cloud mode doesn't support text conversion |
| 272 | if self.cloud_mode: |
| 273 | raise ConversionError("Text conversion is not supported in cloud mode. Use local mode for text processing.") |
| 274 | |
| 275 | metadata = { |
| 276 | "content_type": "text", |
| 277 | "processor": "TextConverter", |
| 278 | "preserve_layout": self.preserve_layout |
| 279 | } |
| 280 | |
| 281 | return ConversionResult(text, metadata) |
| 282 | |
| 283 | def is_cloud_enabled(self) -> bool: |
| 284 | """Check if cloud processing is enabled and configured. |