MCPcopy
hub / github.com/rspeer/python-ftfy / fix_text_segment

Function fix_text_segment

ftfy/__init__.py:609–620  ·  view source on GitHub ↗

Fix text as a single segment, with a consistent sequence of steps that are applied to fix the text. Discard the explanation.

(
    text: str, config: TextFixerConfig | None = None, **kwargs: Any
)

Source from the content-addressed store, hash-verified

607
608
609def fix_text_segment(
610 text: str, config: TextFixerConfig | None = None, **kwargs: Any
611) -> str:
612 """
613 Fix text as a single segment, with a consistent sequence of steps that
614 are applied to fix the text. Discard the explanation.
615 """
616 if config is None:
617 config = TextFixerConfig(explain=False)
618 config = _config_from_kwargs(config, kwargs)
619 fixed, _explan = fix_and_explain(text, config)
620 return fixed
621
622
623def fix_file(

Callers 1

test_entitiesFunction · 0.90

Calls 3

TextFixerConfigClass · 0.85
_config_from_kwargsFunction · 0.85
fix_and_explainFunction · 0.85

Tested by 1

test_entitiesFunction · 0.72