Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Type Hints to TTR module #18

Closed
dpalmasan opened this issue Apr 4, 2021 · 7 comments
Closed

Add Type Hints to TTR module #18

dpalmasan opened this issue Apr 4, 2021 · 7 comments
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@dpalmasan
Copy link
Owner

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:
@dpalmasan dpalmasan added this to the TypeHints milestone Apr 4, 2021
@sourvad
Copy link
Contributor

sourvad commented Apr 5, 2021

@dpalmasan Can I work on this issue?

@dpalmasan
Copy link
Owner Author

@sourvad sure! Feel free to work on this issue

@dpalmasan dpalmasan added the good first issue Good for newcomers label Apr 6, 2021
@sourvad
Copy link
Contributor

sourvad commented Apr 9, 2021

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
Copy link
Owner Author

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

@sourvad
Copy link
Contributor

sourvad commented Apr 10, 2021

Gotcha, will do.

@sourvad
Copy link
Contributor

sourvad commented Apr 11, 2021

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

dpalmasan added a commit that referenced this issue Apr 11, 2021
Add type hints to `TTR` module (#18 )
@dpalmasan
Copy link
Owner Author

PR merged, closing.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants