• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# file: bahyph.sh Version: 1.0
3#          First version:     97/02/20
4version=1.0
5#    This script generates TeX hyphenation patterns for Basque
6#    and was written by (c) Juan M. Aguirregabiria, 1997
7#    based on the shyphen.sh file by Julio Sanchez, which
8#    generates the hyphenation patterns for Spanish
9#    The copyright notice below applies to this script as well,
10#    read it before using this software.
11#
12# Usage: script [TeX] [ftc] [isolatin1]
13#
14#	TeX	\~n and \~N are done as in plain TeX and LaTeX
15#		but without the escape character: ~n, ~N
16#	ftc	these characters are specified using the
17#		ftc conventions: 'n, 'N
18#	isolatin1 means using the respective character codes in
19#		IS 8859/1 (ISO Latin Alphabet 1)
20#
21# Default is no support for diacritics. You can use combinations
22# of the above and the number of patterns will grow fast.
23#
24# Recommended options:
25#
26# isolatin1 	if you have TeX 3.0 with DC/EC fonts or ML-TeX
27# TeX 		if you don't have the above
28# ftc 		if you are used to ftc and don't have the above
29#
30# h is not here.
31consonants="b c d f g j k l m n p q r s t v w x y z"
32# Open vowels: a e o
33vop="a e o"
34# Closed vowels: i u
35vcl="i u"
36# Groups that cannot be broken.
37legal="ll rr ts tx tz bl br dr fl fr gl gr kl kr pl pr tr"
38isolatin1=0
39ftc=0
40TeX=0
41options="basic"
42for i
43do
44	if [ $i = "ftc" ]
45	then
46		ftc=1
47		options="$options ftc"
48	elif [ $i = "TeX" ]
49	then
50		TeX=1
51		options="$options TeX"
52	elif [ $i = "isolatin1" ]
53	then
54		isolatin1=1
55		options="$options isolatin1"
56	else
57		echo -n Usage: `basename $0`
58		echo " [TeX] [ftc] [isolatin1]"
59		exit 1
60	fi
61done
62if [ $ftc -ne 0 ]
63then
64	consonants="$consonants 'n"
65fi
66if [ $TeX -ne 0 ]
67then
68	consonants="$consonants ~n"
69fi
70if [ $isolatin1 -ne 0 ]
71then
72	consonants="$consonants ^^f1"
73fi
74vowels="$vop $vcl"
75echo "\
76% Hyphenation patterns for Basque.
77% This file has been written by Juan M. Aguirregabiria
78% (wtpagagj@lg.ehu.es) on February 1997 and is based
79% on the shyphen.sh script that generates the Spanish patterns
80% as compiled by Julio Sanchez (jsanchez@gmv.es) on September 1991.
81% The original Copyright follows and applies also to this file
82% whose last version will be always available by anonymous ftp
83% from tp.lc.ehu.es or by poynting your Web browser to
84% http://tp.lc.ehu.es/basque.html
85%
86% Hyphenation patterns for Spanish.
87% Compiled by Julio Sanchez (jsanchez@gmv.es) on September 1991.
88% These patterns have been derived from \"On Word Division in Spanish\",
89% Jos'e A. Ma~nas, Communications of the ACM, and implemented in his
90% package ftc. You can get ftc and a draft of the abovementioned
91% paper from goya.dit.upm.es in src/text.proc/ftc.Z. FTP access may
92% be available. Otherwise, send help to info@goya.dit.upm.es for
93% details on use of the mail server.
94%
95% Rules mentioned below are those described in that paper. After
96% several unsatisfactory attempts to pretend I knew better, these
97% patterns closely follow that paper. Pattern 'tl' is not considered.
98% It is conflictive and ftc does not use it either.
99%
100% These patterns have been generated by shyphen.sh version $version,
101% shyphen.sh is a sh script that allows a number of choices.
102% Full benefit from some of these options can only be
103% obtained if appropriate fonts are available.
104%
105% Follows a copyright notice. This is not in the public domain,
106% but the copyright is essentially a hold-harmless clause. That
107% is, use it at will, but don't sue me if you don't like it.
108%
109%			COPYRIGHT NOTICE
110%
111% These patterns and the generating sh script are Copyright (c) GMV 1991
112% These patterns were developed for internal GMV use and are made
113% public in the hope that they will benefit others. Also, spreading
114% these patterns throughout the Spanish-language TeX community is
115% expected to provide back-benefits to GMV in that it can help keeping
116% GMV in the mainstream of spanish users. However, this is given
117% for free and WITHOUT ANY WARRANTY. Under no circumstances can Julio
118% Sanchez, GMV, Jos'e A. Ma~nas or any agents or representatives thereof
119% be held responsible for any errors in this software nor for any damages
120% derived from its use, even in case any of the above has been notified
121% of the possibility of such damages. If any such situation arises, you
122% responsible for repair. Use of this software is an explicit
123% acceptance of these conditions.
124%
125% You can use this software for any purpose. You cannot delete this
126% copyright notice. If you change this software, you must include
127% comments explaining who, when and why. You are kindly requested to
128% send any changes to tex@gmv.es. If you change the generating
129% script, you must include code in it such that any output is clearly
130% labeled as generated by a modified script.
131%
132% Despite the lack of warranty, we would like to hear about any
133% problem you find. Please report problems to tex@gmv.es.
134%
135%               END OF COPYRIGHT NOTICE
136%
137% Options included in this set: $options
138% Open vowels: $vop
139% Closed vowels: $vcl
140% Consonants: $consonants
141%
142% Some of the patterns below represent combinations that never
143% happen in Basque. Would they happen, they would be hyphenated
144% according to the rules."
145echo
146echo "\
147% This keeps {cat|lc}code changes, if any, local. Nice to users of
148% multilingual versions. These are the minimum changes needed to process
149% the patterns. These and other changes will have to be re-enacted when
150% Basque be established as the current language. See the babel docs if
151% you don't understand this.
152\begingroup"
153if [ $ftc -ne 0 ]
154then
155	echo "\catcode\`'=12 \lccode\`'=\`'"
156fi
157if [ $TeX -ne 0 ]
158then
159	echo "\catcode\`~=12 \lccode\`~=\`~"
160fi
161if [ $isolatin1 -ne 0 ]
162then
163	echo "\
164\catcode\`\^^f1=11 \lccode\`\^^f1=\`\^^f1    % ~n"
165fi
166echo "\
167\patterns{
168% Rule SR1
169% Vowels are kept together by the defaults"
170echo "\
171% Rule SR2
172% Attach vowel groups to left consonant"
173for i in $consonants
174do
175	for j in $vowels
176	do
177		echo -n 1${i}${j}" "
178	done
179	echo
180done
181echo "\
182% Rule SR3
183% Build legal consonant groups, leave other consonants bound to
184% the previous group. This overrides part of the SR2 pattern
185% group."
186for i in $legal
187do
188	set `echo $i | sed -e 's/^./& /'`
189	for j in $vowels
190	do
191		echo -n 1${1}2${2}${j}" "
192	done
193	echo
194done
195echo "\
196% We now avoid some problematic breaks.
197su2b2r su2b2l"
198echo "}"
199echo "\endgroup"
200