config --set: Add case-insensitive matching and fuzzy suggestions#241
Open
stakeswky wants to merge 1 commit intonbfc-linux:mainfrom
Open
config --set: Add case-insensitive matching and fuzzy suggestions#241stakeswky wants to merge 1 commit intonbfc-linux:mainfrom
stakeswky wants to merge 1 commit intonbfc-linux:mainfrom
Conversation
When 'nbfc config --set MODEL' fails to find an exact match:
1. Try case-insensitive matching first (e.g. 'lenovo thinkpad l540'
now resolves to 'Lenovo Thinkpad L540')
2. If no case-insensitive match, show 'Did you mean?' suggestions
using Levenshtein similarity and substring matching. This helps
when users type the NotebookModel field value (e.g. 'Thinkpad L540')
instead of the config filename ('Lenovo Thinkpad L540').
3. If no suggestions found, point users to 'nbfc config -l'.
Closes nbfc-linux#239
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #239
When
nbfc config --set MODELfails to find an exact config match, this PR improves the experience:Case-insensitive matching:
nbfc config --set 'lenovo thinkpad l540'now resolves toLenovo Thinkpad L540without error.Fuzzy suggestions: If no case-insensitive match is found, the command now shows "Did you mean?" suggestions using Levenshtein similarity and substring matching. This directly addresses the confusion where the
NotebookModelfield inside a JSON config (e.g.Thinkpad L540) differs from the config filename (Lenovo Thinkpad L540):Fallback hint: If no suggestions are found, the user is pointed to
nbfc config -l.Note:
nbfc config --listalready exists and was mentioned in the issue — the help text already documents it.