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

word_boundary doesn't work well in some cases #25

Open
ericphanson opened this issue Nov 12, 2021 · 0 comments
Open

word_boundary doesn't work well in some cases #25

ericphanson opened this issue Nov 12, 2021 · 0 comments

Comments

@ericphanson
Copy link
Member

With FuzzyQuery's:

it looks like FuzzyQuery doesn't respect word_boundary? It allows the edits to occur on the leading space
@ararslan

With augment:

julia> word_boundary(augment(Query("hello goodbye")))
ERROR: MethodError: no method matching reconstruct(::KeywordSearch.Or{Tuple{Query, Query}})
Closest candidates are:
  reconstruct(::FuzzyQuery) at /Users/eph/KeywordSearch.jl/src/helpers.jl:34
  reconstruct(::Query) at /Users/eph/KeywordSearch.jl/src/helpers.jl:35
Stacktrace:
 [1] word_boundary(Q::KeywordSearch.Or{Tuple{Query, Query}})
   @ KeywordSearch ~/KeywordSearch.jl/src/helpers.jl:75
 [2] top-level scope
   @ REPL[39]:1

julia> augment(word_boundary(Query("hello goodbye")))
Or
├─ Query(" hello goodbye ")
├─ Query("hello goodbye ")
├─ Query(" hellogoodbye ")
├─ Query("hellogoodbye ")
├─ Query(" hello goodbye")
├─ Query("hello goodbye")
├─ Query(" hellogoodbye")
└─ Query("hellogoodbye")

The first case errors, which is annoying, and the 2nd case makes way to many things; we only want to augment the inner space, not the outer ones.

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