case_sensitive=True gives unexpected results
See original GitHub issueIn a case-sensitive dictionary, I would expect 'FBI'
to be known and 'fbi'
to be unknown. However, both cases give me 'fbi'
as known:
from spellchecker import SpellChecker
spell = SpellChecker(case_sensitive=True)
print(spell.known(["FBI"]))
print(spell.known(["fbi"]))
{'fbi'}
{'fbi'}
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
c# - Why I am getting different result from two almost equal ...
It will return true regardless of case. The second example calls ToList so it is now doing a .net string compare what IS...
Read more >Subtle Mistakes in IDL Programming - L3Harris Geospatial
Blog provides a list of common mistakes in IDL programming, specifically subtle mistakes that can lead to unexpected results & cause ...
Read more >How to do case-insensitive and accent-insensitive search in ...
You can find that group by and order by queries give incorrect results. Remember this happens silently. Beware! If you are using extended...
Read more >enable case sensitive for values in dashboard. - Splunk Answers
I want to treat "some value" as case insensitive in the dasboard. The dashboard gets filled on the basis of drop down selection....
Read more >Solved: Using 'contains' with Case Sensitivity
Solved: Is anyone aware of a change to the 'contains' operator toLower(outputs('Update_item')?['body/Transferee_x0020_Email']) We have ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the info!
To use a case_sensitive dictinoary, you will need to build it yourself as the default dictionaries are case-insensitive. There are lots of ways to build dictionaries, and they are not manually. I only used that to ensure that there wasn’t a bug. You can find the different ways to build a custom dictionary in the documentation on building a new dictionary or in the GitHub Discussion #90.
Either way, there are reasons why the default dictionaries are not capitalized:
The
vs.the
) since the same word may be capitalized, say due to being the first word in the sentence.Just some thoughts on it; good luck!