(self, name: DiversityNameType, **kwargs)
return func(self.words, **kwargs)
Compute a measure of lexical diversity using a method with specified ``name`` ,
        optionally specifying method variants and parameters.

        Higher values => higher lexical diversity.

        See Also:
            :mod:`textacy.text_stats.diversity`
Compute a measure of lexical diversity using a method with specified ``name`` ,
        optionally specifying method variants and parameters.
Compute a measure of lexical diversity using a method with specified name optionally specifying method variants and parameters .
def diversity(self, name: DiversityNameType, **kwargs) -> float:
        """
        Compute a measure of lexical diversity using a method with specified ``name`` ,
        optionally specifying method variants and parameters.

        Higher values => higher lexical diversity.

        See Also:
            :mod:`textacy.text_stats.diversity`
        """
        # in case users prefer "log-ttr" or "log ttr"
        # to the underscored func-standard name "log_ttr"
        name = name.replace("-", "_").replace(" ", "_")
        try:
            func = getattr(diversity, name)
        except AttributeError:
            raise ValueError(
                errors.value_invalid_msg(
                    "name",
                    name,
                    list(utils.get_function_names(diversity, ignore_private=True)),
                )
            )
        return func(self.words, **kwargs)
def diversity ( self , name : DiversityNameType , * * kwargs ) -> float : # in case users prefer "log-ttr" or "log ttr" # to the underscored func-standard name "log_ttr" name = name . replace ( "-" , "_" ) . replace ( " " , "_" ) try : func = getattr ( diversity , name ) except AttributeError : raise ValueError ( errors . value_invalid_msg ( "name" , name , list ( utils . get_function_names ( diversity , ignore_private = True ) ) , ) ) return func ( self . words , * * kwargs )