Comments (2)
Sorry about that, ignore_term_with_digits=True
only works when ignore_non_words=True
as well, I should have made that clearer in the documentation and print a warning if only ignore_term_with_digits=True
is used.
I tried your sample input by adapting an example from the documentation and I think it managed to give the output you were originally expecting.
import pkg_resources
from symspellpy import SymSpell
sym_spell = SymSpell(max_dictionary_edit_distance=2, prefix_length=7)
dictionary_path = pkg_resources.resource_filename(
"symspellpy", "frequency_dictionary_en_82_765.txt"
)
bigram_path = pkg_resources.resource_filename(
"symspellpy", "frequency_bigramdictionary_en_243_342.txt"
)
# term_index is the column of the term and count_index is the
# column of the term frequency
sym_spell.load_dictionary(dictionary_path, term_index=0, count_index=1)
sym_spell.load_bigram_dictionary(bigram_path, term_index=0, count_index=2)
input_term = "005"
# max edit distance per lookup (per single word, not per whole input string)
suggestions = sym_spell.lookup_compound(
input_term, max_edit_distance=2, ignore_non_words=True, ignore_term_with_digits=True
)
# display suggestion term, edit distance, and term frequency
for suggestion in suggestions:
print(suggestion)
Output: 005, 0, 0
from symspellpy.
Thanks for the explanation.
from symspellpy.
Related Issues (20)
- replaced_words is not correct HOT 4
- Correction doesn't prioritize bigram. HOT 3
- Predicts garbage for Bengali input HOT 7
- wrong word segmentation result HOT 1
- First line of the text file reads wrong HOT 4
- edit distance issue HOT 1
- Substring search
- error if i use spell checker to my dataset HOT 4
- How to empty the dictionary quickly HOT 3
- Custom Edit Distance HOT 2
- Using a custom dictionary with the desired correction HOT 1
- the frequency in the loaded dictionary is absolute, not relative
- Incompatible architecture on macOS
- load 5.5mb dictionary consume 1GB memory?
- Incompatible architecture on macOS
- Correction not using bi-grams
- Bigrams omitted from save and load pickle methods HOT 5
- Does SymSpell has spell checker ? HOT 2
- Error when pip install on MacOS HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symspellpy.