Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching bug #3

Closed
Paikan opened this issue Feb 18, 2015 · 2 comments
Closed

Matching bug #3

Paikan opened this issue Feb 18, 2015 · 2 comments
Assignees

Comments

@Paikan
Copy link

Paikan commented Feb 18, 2015

# -*- coding: utf-8 -*-


from noaho import NoAho


a = NoAho()
a.add('an', 'an')
a.add('canal', 'canal')
a.add('e can oilfield', 'e can oilfield')

for match in a.findall_long('one canal'):
    print(match)

# matches with:
# (5, 7, 'an')
#
# expected match would be:
# (4, 9, 'canal')
@JDonner
Copy link
Owner

JDonner commented Feb 18, 2015

Ok. My making a 'long' version of Aho Corasick was kind of a hack, which
seemed to work - I wonder if these two bugs don't expose a design flaw.
I'll look at it. According to PyPi ~300 people a month download this,
yet I've gotten only your reports. So, many thanks!

On Wed, Feb 18, 2015, at 02:04 AM, Benjamin Devèze wrote:

-- coding: utf-8 --

from noaho import NoAho

a = NoAho()

a.add('an', 'an')

b.add('canal', 'canal')

c.add('e can oilfield', 'e can oilfield')

for match in a.findall_long('one canal'):

print(match)

matches with:

(5, 7, 'an')

expected match would be:

(4, 9, 'canal')

— Reply to this email directly or view it on GitHub[1].

Links:

  1. Matching bug #3

@JDonner JDonner self-assigned this Feb 21, 2015
JDonner added a commit that referenced this issue Feb 21, 2015
@JDonner
Copy link
Owner

JDonner commented Feb 21, 2015

Ok, fixed, 0.9.6 is on github and PyPi. Thanks for the report!

@JDonner JDonner closed this as completed Feb 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants