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

Make scrapping search unsensitive to accents #106

Open
SashaShadow opened this issue Aug 16, 2023 · 1 comment
Open

Make scrapping search unsensitive to accents #106

SashaShadow opened this issue Aug 16, 2023 · 1 comment
Labels
enhancement New feature or request good second issue task this is a task to do

Comments

@SashaShadow
Copy link

SashaShadow commented Aug 16, 2023

Compare searched and found words without accents.

I suggest to normalize key words and text data from the sites (remove accents). This way it will be easier to match the searched word when you scrap. More results will be found. I don't know where the comparison process is done, but a simple function
could do the job.

Steps to Follow

  • Implement this one function to both words (or paragraphs): key words written by the user in the input and words searched in the pages:
const normalizeText = (words) => {
     let validText = typeof words
     if (validText !== "string") return "You must pass a string as argument"
     let newWords = words.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
     return newWords
}
@SashaShadow SashaShadow added the task this is a task to do label Aug 16, 2023
@Chmod351 Chmod351 added enhancement New feature or request good second issue labels Aug 16, 2023
@Chmod351
Copy link
Owner

we r filtering results here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good second issue task this is a task to do
Projects
None yet
Development

No branches or pull requests

2 participants