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

Support for Soft Hyphens, a first step to better indexing for languages like German #738

Open
dirk68-fu opened this issue Nov 14, 2024 · 1 comment
Labels
improvement Not a bug Pagefind CLI The CLI responsible for indexing content

Comments

@dirk68-fu
Copy link

dirk68-fu commented Nov 14, 2024

In the following thread the problem is discussed that in German words are often a composition of simpler words. For example „Hochspannungsnetzgerät“ is a composition of „Hochspannung“ (High voltage) and „Netzgerät“ (power supply). If I search for „Netzgerät“ with pagefind it currently does not find „Hochspannungsnetzgerät“ though the term is included and semantically it most certainly is a kind of „Netzgerät“, so the user would expect to find it.

There seems to be no easy solution to that problem. But a first step would be to add optional support for soft hyphen characters. Pagefind should treat the soft hyphen as a word boundary. This would enable the generators of the static html to include this hints for pagefind in the page.

@bglw
Copy link
Contributor

bglw commented Nov 20, 2024

👋

This can be added, and no need for it to be optional. Pagefind already indexes multiple words for a given location when required — e.g. when it encounters a word source_text it will index source_text, source, and text at the given location. I can add the soft hyphen to this list which will roll it into the same handling.

@bglw bglw added improvement Not a bug Pagefind CLI The CLI responsible for indexing content labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug Pagefind CLI The CLI responsible for indexing content
Projects
None yet
Development

No branches or pull requests

2 participants