Closed andrewtavis closed 1 month ago
@andrewtavis can you assign me this issue?
Sounds great, @KesharwaniArpita! Let us know if you need any support :)
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!
Great!!!
Thanks for the heads up @andrewtavis . Though I am yet to look up some things. I'll try to resolve this issue soon. π
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!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, maybevalidate_language_and_data_type
should move tocli_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.
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?
Sounds good to me, @KesharwaniArpita! I'll take a look at it later :)
Hey @KesharwaniArpita , you can try the suggestions in this StackOverFlow post
Closed by #344 :) Thanks for the work here @KesharwaniArpita and for the support @DeleMike!
Thank You Andrew
Glad to help! ππΎ
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:
... then they would get a suggestion for
English
andnouns
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! π