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

chore: refactor #166

Merged
merged 2 commits into from
Oct 31, 2022
Merged

chore: refactor #166

merged 2 commits into from
Oct 31, 2022

Conversation

ilteoood
Copy link
Contributor

Small refactors while I was reading the code

@micheleriva

src/tokenizer/index.ts Outdated Show resolved Hide resolved
@ilteoood ilteoood requested review from RafaelGSS and micheleriva and removed request for RafaelGSS and micheleriva October 28, 2022 06:53
Copy link
Contributor

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

// Check if stop-words removal is enabled
if (tokenizerConfig?.enableStopWords) {
// Remove stop-words
if ((tokenizerConfig?.customStopWords as string[]).includes(token)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, Array.prototype.includes is slow too. But it's out of the topic of this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RafaelGSS true, but the thecustomStopWords array is typically pretty small, so it wouldn't affect the performance that much

Copy link
Member

@micheleriva micheleriva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@micheleriva micheleriva merged commit 4de0685 into oramasearch:main Oct 31, 2022
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 this pull request may close these issues.

3 participants