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

match_word unable to handle multi-words and short words #26

Open
Shaun-Tan-DJ opened this issue Aug 6, 2024 · 0 comments
Open

match_word unable to handle multi-words and short words #26

Shaun-Tan-DJ opened this issue Aug 6, 2024 · 0 comments

Comments

@Shaun-Tan-DJ
Copy link

Shaun-Tan-DJ commented Aug 6, 2024

Hi,

There is an issue with the match_word arg. If match_word=True, it will not be able to handle multi-words, but able to handle short words.

import eldar
eldar_query = eldar.Query('cake shop', match_word=True)
print(eldar_query('cake shop'))
# False, this is incorrect as it should match
import eldar
eldar_query = eldar.Query('cn', match_word=True)
print(eldar_query('cny'))
# False, this is correct

But if match_word=False, it will not be able to handle short words, but able to handle multi-words.

import eldar
eldar_query = eldar.Query('cake shop', match_word=False)
print(eldar_query('cake shop'))
# True, this is correct
import eldar
eldar_query = eldar.Query('cn', match_word=False)
print(eldar_query('cny'))
# True, this is incorrect as it should not match

I've tried testing with quotation marks and wildcards around multi-words, but it still does not work.

import eldar
eldar_query = eldar.Query('"cake shop"', match_word=True)
print(eldar_query('cake shop'))
# False, this is incorrect as it should not match

eldar_query = eldar.Query('cake*shop', match_word=True)
print(eldar_query('cake shop'))
# False, this is incorrect as it should not match

eldar_query = eldar.Query('"cake*shop"', match_word=True)
print(eldar_query('cake shop'))
# False, this is incorrect as it should not match
@Shaun-Tan-DJ Shaun-Tan-DJ changed the title match_word match_word unable to handle multi-words and short words Aug 6, 2024
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

1 participant