Skip to content

Make scrapping search unsensitive to accents #106

@SashaShadow

Description

@SashaShadow

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
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions