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 suggest an included language/data type on potential misspelling functionality to the CLI #341

Closed
2 tasks done
andrewtavis opened this issue Oct 13, 2024 · 13 comments
Closed
2 tasks done
Assignees
Labels
feature New feature or request good first issue Good for newcomers hacktoberfest Included as a part of Hacktoberfest help wanted Extra attention is needed

Comments

@andrewtavis
Copy link
Member

Terms

Description

This issue would add functionality to the CLI that would check an incorrect language and return a suggestion to the user in case there's a similar language that Scribe-Data does support. I.e. if a user types:

scribe-data get -lang Englishh -dt nounss

... then they would get a suggestion for English and nouns respectively in the error message that says that the functionality for them is not included.

Contribution

Happy to support with this and review when a PR is open! 🚀

@andrewtavis andrewtavis added feature New feature or request help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest Included as a part of Hacktoberfest labels Oct 13, 2024
@KesharwaniArpita
Copy link
Contributor

@andrewtavis can you assign me this issue?

@andrewtavis
Copy link
Member Author

Sounds great, @KesharwaniArpita! Let us know if you need any support :)

@andrewtavis andrewtavis moved this from Todo to In Progress in Scribe Board Oct 13, 2024
@andrewtavis
Copy link
Member Author

Hey @KesharwaniArpita 👋 Looking at it, this should definitely go within validate_language_and_data_type once #337 is merged in :) I'll try to get that in later on this evening!

@KesharwaniArpita
Copy link
Contributor

Great!!!

@KesharwaniArpita
Copy link
Contributor

Thanks for the heads up @andrewtavis . Though I am yet to look up some things. I'll try to resolve this issue soon. 😅

@andrewtavis
Copy link
Member Author

#337 has now been merged :) Pinging @catreedle about this as well. I think we should use validate_language_and_data_type for this and add functionality to it to check and make suggestions if something is close. Another thing, maybe validate_language_and_data_type should move to cli_utils.py and also be used for other commands? Feedback welcome!

@DeleMike
Copy link
Contributor

#337 has now been merged :) Pinging @catreedle about this as well. I think we should use validate_language_and_data_type for this and add functionality to it to check and make suggestions if something is close. Another thing, maybe validate_language_and_data_type should move to cli_utils.py and also be used for other commands? Feedback welcome!

Just a comment, @andrewtavis, I believe moving this to the cli_utils.py will keep things organized. It is a utility used by the CLI 😅
And you are right, we can extend the functionality of the validate_language_and_data_type function to perform this new operation.

@KesharwaniArpita
Copy link
Contributor

I think we should use validate_language_and_data_type for this and add functionality to it to check and make suggestions if something is close.

Hi @andrewtavis , you were right about it. Currently, when users input an invalid language or data type in the CLI (e.g., scribe-data get -lang Englishh -dt nounss), the system raises a ValueError indicating that the total number of lexemes could not be found, without offering any suggestions for correction. We can modify the validate_language_and_data_type function to provide suggestions for the closest valid language or data type when an invalid input is detected by implementing a string similarity algorithm, such as difflib.get_close_matches, to determine the best match for the user’s input. If a close match is found, the error message will include the suggestion; otherwise, it will simply state that the input is invalid. This will improve user experience by offering more helpful feedback in case of errors.
Does this make sense?

@andrewtavis
Copy link
Member Author

Sounds good to me, @KesharwaniArpita! I'll take a look at it later :)

@DeleMike
Copy link
Contributor

Hey @KesharwaniArpita , you can try the suggestions in this StackOverFlow post

@andrewtavis
Copy link
Member Author

Closed by #344 :) Thanks for the work here @KesharwaniArpita and for the support @DeleMike!

@github-project-automation github-project-automation bot moved this from In Progress to Done in Scribe Board Oct 14, 2024
@KesharwaniArpita
Copy link
Contributor

Thank You Andrew

@DeleMike
Copy link
Contributor

Glad to help! 🙌🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers hacktoberfest Included as a part of Hacktoberfest help wanted Extra attention is needed
Projects
Archived in project
Development

No branches or pull requests

3 participants