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

English hyphenation results #51

Open
joseflorido opened this issue Aug 6, 2020 · 2 comments
Open

English hyphenation results #51

joseflorido opened this issue Aug 6, 2020 · 2 comments

Comments

@joseflorido
Copy link

Hi!

I tried this code:

use \Org\Heigl\Hyphenator as h;
$hyphenator = h\Hyphenator::factory();
echo $hyphenator->hyphenate('hyphenation');
// hy-phe-na-ti-on
echo $hyphenator->hyphenate('chocolate');
// choco-late

Expected results are:
hy-phen-a-tion
choc-o-late

My config is:

noHyphenateString = null
hyphen = "-"
leftMin = 1
rightMin = 1
wordMin = 3
quality = 9
customHyphen = "=="
defaultLocale = "en_US"
tokenizers = "Whitespace,Punctuation"
filters = "Simple,CustomMarkup"

Any idea why I am seeing different results?

Thanks!
Jose

@heiglandreas
Copy link
Owner

Hey @joseflorido - Sorry for the late response. It looks like the base of the Hyphenation patterns that this library uses – the American English hyphenation patterns for OpenOffice.org – do not contain patterns that allow the hyphenation that you expect.

As there are other (partly pretty expensive) hyphenation algorithms available it might happen, that other websites propose other hyphenations.

I'm currently though checking whether there is a newer dictionary file available that perhaps matches your expectations as well.

@heiglandreas
Copy link
Owner

Until then you can add your own hyphenation patterns as described in #49 (comment)

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