Forum How do I...?

Hyphenation using dictionary

newgen
To understand the way how hyphenated dictionary works, i have used en-us hyphenated dictionary from the engine folder as below.

hyphens: auto;
prince-hyphenate-character: "~";
prince-hyphenate-patterns: url("hyph-en-us.pat");

Certain words in the generated PDF is not seperated as it is given on the hyph-en-us.pat? Also I'm unable to understand the exact usage of the .hyp file for dictionaries. If you check in the attached PDF the generated word that is hyphenated is recog~nizance but this word in hyph-en-us.hyp file it is re-cog-ni-zance. With which the letters are not breaking as per the dictionary. Could you please help me understand?

How can i achieve a customised dictionary for different languages? Thank so much.
  1. attr.html1.0 kB
  2. attr.pdf26.7 kB
newgen
Here I have used the prince-hyphenate-after property and also i have pointed to a hyphenate dictionary as below,

p{
width: 200px;
hyphens:auto;
prince-hyphenate-character: "~";
prince-hyphenate-after: 4;
prince-hyphenate-patterns: url(hyph-en-us.pat);
}

But from the output i can see that the hyphenation dint happen as per expectation. Could you brief on that please? Thank you.

Added to this i would like to understand on how limit-lines and lines work along with hyphenation-zone, also if there is any specific property for words with atleast option (which allows us to mention, on which set of words hyphenation must take place.). Thank you.
  1. attr.html1.5 kB
  2. attr.pdf26.8 kB

Edited by newgen

mikeday
May I ask what part of the output is different from your expectations?
newgen
If you see the attachment, please find the first underlined word [recog-nizance] which is cut after four letters but if you look at the file hyp-en-us.hyp inside hyp folder the same word is split as re-cog-ni-zance, the second underlined [pro-jects] is not split in the hyp-en-us.hyp but in the output file it is and the last word underlined word [reci-procity] is split correctly as mentioned inside the hyp-en-us.hyp.

So can you please explain on how this is working.
  1. attr_output.PNG46.8 kB
mikeday
Ah sorry for the confusion, Prince is currently only using the .pat files, not the .hyp files, which are distributed purely for licensing reasons. Perhaps you can get the same effect by adding these exceptions to the pattern dictionary?
mikeday
You may wish to try Prince for Books, which has a new hyphenation mechanism that delivers better results than TeX patterns.