MCPcopy Create free account
hub / github.com/NanoNets/docstrange / extract_text

Method extract_text

docstrange/extractor.py:262–281  ·  view source on GitHub ↗

Convert plain text to internal format. Args: text: Plain text to extract Returns: ConversionResult containing the processed content

(self, text: str)

Source from the content-addressed store, hash-verified

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.

Callers 3

test_markdown_qualityFunction · 0.95
test_basic_functionalityFunction · 0.95

Calls 2

ConversionErrorClass · 0.85
ConversionResultClass · 0.85

Tested by 3

test_markdown_qualityFunction · 0.76
test_basic_functionalityFunction · 0.76