@@ -384,6 +384,7 @@ def _validate_fallback_languages(
384384 value : Optional [list [str ]],
385385) -> Optional [list [str ]]:
386386 """Validate and normalize language_fallback return value to ISO 639-3 codes.
387+
387388 Returns None for None, non-list, or when no valid codes remain (invalid entries
388389 are logged and skipped).
389390 """
@@ -417,12 +418,13 @@ def detect_languages(
417418 Detects the list of languages present in the text (in the default "auto" mode),
418419 or formats and passes through the user inputted document languages if provided.
419420
420- For short ASCII text (fewer than 5 words), language detection is unreliable. By default
421- such text is assigned English (["eng"]). Use ``language_fallback`` to override:
422- pass a callable that takes the text and returns a list of ISO 639-3 codes or None.
423- Return None to leave language unspecified. The caller is responsible for returning
424- valid ISO 639-3 codes (e.g. "eng", "fra"); invalid entries are filtered out and
425- a warning is logged; if none remain, this function returns None.
421+ For short ASCII text (fewer than 5 words), language detection is unreliable. By
422+ default such text is assigned English (["eng"]). Use ``language_fallback`` to
423+ override: pass a callable that takes the text and returns a list of ISO 639-3
424+ codes or None. Return None to leave language unspecified. The caller is
425+ responsible for returning valid ISO 639-3 codes (e.g. "eng", "fra"); invalid
426+ entries are filtered out and a warning is logged; if none remain, this function
427+ returns None.
426428 """
427429 if languages is None :
428430 languages = ["auto" ]
0 commit comments