dpalmasan / TRUNAJOD2.0

An easy-to-use library to extract indices from texts.
https://trunajod20.readthedocs.io/en/latest/
MIT License
29 stars 7 forks source link

Add Type Hints to TTR module #18

Closed dpalmasan closed 3 years ago

dpalmasan commented 3 years ago

TTR module can be found here:

https://github.com/dpalmasan/TRUNAJOD2.0/blob/master/src/TRUNAJOD/ttr.py

For example, using type hints we could define:

def type_token_ratio(word_list):

as

def type_token_ratio(word_list: List[str]) -> float:
sourvad commented 3 years ago

@dpalmasan Can I work on this issue?

dpalmasan commented 3 years ago

@sourvad sure! Feel free to work on this issue

sourvad commented 3 years ago

Hello @dpalmasan ,there is no docstring for the following parameters:

  1. In lexical_diversity_mtld:

    • model_name
    • ttr_segment
  2. In one_side_lexical_diversity_mtld:

    • model_name

Should type hints be added for these parameters as well, or is it abstracted away by design?

dpalmasan commented 3 years ago

Good catch! @sourvad Probably we need to also update the docstrings

sourvad commented 3 years ago

Gotcha, will do.

sourvad commented 3 years ago

@dpalmasan I believe it's done. Build passed and ran pre-commit.

dpalmasan commented 3 years ago

PR merged, closing.