6

This question follows previous one about use of patgen.

I installed TeX Live 2011 (thanks Martin) and find patgen (version 2.4) command. According to manual, command is:

 patgen dictionary_file pattern_file patout_file translate_file

I do the same way like:

  patgen dic.dic pattern.pat out.out translate.tra

But it prompts

  patgen.exe: translate.tra: No such file or directory

Why? I put the 4 files ( dic.dic pattern.pat out.out translate.tra) in the same directory as patgen.exe. Is that correct?

My translate.tra is an empty file (the manual says "If the translate file is empty, the values left_hyphen_min=2, right_hyphen_min=3, and the 26 lower case letters a. . .z with their upper case representations A. . .Z are assumed). Can you explain it to me?

By the way, if I want left_hyphen_min=1, right_hyphen_min=1 and 26 english letters, how should I write that complete translate file?

Edit:

The manual date mentioned above was in the year 2009. I removed TexLive 2011 and installed TexLive 2009. This time the patgen.exe version is 2.3 (Web2C 2009). The error prompt is exactly the same as in TexLive 2011

patgen.exe: translate.tra: No such file or directory

How should I correct it? If the translate.tra should be placed elsewhere, where should I put it?

Will TexLive 2008 work for it?

5
+50

I’m not an patgen expert, but i think that i can give you some hints (I’m using patgen 2.4 from TeX Live 2012):

First, you shouldn’t have an patout_file/out.out file in the first place. This is the output that patgen should produce – so it’s not needed, but if it’s already present, patgen runs faster.

Secondly, yes it’s okay to have all these files in the same directory. Otherwise you have to specify their path on the command line, which may get ugly.

Thirdly, patgen does seems to need a .tra file, despite what the documentation says – but a simple empty file ($ touch translate.tra) works on my Linux computer. Maybe you have some misleading spaces in yours?

But of course, it’s anyway much better to give patgen a “real” one. The .tra file format is explained in the man page of patgen ($ man patgen), but in a little complicated way:

A translate file starts with a line containing the values of left_hypen_min in columns 1-2, right_hyphen_min in columns 3-4, […] Each following line defines one `letter' […]

In practice, the .tra file you want should look like this:

 1 1
 a A
 b B
 […]
 z Z

The first line defines the minimal left/right hyphenations, and the rest of the lines are simple rules/sets to glue lower- and upper letters together (the first one is the canonical one to use for hyphenation). So for English, you may also want to specify some additionally rare used characters like æ Æ and œ Œ as in “Encyclopædia Cœlom” or hiſtorical ones like s S ſ . Here’s a real world example for German with much more accent characters like umlauts.

But back to the .tra'file format: Please note the leading spaces! The first character of a line always defines the character to separate/split the line into parts, so you can’t leave it out! For example, for Greek you may want to to write more complicated lines like #p#P#\varpi ## which means that for hyphenation purposes, p, P and \varpi are equivalent (here’s # the separator since we really want a space after the varpi, and the double # at the end is the verbose version to clarify that this line/equivalence is now finished).

But we are not ready yet – to be honest, the user interface of patgen is … humble, politely spoken. Let the man page speak again:

After reading the translate_file […], patgen requests input from the user's terminal.

In fact, many input … and while you can type it manually on the terminal (and you should do it the first time to get used to all the requested integers!), but this gets really annoying the second/third/… time.

So I strongly recommend you to use a script for this: the trennmuster project (which wants to create better hyphenation patterns for the German language) has such a script in its git repository: make-full-pattern.sh

Finally, the patgen manual is available on line. I hope this helps you a little bit!

  • Addition: Since you are a windows user, you may want to read the man page for patgen online (i’m sorry, but i couldn’t use more than two links in my answer because of my non-existent reputation). – Frakturfreund Jul 9 '12 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.