taleinat / fuzzysearch

Find parts of long text or data, allowing for some changes/typos.
MIT License
301 stars 26 forks source link

import error with "find_near_matches_with_ngrams" #23

Closed sasi143 closed 4 years ago

sasi143 commented 4 years ago

Here is my code taken from the readme file

`sequence = '''\ GACTAGCACTGTAGGGATAACAATTTCACACAGGTGGACAATTACATTGAAAATCACAGATTGGTCACACACACA TTGGACATACATAGAAACACACACACATACATTAGATACGAACATAGAAACACACATTAGACGCGTACATAGACA CAAACACATTGACAGGCAGTTCAGATGATGACGCCCGACTGATACTCGCGTAGTCGTGGGAGGCAAGGCACACAG GGGATAGG'''

subsequence = 'TGCACTGTAGGGATAACAAT' #distance 1 max_distance = 2

from fuzzysearch import find_near_matches_with_ngrams

print(find_near_matches_with_ngrams(subsequence, sequence, max_distance)) `

This output I am getting `--------------------------------------------------------------------------- ImportError Traceback (most recent call last)

in 8 max_distance = 2 9 ---> 10 from fuzzysearch import find_near_matches_with_ngrams 11 12 print(find_near_matches_with_ngrams(subsequence, sequence, max_distance)) ImportError: cannot import name 'find_near_matches_with_ngrams' from 'fuzzysearch' (c:\users\ssadam\appdata\local\continuum\anaconda3\envs\ner\lib\site-packages\fuzzysearch\__init__.py)`
sasi143 commented 4 years ago

@taleinat , I know maybe I am following older docs, but I didn't get any other new docs to use find_near_matches_with_ngrams functionality

sasi143 commented 4 years ago

@taleinat , I had seen a lot of functionalities are in source code and it would be great if you update the readme file or docs with the new content.

Respect your work and time

taleinat commented 4 years ago

@sasi143, thanks for reporting this!

That example is no longer in the readme, but it is in the "usage" page in the docs, and should definitely be fixed!

taleinat commented 4 years ago

@sasi143, I've fixed the usage example on the Usage page of the documentation.

I've also added quite a bit of detail there about the available internal functions and how to use them.