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

Variable penalty? #16

Open
TheChilliPL opened this issue May 3, 2024 · 2 comments
Open

Variable penalty? #16

TheChilliPL opened this issue May 3, 2024 · 2 comments

Comments

@TheChilliPL
Copy link

It would be amazing if this could support dictionaries with variable penalties for hyphenation, like in Hunspell-like dictionaries.

For example, hyph_pl_PL.dic might include entries like:

.nie8ch9że.

where . I believe mean word boundaries (as there might be more generic rulesand digits mean the penalties, thusniechżewith the minimum value of 8 might be hyphenated asnie-ch-żeand 9 asniech-że` only.

One could also implement a weighted approach, with the library trying to find the lowest penalty hyphenation along with the best alignment of the text.

@laurmaedje
Copy link
Member

Typically, in TeX hyphenation patterns the digits handle the priority among the patterns (see the blog post on hypher). I don't think that this automatically implies a rating of the opportunities, so I'm not sure whether this would really make sense.

@TheChilliPL
Copy link
Author

Oh, I might have actually misunderstood how the patterns work, the blog post cleared things up. However, in Affinity Publisher there is this minimum hyphenation value setting which makes words more or less likely to be hyphenated, and it uses Hunspell-like dictionaries as well 🤔

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

No branches or pull requests

2 participants