<div dir="ltr">Dear László and others,<div><br></div><div style>We think we may have found a bug in libhyphen. It could be that it is just a limitation of the algorithm, but anyway it's an issue for us.</div><div style>
<br></div><div style>The problem is that some patterns in a dictionary are ignored in some cases, namely when the match string of that pattern is a part of the match string of another pattern, and more specifically when it's not just a prefix.</div>
<div style><br></div><div style>Let me clarify that with an example. When a dictionary consists of these two patterns, the word `foobar' is not hyphenated because the first pattern is ignored:</div><div style><br></div>
<div style>oo1b<br></div><div style><div>foob</div></div><div style><br></div><div style>The second, longer pattern doesn't even have to match, as the second example shows (the first pattern is still ignored):</div><div style>
<br></div><div style><div>oo1b<br></div><div>foobz</div></div><div style><br></div><div style>I have a patch that solves part of the problem:<br></div><div style><br></div><div style><a href="https://github.com/bertfrees/libhyphen-nar/blob/adc2b74a19469e4dc93777fcdb82e36e566a0472/src/patches/bug.patch">https://github.com/bertfrees/libhyphen-nar/blob/adc2b74a19469e4dc93777fcdb82e36e566a0472/src/patches/bug.patch</a><br>
</div><div style><br></div><div style>With this patch the given examples will be handled correctly, but in other situations it will still fail, such as here:</div><div style><br></div><div style><div>oo1b<br></div><div>foobaz</div>
</div><div style><br></div><div style>Have I indeed found a bug here, and does my patch make sense, or am I just expecting too much and are we hitting the limits of the algorithm?</div><div style><br></div><div style>Thanks for considering,</div>
<div style>Bert Frees</div></div>