You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, there seems to be a type issue in the text transformations functions in the augly/text/functional.py file. Indeed, these functions can take a string or a list of strings as inputs, and return a new string or list of strings based on the input type.
textaugs.simulate_typos(["hello"]) # returns a list of strings
textaugs.simulate_typos("hello") # returns a string
Hi @Antoine-Prieur, thanks for pointing this out! You're right that the text augmentations all can take in Union[str, List[str]] and then output the same, so we should change the type signatures to match. I'll start a PR to fix this :)
Summary:
## Related Issue
Fixesfacebookresearch#189
- [x] I have read CONTRIBUTING.md to understand how to contribute to this repository :)
Fixing the text augmentations' return types -- the output type is the same type as the input, which can be either a `str` or a `List[str]`.
## Unit Tests
See the `test_python` workflow.
Pull Request resolved: facebookresearch#191
Differential Revision: D34340331
Pulled By: zpapakipos
fbshipit-source-id: 87b6b2fe6f8e97bcc534b98326f0079153c49858
🐛 Bug
Hello, there seems to be a type issue in the text transformations functions in the
augly/text/functional.py
file. Indeed, these functions can take a string or a list of strings as inputs, and return a new string or list of strings based on the input type.However, all the functions are defined as :
Expected behavior
Is it possible to change the types of the functions as something like this to solve this issue :
Environment
The text was updated successfully, but these errors were encountered: