(doc: Doc, *, lang: Optional[str] = None)
return (
        coefs["base"]
        - (coefs["asl"] * n_words / n_sents)
        - (coefs["awl"] * n_syllables / n_words)
    )
Readability test used as a general-purpose standard in several languages, based on
    a weighted combination of avg. sentence length and avg. word length. Values usually
    fall in the range [0, 100], but may be arbitrarily negative in extreme cases.

    Higher value => easier text.

    Args:
        doc
        lang

    Note:
        Coefficients in this formula are language-dependent;
        if ``lang`` is null, the value of ``Doc.lang_`` is used.

    References:
        English: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch_reading_ease
        German: https://de.wikipedia.org/wiki/Lesbarkeitsindex#Flesch-Reading-Ease
        Spanish: Fernández-Huerta formulation
        French: ?
        Italian: https://it.wikipedia.org/wiki/Formula_di_Flesch
        Dutch: ?
        Portuguese: https://pt.wikipedia.org/wiki/Legibilidade_de_Flesch
        Turkish: Atesman formulation
        Russian: https://ru.wikipedia.org/wiki/%D0%98%D0%BD%D0%B4%D0%B5%D0%BA%D1%81_%D1%83%D0%B4%D0%BE%D0%B1%D0%BE%D1%87%D0%B8%D1%82%D0%B0%D0%B5%D0%BC%D0%BE%D1%81%D1%82%D0%B8
Readability test used as a general-purpose standard in several languages, based on
    a weighted combination of avg. sentence length and avg. word length. Values usually
    fall in the range [0, 100], but may be arbitrarily negative in extreme cases.
Readability test used as a general - purpose standard in several languages based on a weighted combination of avg . sentence length and avg . word length . Values usually fall in the range [ 0 100 ] but may be arbitrarily negative in extreme cases .
def flesch_reading_ease(doc: Doc, *, lang: Optional[str] = None) -> float:
    """
    Readability test used as a general-purpose standard in several languages, based on
    a weighted combination of avg. sentence length and avg. word length. Values usually
    fall in the range [0, 100], but may be arbitrarily negative in extreme cases.

    Higher value => easier text.

    Args:
        doc
        lang

    Note:
        Coefficients in this formula are language-dependent;
        if ``lang`` is null, the value of ``Doc.lang_`` is used.

    References:
        English: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch_reading_ease
        German: https://de.wikipedia.org/wiki/Lesbarkeitsindex#Flesch-Reading-Ease
        Spanish: Fernández-Huerta formulation
        French: ?
        Italian: https://it.wikipedia.org/wiki/Formula_di_Flesch
        Dutch: ?
        Portuguese: https://pt.wikipedia.org/wiki/Legibilidade_de_Flesch
        Turkish: Atesman formulation
        Russian: https://ru.wikipedia.org/wiki/%D0%98%D0%BD%D0%B4%D0%B5%D0%BA%D1%81_%D1%83%D0%B4%D0%BE%D0%B1%D0%BE%D1%87%D0%B8%D1%82%D0%B0%D0%B5%D0%BC%D0%BE%D1%81%D1%82%D0%B8
    """  # noqa: E501
    if lang is None:
        lang = doc.lang_
    try:
        coefs = _FRE_COEFS[lang]
    except KeyError:
        raise ValueError(errors.value_invalid_msg("lang", lang, list(_FRE_COEFS.keys())))

    words = tuple(utils.get_words(doc))
    n_sents = basics.n_sents(doc)
    n_words = basics.n_words(words)
    n_syllables = basics.n_syllables(words, lang=lang)
    return (
        coefs["base"]
        - (coefs["asl"] * n_words / n_sents)
        - (coefs["awl"] * n_syllables / n_words)
    )
def flesch_reading_ease ( doc : Doc , * , lang : Optional [ str ] = None ) -> float : # noqa: E501 if lang is None : lang = doc . lang_ try : coefs = _FRE_COEFS [ lang ] except KeyError : raise ValueError ( errors . value_invalid_msg ( "lang" , lang , list ( _FRE_COEFS . keys ( ) ) ) ) words = tuple ( utils . get_words ( doc ) ) n_sents = basics . n_sents ( doc ) n_words = basics . n_words ( words ) n_syllables = basics . n_syllables ( words , lang = lang ) return ( coefs [ "base" ] - ( coefs [ "asl" ] * n_words / n_sents ) - ( coefs [ "awl" ] * n_syllables / n_words ) )