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

Pipeline should have an insert and/or a replace method #155

Open
dhdaines opened this issue Jul 5, 2024 · 0 comments · May be fixed by #157
Open

Pipeline should have an insert and/or a replace method #155

dhdaines opened this issue Jul 5, 2024 · 0 comments · May be fixed by #157

Comments

@dhdaines
Copy link
Contributor

dhdaines commented Jul 5, 2024

Because the language-specific trimmers are seriously defective at the moment (see #149) in both lunr.py and lunr.js (they don't include \w for instance), I need to be able to replace them. Unfortunately this is difficult to do robustly, because the API (which is inherited from lunr.js, so it's not your fault!) only has add, remove, before and after.

I would like to be able to do:

builder.pipeline.replace(
    builder.pipeline.registered_functions["lunr-multi-trimmer-fr"], trimmer.trimmer
)

But instead I have to do this:

builder.pipeline.remove(
    builder.pipeline.registered_functions["lunr-multi-trimmer-fr"]
)
builder.pipeline.before(
    builder.pipeline.registered_functions["stopWordFilter-fr"], trimmer.trimmer
)
@dhdaines dhdaines linked a pull request Jul 6, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant