home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume36 / translit / part01 next >
Text File  |  1993-03-22  |  62KB  |  1,496 lines

  1. Newsgroups: comp.sources.misc
  2. From: jkl@osc.edu (Jan Labanowski)
  3. Subject: v36i023:  translit - transliterate foreign alphabets, Part01/10
  4. Message-ID: <csm-v36i023=translit.163954@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 1fdf62718ac15c13f16020f8f731cbf8
  6. Date: Fri, 19 Mar 1993 22:40:58 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jkl@osc.edu (Jan Labanowski)
  10. Posting-number: Volume 36, Issue 23
  11. Archive-name: translit/part01
  12. Environment: UNIX, MS-DOS, VMS
  13.  
  14. Available-from: kekule.osc.edu (128.146.36.48) in /pub/russian/translit
  15. Copyright-note: Yes, you have to distribute the complete package.
  16.  
  17. Translit is a general transliteration program.  It transliterates
  18. between different alphabet representations of different languages.
  19.  
  20. It is frequently necessary to convert from one representation to another
  21. representation of the foreign alphabet. E.g., in the Library of Congress
  22. transliteration, the Russian letter sha is transliterated as two Latin
  23. letters "sh" while the popular word processors use a code 232 (decimal),
  24. the RELCOM network uses a code 221, and the KOI7 set uses character "["
  25. for the same letter. So if your screen driver, printer, word processor,
  26. etc. uses different codes than the text file which you have, you need to
  27. transliterate.
  28.  
  29. The TRANSLIT program is a powerful tool for such tasks. It converts an input
  30. file in one representation to the output file in another representation using
  31. appropriate, user defined, transliteration table. Transliteration table allows
  32. for very elaborate transliteration tasks and includes provisions for plain
  33. character sequences, character lists, regular expressions (flexible matches),
  34. SHIFT-OUT/IN sequences and more. The program comes with documentation and
  35. examples of popular transliteration schemes. The Russian language serves
  36. as an example. Other files will be added with your collaboration.
  37.  
  38. The most current version of translit will be available from ftp kekule.osc.edu 
  39. (or ftp 128.146.36.48) in the  directory /pub/russian/translit
  40.  
  41. Via E-mail, first retrieve the file readme.doc. It describes the files in 
  42. the program distribution and has detailed instructions on how to obtain the 
  43. program.  Send the message:
  44.  
  45.      send translit/readme.doc from russian
  46.  
  47. to OSCPOST@osc.edu or OSCPOST@OHSTPY.BITNET.  The file readme.doc will be
  48. forwarded to your mailbox.
  49.  
  50. Enjoy,
  51.  
  52. Author coordinates:
  53. Jan Labanowski
  54. P.O. Box 21821
  55. Columbus, OH 43221-0821, USA
  56. jkl@osc.edu, JKL@OHSTPY.BITNET
  57. -------
  58. #! /bin/sh
  59. # This is a shell archive.  Remove anything before this line, then feed it
  60. # into a shell via "sh file" or similar.  To overwrite existing files,
  61. # type "sh file -c".
  62. # Contents:  translit.1
  63. # Wrapped by kent@sparky on Fri Mar 19 16:00:08 1993
  64. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  65. echo If this archive is complete, you will see the following message:
  66. echo '          "shar: End of archive 1 (of 10)."'
  67. if test -f 'translit.1' -a "${1}" != "-c" ; then 
  68.   echo shar: Will not clobber existing file \"'translit.1'\"
  69. else
  70.   echo shar: Extracting \"'translit.1'\" \(56776 characters\)
  71.   sed "s/^X//" >'translit.1' <<'END_OF_FILE'
  72. X.TH TRANSLIT JKL "23-Jan-1993" JKL "Version 1.0"
  73. X.DA 20 Jan 1993
  74. X.SH NAME
  75. X.IP \fITRANSLIT\fR
  76. XProgram to transliterate texts in different character sets. The program
  77. Xconverts input character codes (or sequences of codes) to a different set
  78. Xof output character codes (or sequences of codes). Intended for
  79. Xtransliteration to/from phonetic representation of foreign letters with
  80. XLatin letters from/to special national codes used for these letters.
  81. XIt supports simple matches, character lists and flexible matches via
  82. Xregular expressions. The new transliteration schemes are easily added
  83. Xby creating simple transliteration tables. Multiple character sets
  84. Xare supported for input and output. It does not yet support UNICODE,
  85. Xbut some day it will.
  86. X
  87. X.SH COPYRIGHT
  88. XCopyright (c) 1993 Jan Labanowski and JKL Enterprises, Inc.
  89. X.br
  90. XYou may distribute the Software only as a complete set of files.
  91. XYou may distribute the modified Software only if you retain the
  92. XCopyright notice and you do not delete original code, data, documentation
  93. Xand associated files.
  94. XThe Software is copyrighted.  You may not sell the software or incorporate
  95. Xit in the commercial product without written permission from
  96. XJan Labanowski or JKL Enterprises, Inc. You are allowed to charge for media
  97. Xand copying if you distribute the whole unaltered package.
  98. X
  99. X.SH SYNOPSIS
  100. X.B translit
  101. X[
  102. X.B -i
  103. X.I inpfile
  104. X][
  105. X.B -o
  106. X.I outfile
  107. X][
  108. X.B -d
  109. X][
  110. X.B -t
  111. X.I transtbl \|\||\|\| transtbl
  112. X]
  113. X.br
  114. X
  115. X.SH OPTIONS
  116. X.IP "\fB-i\fP \fIinpfile\fP"
  117. X.I inpfile
  118. Xis a name of input file to be transliterated.
  119. XIf "\fB-i\fP" is not specified, the input is taken from
  120. Xstandard input.
  121. X.IP "\fB-o\fP \fIoutfile\fP"
  122. X.I outfile
  123. Xis an output file, where the transliterated
  124. Xtext is stored. If "\fB-o\fP"  is not specified, the output is
  125. Xdirected to the standard output. Program will not overwrite the existing
  126. Xfile. If file exists, you need to delete it first.
  127. X.IP "\fB-d\fP"
  128. XSome information on character codes read from transliteration table file
  129. Xare sent to standard error ("\fIstderr\fP"). Useful when developing
  130. Xnew transliteration tables.
  131. X.IP "\fB-t\fP \fItranstbl\fP"
  132. X.I transtbl
  133. Xis a transliteration table file which you want to use. The "\fB-t\fP"
  134. Xoption may be omitted if the \fItranstbl\fR
  135. Xis specified as the last parameter on the
  136. Xcommand line. The program first tries to locate \fItranstbl\fR
  137. Xfile in the current directory, and if not found, it
  138. Xsearches the directory chosen at compilation/installation time in
  139. X"\fIpaths.h\fP". If no "\fItranstbl\fP" is given, the default file name
  140. Xspecified in "\fIpaths.h\fP" is taken. The compile/installation
  141. Xtime defaults in
  142. X"\fIpaths.h\fR" for the search directory and the default
  143. Xfile name can be overiden
  144. Xby setting environment variables: TRANSP and TRANSF, respectively (see below).
  145. X
  146. X.SH ENVIRONMENT VARIABLES
  147. XThe default path to the directory holding transliteration tables can
  148. Xbe overiden by setting environment variable TRANSP. The default name
  149. Xfor the transliteration table can be overiden by setting TRANSF environment
  150. Xvariable. However, when the transliteration file is given on the command line,
  151. Xit will overide the defaults and environment setting.
  152. XHere are some examples of setting environment
  153. Xvariables for different operating systems:
  154. X.sp
  155. X.in +2m
  156. X.br
  157. X\fIUN*X System\fR
  158. X.br
  159. X.nf
  160. X  If you are using \fIcsh\fR (C-shell):
  161. X       setenv TRANSP /home/john/translit/
  162. X       setenv TRANSF koi8-tex.rus
  163. X  If you are using \fIsh\fR (Bourne Shell):
  164. X       set TRANSP=/home/john/translit/
  165. X       export TRANSP
  166. X       set TRANSF=koi8-tex.rus
  167. X       export TRANSF
  168. X\fIVAX-VMS System\fR
  169. X       TRANSP:==SYS$USER:[JOHN.TRANSLIT]
  170. X       TRANSF:==KOI8-TEX.TBL
  171. X\fIPC-DOS or MS-DOS\fR
  172. X       SET TRANSP=C:\|\\\|JOHN\|\\\|TRANSLIT\|\\
  173. X       SET TRANSF=KOI8-TEX.TBL
  174. X.fi
  175. X.in -2m
  176. XNote that the directory path has to include concluding
  177. Xslashes, \|\\\| or \|/\|\|.
  178. X
  179. X
  180. X.SH EXAMPLES
  181. X.ta 5m
  182. X.br
  183. X    cat text.koi8 \|\||\|\| translit koi8-tex.rus > text.tex
  184. X.br
  185. Xin UN*X is equivalent to:
  186. X.sp 1
  187. X    translit -t koi8-tex.rus -o text.tex -i text.koi8
  188. X.br
  189. Xand converts file text.koi8 to file text.tex using transliteration
  190. Xspecified in the file koi8-tex.rus.
  191. X.sp 1
  192. X    translit -i text.koi8 koi8-cl.rus
  193. X.br
  194. Xdisplays the converted text from file text.koi8 on your terminal. The
  195. Xconversion table is koi8-cl.rus (KOI8 --> Library of Congress).
  196. X.sp 1
  197. X    translit -i text.alt -t alt-koi8.rus \|\||\|\| translit -o text.tex -t koi8-tex.rus
  198. X.br
  199. Xis essentially equivalent to the following two commands in UN*X or MS-DOS:
  200. X.br
  201. X    translit -i text.alt -o junkfile -t alt-koi8.rus
  202. X.br
  203. X    translit -i junkfile -o text.tex -t koi8-tex.rus
  204. X.br
  205. Xand converts the file in ALT character set to a LaTeX file for printing.
  206. X.sp
  207. X    translit -i russ.txt pho-koi8.rus \|\||\|\| translit -o russ.tex koi8-tex.rus
  208. X.br
  209. Xconverts file russ.txt from phonetic transliteration to LaTeX file russ.tex
  210. Xfor printing.
  211. X.sp 2
  212. X
  213. X.SH TRANSLITERATION TABLES
  214. XThe following transliteration files are available with the current
  215. Xdistribution. Consult the comments in the individual files for details.
  216. X.IP \fIkoi8-tex.rus\fP
  217. XConversion table which changes the file in KOI8 (8 bit character set
  218. Xused by RELCOM news service) to a LaTeX file for printing with
  219. X\fIAMS\fR WNCYR fonts.
  220. X.IP \fItex-koi8.rus\fP
  221. XConversion table for the LaTeX to KOI8 conversion. Note that it will not
  222. Xhandle complicated cases, since LaTeX is a program, and only TeX can
  223. Xconvert a LaTeX  source to the characters. However, it should work OK
  224. Xfor simple cases of text only files, and may need some editing for
  225. Xcomplicated cases.
  226. X.IP \fIalt-gos.rus\fP
  227. XThis is a transliteration data file for converting from ALT (Bryabrins
  228. Xalternativnyj variant used in many popular wordprocessors)
  229. Xto GOSTSCII 84 (approx. ISO-8859-5?)
  230. X.IP \fIalt-koi8.rus\fP
  231. XThis is a transliteration data file for converting from ALT to KOI8.
  232. XKOI8 is meant to be GOST 19768-74 (as used by RELCOM).
  233. X.IP \fIgos-alt.rus\fP
  234. XThis is a transliteration data file for converting GOSTSCII 84
  235. X(approx. ISO-8859-5?) to ALT (Bryabrins alternativnyj variant)
  236. X.IP \fIgos-koi8.rus\fP
  237. XThis is a transliteration data file for converting GOSTSCII 84
  238. X(approx. ISO-8859-5?) to KOI8 used by RELCOM
  239. XKOI8 is meant to be GOST 19768-74
  240. X.IP \fIkoi8-alt.rus\fP
  241. XThis is a transliteration data file for converting from KOI8.
  242. XKOI8 is meant to be GOST 19768-74, to ALT (Bryabrins alternativnyj variant)
  243. X.IP \fIkoi8-gos.rus\fP
  244. XThis is a transliteration data file for converting from KOI8 (Relcom).
  245. XKOI8 is meant to be GOST 19768-74, to GOSTSCII 84 (approx. ISO-8859-5)
  246. X.IP \fIkoi8-7.rus\fP
  247. XThis file converts from KOI8 to KOI7.
  248. X.IP \fIkoi7-8.rus\fP
  249. XThis file converts from KOI7 to KOI8. Before you attempt the conversion,
  250. Xyou might need to perform a simple edit on your file. You MUST read the
  251. Xcomments in  \fIkoi7-8.rus\fR before you attempt this conversion.
  252. X.IP \fIkoi7nl-8.rus\fP
  253. XThis file assumes that there are only Russian letters (no Latin)
  254. Xin the input file. If you have Latin letters, and you inserted SHIFT-OUT/IN
  255. Xcharacters, use file \fIkoi7-8.rus\fP.
  256. X.IP \fIkoi8-lc.rus\fP
  257. XThis file converts KOI8 to the Library of Congress transliteration.
  258. XSome extensions are added.
  259. X.IP \fIkoi8-php.rus\fP
  260. XThis file converts KOI8 to the Pokrovsky transliteration.
  261. X.IP \fIphp-koi8.rus\fP
  262. XThis file converts from Pokrovsky transliteration to KOI8.
  263. X.IP \fIkoi8-phg.rus\fP
  264. XThis file converts from KOI8 to GOST transliteration.
  265. X.IP \fIphg-koi8.rus\fP
  266. XThis file converts from GOST transliteration to KOI8.
  267. X.IP \fIpho-koi8.rus\fP
  268. XThis is a table which will convert from many "phonetic" transliteration
  269. Xschemes to KOI8. It is elaborate and it takes a lot of time to
  270. Xtransliterate the file using this table. Some transliterations are
  271. Xhopeless and internally inconsistent (as humans...), so the results
  272. Xcannot be bug free.
  273. XYou might want to modify the file, if your transliteration
  274. Xpatterns are different than those assumed in this file. You may also want
  275. Xto simplify this file if the phonetic transliteration you are converting
  276. Xis a sound one (most are not, e.g., they use e for je and e oborotnoye,
  277. Xts for c and t-s, h for kha, i for i-kratkoe, etc.).
  278. X.sp
  279. X
  280. X.SH INTRODUCTION
  281. XIf you do not intend to write your own transliteration tables, you may
  282. Xskip this description and go directly to the installation and
  283. Xcopyright sections. However, you might want to read this material anyhow,
  284. Xto better understand the traps and complexities of transliteration.
  285. XIt is frequently necessary to transliterate text, i.e., to change one set
  286. Xof characters (or composite characters, phonemes, etc.) to another set.
  287. X.PP
  288. XOn computers, the transliteration operation consists of converting the input
  289. Xfile in some character set to the output file in another character set.
  290. X.PP
  291. XIn the simplest case, the single characters are transliterated, i.e, their
  292. Xcodes are changed according to some transliteration table. This is called
  293. Xremapping and, assuming the one-to-one mapping, the task can be accomplished
  294. Xby a simple pseudo program:
  295. X.br
  296. X    new_char_code = character_map[old_char_code];
  297. X.PP
  298. XIf the one-to-one correspondence does not exist (i.e., some codes may
  299. Xbe present in one set, but do not have corresponding codes in another set),
  300. Xprecise transliteration is not possible. In such cases there are 3 obvious
  301. Xpossibilities:
  302. X.br
  303. X    1. skip characters which do not have counterparts,
  304. X.br
  305. X    2. retain unchanged codes of these characters,
  306. X.br
  307. X    3. convert the codes to multicharacter sequences.
  308. X.br
  309. XIn some cases, the file can contain more than one character sets, e.g.,
  310. Xthe file can contain Latin characters (e.g. English text) and Cyrillic
  311. Xcharacters (e.g. Russian text). If the character codes assigned to
  312. Xcharacters in different sets do not overlap, this is still a simple mapping
  313. Xproblem. This is a case with KOI8 or GOSTCII character tables for Russian,
  314. Xwhich reserve the lower 127 codes for standard ASCII codes (which include
  315. Xall Latin characters) and characters with codes above 127 for Cyrillic letters.
  316. X.PP
  317. XIf character codes overlap, there is a SHIFT-OUT/SHIFT-IN technique in
  318. Xwhich the meaning of the character sequence is determined by an opening
  319. Xcode (or sequence of characters codes). In this case, the meaning of the
  320. Xseries of characters is determined by the SHIFT-OUT character (or sequence)
  321. Xwhich precedes them. The SHIFT-IN character (or sequence) following the
  322. Xseries of characters returns the "reader" to the default or previous status.
  323. XTo schemes are used:
  324. X.br
  325. X    (char_set_1)(SHIFT-IN[1])(SHIFT-OUT[2])(char_set_2)...
  326. X.br
  327. Xor
  328. X.br
  329. X    (char_set_1)(SHIFT-OUT[2])(char_set_2)(SHIFT-OUT[1])char_set_1...
  330. X.br
  331. X.sp 1
  332. XSince computer keyboards, screens, printers, software, etc.,  are by necessity
  333. Xlanguage specific (the most popular being ASCII), there is a problem of typing
  334. Xforeign language text which contains letters different than standard Latin
  335. Xalphabet. For this reason, many transliteration schemes use several Latin
  336. Xletters to represent a single letter of foreign alphabet, for example:
  337. X.br
  338. Xzh is used to represent cyrillic letter zhe,  \|\\\|"o may be used to
  339. Xrepresent the o umlaut, etc.
  340. X
  341. XIf there is one-to-one mapping of such sequences to another alphabet, it
  342. Xis also easy to process. However, it is necessary to substitute longest
  343. Xsequences first. For example, a frequently used transliteration
  344. Xfor cyrillic letters:
  345. X.br
  346. X.ta 2mL     7mL 11mL            24mL
  347. X    \fIshch\fR    ---    letter \fBshcza\fR    221 (decimal KOI8 code)
  348. X.br
  349. X    \fIsh\fR    ---    letter \fBsha\fR    219
  350. X.br
  351. X    \fIch\fR    ---    letter \fBcze\fR    222
  352. X.br
  353. X    \fIc\fR    ---    letter \fBtse\fR    195
  354. X.br
  355. X    \fIh\fR    ---    letter \fBkha\fR    200
  356. X.br
  357. X    \fIa\fR    ---    letter \fBa\fR    193
  358. X.PP
  359. XObviously, in this case, we should proceed first with converting all \fIshch\fR
  360. Xsequences to \fBshcha\fR letter, then two-character \fIsh\fR
  361. Xand \fIch\fR, and then single
  362. Xcharacter \fBc\fR and \fBh\fR.
  363. XGenerally, for the one-to-one transliteration, the longest
  364. Xsequences should be precessed first, and the order of conversion within
  365. Xsequences of the same length makes no difference.
  366. XFor example, converting the word "shchah" to KOI8 should proceed in a following
  367. Xway:
  368. X.br
  369. X    \fIshchah\fR --> (221)\fIah\fR, (221)\fIah\fR --> (221)(193)\fIh\fR, (221)(193)\fIh\fR  --> (221)(193)(200)
  370. X.br
  371. XThere is a multitude of reasons why transliteration is done. I wrote this
  372. Xprogram having in mind the following ones:
  373. X.br
  374. X    1) to print cyrillic text using TeX/LaTeX and cyrillic fonts
  375. X.br
  376. X    2) to read KOI8 encoded messages from Russia on my ASCII terminal.
  377. X.br
  378. XHowever, I was trying to make it flexible to accommodate other uses.
  379. X
  380. X.SH PROGRAM OPERATION
  381. XThe program converts the input file to an output file using
  382. Xtransliteration rules from the transliteration rule file which
  383. Xyou specify with option \fB-t\fR.
  384. XSome examples of transliteration rule files are enclosed.
  385. XBefore program can be used, the transliteration rules need to be specified.
  386. X.PP
  387. XThese are given as a file which consist of the following parts
  388. Xdescribed below:
  389. X.br
  390. X.in +2m
  391. X.in +5m
  392. X.ti -5m
  393. X1) File format number (it is 1 at this moment)
  394. X.ti -5m
  395. X2) Delimiters used to enclose a) simple strings, b) character lists,
  396. Xc) regular expressions
  397. X.ti -5m
  398. X3) Starting sequence for output
  399. X.ti -5m
  400. X4) Ending sequence for output
  401. X.ti -5m
  402. X5) Number of input "character sets"
  403. X.ti -5m
  404. X6) SHIFT-OUT/SHIFT-IN sequences for each input character set
  405. X.ti -5m
  406. X7) Number of output "character sets"
  407. X.ti -5m
  408. X8) SHIFT-OUT/SHIFT-IN sequences for each output character set
  409. X.ti -5m
  410. X9) Transliteration table
  411. X.in -5m
  412. X.in -2m
  413. X.PP
  414. X\fIGENERAL COMMENTS\fR
  415. X.br
  416. XThe transliteration rules file consists of comments and data.
  417. XThe comments may be included in the file as:
  418. X.in +5m
  419. X.ti -2m
  420. Xa) line comments --- lines starting with ! or # character (# or ! must be
  421. Xin the first column of a line) are treated as comments and are not
  422. Xread in by the program.
  423. X.ti -2m
  424. Xb) comments following all required entries on the line. They must be
  425. Xseparated by at least one space from the last data entry on the line
  426. Xand need not start with any particular character. These comments cannot
  427. Xbe used within multiline sequences.
  428. X.br
  429. X.in -5m
  430. X.PP
  431. XThe data entries consist of integer numbers and strings.
  432. XThe strings may represent:
  433. X.br
  434. X    a) plain strings
  435. X.br
  436. X    b) character lists
  437. X.br
  438. X    c) regular expressions
  439. X.br
  440. X.PP
  441. XAll strings which appear in the file, are processed through the
  442. X"string processor", which allows entering unprintable characters as codes.
  443. XThe character code is specified as a backslash "\|\\\|" followed by at least
  444. X2 digit(s) (i.e., \|\\\|01 produces code=1, but \|\|\\\|1 is passed unchanged). The
  445. Xfollowing formats are supported:
  446. X.br
  447. X    \|\\\|0123    character of octal code 123 (when leading zero present)
  448. X.br
  449. X    \|\\\|123     character of decimal code 123 (when leading digit is not zero)
  450. X.br
  451. X    \|\\\|0o123  or \|\\\|0O123  character of octal code 123
  452. X.br
  453. X    \|\\\|0d123  or \|\\\|0D123  character of decimal code 123
  454. X.br
  455. X    \|\\\|0xA3   or \|\\\|0XA3 or \|\\\|0xa3   character of hexadecimal code A3
  456. X.br
  457. X.PP
  458. XThe allowed digits are 0-7 for octal codes, 0-9 for decimal codes and
  459. X0-F (and/or 0-f) for hexadecimal codes.
  460. XIn a situation when code has to be followed by a digit character,
  461. Xyou need to enter the
  462. Xdigit as a code. E.g., if you want character \|\\\|0xA3 followed by a letter C,
  463. Xyou need to specify letter C as a code (\|\\\|0x43 or \|\\\|103 or \|\\\|0o103 or \|\\\|0d67)
  464. Xand type the sequence as, e.g.,  \|\\\|0xA3\|\\\|103.
  465. XCharacter resulting in a code 0 (zero) (e.g., \|\\\|00) is special. It tells:
  466. X"skip everything what follows me in this string".
  467. XIt does not make sense to use it, since you can always terminate the
  468. Xsequence with a delimiter. When you use  an empty string as a matching
  469. Xsequence, remember that it does not match anything.
  470. X.sp
  471. XIf the line with entries is too long, you can break it between the
  472. Xfields.
  473. XIf the string is too long to fit a line, you can break it before any nonblank
  474. Xcharacter by the \|\\\| (backslash) followed by white space (i.e., new lines,
  475. Xspaces, tabs, etc.). The \|\\\| and the following white space will be removed
  476. Xfrom the string by the string preprocessor. However, you are not allowed
  477. Xto break the individual character codes (and you probably would not
  478. Xdo it ever for aestetic purposes).
  479. XFor example:
  480. X.br
  481. X    "experi\\
  482. X.br
  483. X    mental design"
  484. X.br
  485. Xis equivalent to:
  486. X.br
  487. X    "experimental design"
  488. X.br
  489. Xwhile:
  490. X.br
  491. X    "experimental\\
  492. X.br
  493. X    design"
  494. X.br
  495. Xis equivalent to:
  496. X.br
  497. X    "experimentaldesign"
  498. X.br
  499. XIf you need to have \|\\\| followed by a space in your string, you need to
  500. Xenter either a backslash or a space following it as an explicit character
  501. Xcode, for example:
  502. X.br
  503. X    "\|\\\|\|\\\|0o40"
  504. X.br
  505. Xwill produce a \|\\\| followed by the space, while the string:
  506. X.br
  507. X    "\|\\\|    "
  508. X.br
  509. Xwill be empty.
  510. X.sp 1
  511. XThe preprocessor knows only about comments, plain characters, character codes,
  512. Xand continuation lines. However, some characters and their combinations
  513. Xmay have a special meaning in lists and regular expressions.
  514. X.sp 2
  515. X\fIDETAILS OF FILE STRUCTURE\fR
  516. X.sp
  517. X.PP
  518. X.in +3m
  519. X.ti -3m
  520. XAd.1) File format number. This is simply a digit 1 on a line by itself at the
  521. Xmoment. This entry is included to allow future extensions of the
  522. Xtransliteration description file without the need to modify older
  523. Xtransliteration descriptions (program will read data according to
  524. Xthe current file format number given in the file).
  525. X.sp
  526. X.ti -3m
  527. XAd.2) String delimiters. The subsequent 3 lines specify pairs of
  528. Xsingle character delimiters for 3 types of text data.
  529. XThe line format is:
  530. X.br
  531. X    opening_character    closing_character.
  532. X.br
  533. XThese are needed to mark the beginning/end and the type of the text data.
  534. XEach string (text datum) is saved starting from the first character after
  535. Xopening delimiter, and ends at the last character before the closing
  536. Xdelimiter. If you need to use the closing delimiter within a string,
  537. Xyou need to specify it as its code (e.g., if you are using () pair as
  538. Xdelimiters, specify ")" as \|\\\|0x29). The opening delimiter may be the same
  539. Xor different from the closing delimiter.
  540. X.sp
  541. X.in +2m
  542. X.ti -2m
  543. Xa) The first line contains characters used to enclose (bracket)
  544. Xa \fIplain string\fR. Plain strings are directly matched to input data or
  545. Xdirectly sent to output.
  546. XI suggest to stick to "  " pair for plain strings.
  547. XThe ASCII code for " is \|\\\|0d34 = \|\\\|0x22 = \|\\\|0o42 if you need it inside the
  548. Xstring itself.
  549. X.sp
  550. X.ti -2m
  551. Xb) The second line contains characters to mark the beginning and the end
  552. Xof the \fIlist\fR. Lists are used to translate single character codes.
  553. XI suggest [ and ] delimiters for the list (ASCII code of "]" is:
  554. X\|\\\|0d93 = \|\\\|0x5D = \|\\\|0o135). The lists may include ranges, for example:
  555. X[a-zA-Z0-9] will include all Latin letters (small and capital) and digits.
  556. XNote that order is important: [a-d] is equivalent to [abcd], while
  557. X[d-a] will result in an error. If you want to include "-" (minus) in the
  558. Xlist, you need to place it as the first or the last character. There are only
  559. Xtwo special characters on the list, the "-" described above, and the "]"
  560. Xcharacter. You need to enter the "]" as its code. E.g., for
  561. XASCII character table [*--] is equivalent to [*+,-], is equivalent to
  562. X[\|\\\|42\|\\\|43\|\\\|44\|\\\|45]. The order of characters in the list does not matter
  563. Xunless the input list corresponds to the output list (this will be
  564. Xexplained later). Empty lists do not make sense.
  565. X.sp
  566. X.ti -2m
  567. Xc) The third line of delimiter specification contains delimiters for
  568. X\fIregular expression\fRs and \fIsubstitution expression\fRs.
  569. XThese strings are used for "flexible" matches
  570. Xto the text in the input file. They are very similar to the ones used in
  571. XUN*X for searching text in utilities like:  grep, sed, vi, awk, etc., though
  572. Xonly a subset of full UN*X regular expression syntax is used here.
  573. XI suggest enclosing them within braces { and } (ASCII code for } is
  574. X\|\\\|0d125 = \|\\\|0x7D = \|\\\|0o175). Actually, regular expressions can only
  575. Xbe used for input sequences, and for output sequences the {} are
  576. Xused to enclose substitution sequences. This will be explained
  577. Xbelow. The description of the
  578. Xsyntax for regular/substitution expressions is
  579. Xadapted from the documentation for the regexp package of Henry
  580. XSpencer, University of Toronto --- this regular expression package
  581. Xwas incorporated, after minute modifications, into the program.
  582. X.br
  583. X.sp 2
  584. X.ce
  585. X\fBREGULAR EXPRESSION SYNTAX\fR
  586. X.br
  587. XA regular expression is zero or more branches, separated  by
  588. X`\|\||\|\|'.  It matches anything that matches one of the branches.
  589. XThe `\|\||\|\|' simply means "or".
  590. X.ti +2m
  591. XA branch is zero or more pieces, concatenated.  It matches a
  592. Xmatch  for  the  first,  followed by a match for the second,
  593. Xetc.
  594. X.ti +2m
  595. XA piece is an atom possibly followed by `*',  `+',  or  `?'.
  596. XAn  atom  followed  by  `*'  matches a sequence of 0 or more
  597. Xmatches of the atom.  An atom  followed  by  `+'  matches  a
  598. Xsequence of 1 or more matches of the atom.  An atom followed
  599. Xby `?' matches zero or one occurrences of atom.
  600. X.ti +2m
  601. XAn atom is a regular expression in parentheses  (matching  a
  602. Xmatch  for the regular expression), a range (see below), `.'
  603. X(matching any single  character),  a `\|\\\|'  followed  by
  604. Xa single character (matching that character), or a
  605. Xsingle character with no other significance  (matching  that
  606. Xcharacter).
  607. X.ti +2m
  608. XA range is a sequence of characters enclosed  in  `[\|\|]'.   It
  609. Xnormally matches any single character from the sequence.  If
  610. Xthe sequence begins with `^', it matches any single  character
  611. Xnot from the rest of the sequence.  If two characters in
  612. Xthe sequence are separated by `-', this is shorthand for the
  613. Xfull  list  of  ASCII  characters between them (e.g. `[0-9]'
  614. Xmatches any decimal digit).  To include a literal `]' in the
  615. Xsequence,  make it the first character (following a possible
  616. X`^').  To include a literal `-', make it the first  or  last
  617. Xcharacter. The regular expression can contains subexpressions
  618. Xwhich are enclosed in a (\|\|) pair. These subexpressions are numbered
  619. X1 to 9 and can be nested. The numbering of subexpressions is
  620. Xgiven in the order of their opening parentheses "(". For
  621. Xexample:
  622. X.br
  623. X.ta        6mL
  624. X    (111)...(22(333)222(444)222)...(555)
  625. X.br
  626. XNote that expression 2 contains within itself expressions 3 and 4.
  627. X.br
  628. XThese subexpressions can be referenced in the substitution string which
  629. Xis described below in the paragraph below, or can be used to delimit
  630. Xatoms.
  631. X.in +2m
  632. XExamples:
  633. X.in +2m
  634. X.ti -2m
  635. X{[\|\\\|0d32\|\\\|0d09]\|\\\|0d10} --- will match space or tab followed by new line
  636. X.ti -2m
  637. X{[Tt][Ss]} --- will match TS, Ts, tS and ts
  638. X.ti -2m
  639. X{TS\|\||\|\|Ts\|\||\|\|tS\|\||\|\|ts} --- same as above
  640. X.ti -2m
  641. X{[\|\\\|0d09-\|\\\|0d15 ][^hH][^uU][a-zA-Z]*[\|\\\|0d09-\|\\\|0d15 ]} --- all words which
  642. Xdo not start with hu, Hu, hU, HU. There is a space between
  643. X\|\\\|0d15 and ].
  644. X.br
  645. XNote that specifying expressions like {.*} (i.e., match all characters)
  646. Xdoes not make much sense, since it would mean here: match the whole input
  647. Xfile. However, expressions like {A.*B} should be acceptable, since they
  648. Xmatch a pair of A and B, and everything in between them, e.g. for a
  649. Xstring like: "This is Mr. Allen and this is Mr. Brown." this expression
  650. Xshould match the string: "Allen and this is Mr. B".
  651. X.br
  652. X.in -4m
  653. XRemember to put a backslash "\|\\\|" in front of the following
  654. Xcharacters: .\|\|[\|\|(\|\|)\|\||\|\|?\|\|+\|\|*\|\|\|\\\| if you want
  655. Xtheir literal meaning outside the
  656. Xrange enclosed in [\|\|]. Inside the range they have their literal meaning.
  657. XIf you know the syntax of UN*X regular expressions, please note that
  658. X\|\|^\|\| and \|$\| anchors are not supported and are treated as normal
  659. Xcharacters (with the exception of \|\|^\|\| negation within [\|\|]).
  660. X.sp
  661. X.ce
  662. X\fBSUBSTITUTION EXPRESSIONS\fR
  663. X.br
  664. XAfter finding a match for a regular expression in the input text,
  665. Xa substitution is made.
  666. XIt can be a simple substitution where the whole matching string
  667. Xis replaced by another string, or it may reuse a portion or
  668. Xthe whole matching string. The subexpressions (the ones enclosed
  669. Xin parentheses) within the regular
  670. Xexpression which matched the input text can be referenced in the
  671. Xsubstitution expression.
  672. XOnly the following characters have special meaning within substitution
  673. Xexpression:
  674. X.in +4m
  675. X.ta  3m
  676. X.br
  677. X.ti -2m
  678. X&    --- will put the whole matching string.
  679. X.ti -2m
  680. X\|\\\|1    --- will put the match for the 1st subexpression in (\|\|).
  681. X.ti -2m
  682. X\|\\\|2    --- will put the string which matched 2nd subexpression,
  683. Xetc.
  684. X.ti -2m
  685. X\|\\\|9    --- will place in a replacement string the 9th
  686. Xsubexpression (provided that there was 9 (\|\|) pairs in
  687. Xthe regular expression)
  688. X.in -4m
  689. X.sp
  690. XOnly 9 subexpressions are allowed.
  691. XAll other characters and sequences within the substitution expression
  692. Xwill be placed in a substitution string as written. To be able to put
  693. Xa single backslash there, you need to put two of them.
  694. XTo be able to place the unchanged codes of the
  695. Xabove characters (i.e., to make them literals), you need to precede them
  696. Xwith a backslash "\|\\\|", i.e., to get & in the output string
  697. Xyou need to write it as \|\\\|&. Similarly, to place literal
  698. X\|\\\|1, \|\\\|2, etc., you need to enter it as \|\\\|\|\\\|1, \|\\\|\|\\\|2, etc.
  699. XNote that characters .+[]()^, etc. which had a special meaning in
  700. Xthe regular expressions, do not have any special meaning in the
  701. Xsubstitution expression and will be output as written.
  702. X.in +2m
  703. XExample:
  704. X.br
  705. XThe regular expression:
  706. X.in +2m
  707. X.ti -2m
  708. X{([Tt])([Ss])} and the corresponding substitution expression {\|\\\|1.\|\\\|2}
  709. Xputs a period
  710. Xbetween adjoining letters t and s preserving their letter case.
  711. X.br
  712. XThe expression:
  713. X.ti -2m
  714. X{([A-Za-z]+)-[ \|\\\|0x09]*([\|\\\|0x0A-\|\\\|0x0D]+)[ \|\\\|0x09]*([A-Za-z,.?;:"\|\\\|)'`!]+)[ \|\\\|0x09]}
  715. X.br
  716. Xand the substitution expression {\|\\\|1\|\\\|3\|\\\|2} dehyphenate words (when you
  717. Xunderstand this one, you are a guru...). For example:
  718. Xcon-   (NL)cert  is changed to concert(NL), where NL stands for New
  719. XLine. It looks for one or more letters (saves them as substring 1)
  720. Xfollowed by a hyphen (which may be followed by zero or more spaces
  721. Xor tabs). The hyphen must be followed by a NewLine (ASCII characters
  722. X0A-0D hex form various new line sequences) and saves NewLine sequence
  723. Xas a subexpression 2.
  724. XThen it looks for zero or more tabs and spaces (at the beginning of
  725. Xthe line). Then it looks for the rest of the hyphenated word and
  726. Xsaves it as substring 3. The word may have punctuation attached.
  727. XThen it looks again for some spaces or tabs. The substitution expression
  728. Xjunks all sequences which were not within (), i.e., hyphen and
  729. Xspaces/tabs and inserts only substrings but in a different
  730. Xorder. The \|\\\|1 (word beginning) is followed by \|\\\|3 (word end) and
  731. Xfollowed by the NewLine --- \|\\\|2. The {\|\\\|2\|\\\|1\|\\\|3} would
  732. Xbe probably equally good, though you would need to  move the punctuation
  733. Xmatching to the beginning of the regular expression.
  734. X.in -6m
  735. X.ti -3m
  736. XAd.3) Starting sequence. This sequence will be sent to the output before
  737. Xany text. It is enclosed in the pair of string delimiters. I use it
  738. Xto output LaTeX preamble. However, it can be empty, if not used.
  739. XThe (sequence) may contain any characters, including new lines, etc.
  740. X.nf
  741. X.ta 2m 4m
  742. X    Example:
  743. X        ""          # empty sequence
  744. X.sp
  745. X    Example:
  746. X        "\|\\\|documentstyle{article}
  747. X        \|\\\|input cyracc
  748. X        \|\\\|begin{document}
  749. X        "
  750. X    is right (note a new line at the end), but
  751. X.br
  752. X        "\|\\\|documentstyle{article}
  753. X        \|\\\|input cyracc       # this comment will be included!
  754. X        \|\\\|begin{document}"   # while this will not
  755. X    is wrong.
  756. X.sp
  757. X.fi
  758. X.ti -3m
  759. XAd.4) Ending sequence. Similar to 1), but will be appended at the end of the
  760. Xoutput file.
  761. X.nf
  762. X    For example:
  763. X        "\|\\\|end{document}
  764. X        "
  765. X.fi
  766. X.sp
  767. X.ti -3m
  768. XAd.5) Number of input character sets. For example, in some incarnation of
  769. XKOI7, there are two character sets: Latin and Cyrillic. Cyrillic
  770. Xcharacter sequence follows SHIFT-OUT character (CTRL-N), \|\\\|0x0e,
  771. Xand is terminated by SHIFT-IN character (CTRL-O), \|\\\|0x0f.
  772. XAnother way of looking at it is that Latin characters follow
  773. XCTRL-O and  cyrillic ones follow CTRL-N.
  774. X.sp
  775. XIf there is only one character set on input you should specify 0
  776. Xas a number of input char sets,
  777. Xsince the input file obviously does not contain any SHIFT-OUT/IN
  778. Xsequences.
  779. X.sp
  780. X.ti -3m
  781. XAd.6) SHIFT-OUT/SHIFT-IN sequences for each input character set.
  782. XThese lines appear only if you specified nonzero number of character sets. 
  783. XThese lines contain also "nesting sequences", which will be
  784. Xexplained later in this section.
  785. XYou do not use "nesting sequences" frequently, and let us assume
  786. Xfor a moment that nesting data are empty strings.
  787. XThe strings or regular expressions specified here are matched
  788. Xwith the contents of input text. If match was found, the matching sequence
  789. Xis usually deleted from the input text and:
  790. X.in +4m
  791. X.ti -2m
  792. Xa) for SHIFT-OUT sequence: the current input character set number is changed
  793. Xto the new one corresponding to the SHIFT-OUT sequence, or
  794. X.ti -2m
  795. Xb) for SHIFT-IN sequence: the previous input character set number is restored,
  796. X(i.e., the one which preceded the SHIFT-OUT sequence for the current set).
  797. XNote that only the SHIFT-IN sequence for the current set is matched.
  798. XThe SHIFT-IN sequences for other character sets than the current set are
  799. Xnot matched.
  800. XThe bracketing of sets is assumed
  801. Xperfect. If the SHIFT-IN sequence for the current set is an empty string,
  802. Xthe input set number is changed when SHIFT-OUT sequence of the new set
  803. Xis detected.
  804. X.in -4m
  805. XFor each input character set, you have to specify a line consisting
  806. Xof 6 strings/expressions separated by spaces:
  807. X.br
  808. X  SO-match SO-subs NEST-up NEST-down SI-match SI-subs
  809. X.br
  810. Xwhere:
  811. X.br
  812. X.in +2m
  813. X.ti -2m
  814. XSO-match --- the string or regular expression for the SHIFT-OUT sequence
  815. Xfor the current character set. If detected, the input character set is
  816. Xchanged to this set.
  817. X.ti -2m
  818. XSO-subs --- this is usually an empty string (i.e., the input sequence
  819. Xmatching SO-match is removed). But it can be a replacement string or
  820. Xa substitution expression, which will substitute the original matching
  821. XSHIFT-OUT sequence.
  822. X.ti -2m
  823. XNEST-up --- this string (or a regular expression) is usually an empty
  824. Xstring). However, it can be used to count brackets for detection of SHIFT-IN
  825. Xbracket, if SHIFT-IN sequence is not unique. Its use is explained below.
  826. X.ti -2m
  827. XNEST-down --- a counterpart of NEST-up. It is explained later.
  828. X.ti -2m
  829. XSI-match --- when a sequence in an input file matches the string or regular
  830. Xexpression given as SI-match for a current input character set, the
  831. Xinput character set number is restored to the previous set. Note, that
  832. Xonly SI-match for a current set is matched with input characters.
  833. X.ti -2m
  834. XSI-subs --- this is usually an empty string (i.e., input sequence which
  835. Xmatched SI-match is removed), but if it is not, the input characters which
  836. Xmatched the SI-match are replaced with the SI-subs.
  837. X.sp
  838. X.in -2m
  839. X.br
  840. XThe KOI7 case described above may be specified as:
  841. X.nf
  842. X.ta 5m  10m  15m 20m 25m
  843. X.nf
  844. X    2                     # 2 input sets
  845. X    ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  # Latin(set 1)
  846. X    "\|\\\|016"  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  "\|\\\|017"  ""\0\0\0\0  # Cyrillic(set 2)
  847. X             or
  848. X    2                     # 2 sets
  849. X    "\|\\\|017"  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  # Latin(set 1)
  850. X    "\|\\\|016"  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  # Cyrillic(set 2)
  851. X.fi
  852. X.br
  853. XBefore the input is processed, the program is initialized to the character
  854. Xset of the first set. In the above case, it is important, since declaration:
  855. X.nf
  856. X    2                     # 2 sets
  857. X    "\|\\\|016"  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  # Cyrillic(set 1)
  858. X    "\|\\\|017"  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  ""\0\0\0\0  # Latin(set 2)
  859. X.br
  860. X.fi
  861. Xwould be wrong and would mess up the Latin characters preceding
  862. Xfirst Cyrillic sequence.
  863. X.sp 1
  864. XThe nesting sequences are used only for specific situations. I needed them
  865. Xto write a transliteration table from LaTeX to KOI8.
  866. XIn LaTeX the { } pair is used for grouping and appears frequently in
  867. Xthe text. The sequence of cyrillic characters is also a group
  868. Xin LaTeX.
  869. XThe SHIFT-OUT sequence for Russian letters in LaTeX is (at least in
  870. Xmy case): "{\|\\\|cyr ", and the end
  871. Xof the Russian letters is marked by "}", but the "}" has to be the
  872. Xbracket matching the opening "{" in "{\|\\\|cyr ",  not just any bracket.
  873. XFor this reason, my SHIFT-OUT/IN entry was in this case:
  874. X.br
  875. X    "{\|\\\|cyr "  ""  "{"  "}"  "}"  ""   # Cyrillic codes
  876. X.br
  877. XWhenever the "{\|\\\|cyr " was found, the program zeroes the counter.
  878. XIt adds +1 to it, when NEST-up sequence (i.e., the "{" here) is found, and
  879. Xsubtracts 1 from it, when the NEST-down sequence is found (i.e., the "}").
  880. XThe checking for a SHIFT-IN sequence (i.e., the "}") for cyrillic set
  881. Xis done only when
  882. Xthe counter value is zero (i.e., all pairs inside the cyrillic text are
  883. Xmatched. In fact, the process is more
  884. Xcomplicated than that (the counter for an opened character set is
  885. Xplaced on the stack), but these are details you can find in the code
  886. Xitself.
  887. X.sp
  888. X.ti -3m
  889. XAd.7) Number of output "character sets". This is analogous to the input case.
  890. XThe characters sent to output may belong to different sets. For example,
  891. Xwhen the character (or the sequence) from set 2 is followed by the character
  892. X(or the sequence) from set 1,
  893. Xthe program first sends the SHIFT-IN sequence for set 2 (if it is not
  894. Xempty) and then the SHIFT-OUT sequence for set 1 (if it is not empty). If the
  895. Xoutput character (or sequence) is assigned to set 0, then no SHIFT-IN/SHIFT-OUT
  896. Xsequences are sent to output.
  897. X.br
  898. XIf there is only one set of output characters, you should specify 0.
  899. XNote that you may have several input sets and several output sets, though
  900. Xthis is rare. Usually, you have one input set and many
  901. Xoutput character sets, or vice versa. Again, if you have only one output set,
  902. Xyou do not have any SHIFT-IN/SHIFT-OUT sequences, since those are
  903. Xsend to output only when a set number is changed.
  904. XBut you are free to experiment.
  905. X.sp
  906. X.ti -3m
  907. XAd.8) SHIFT-OUT/SHIFT-IN sequences for each output character set. It is
  908. Xsimilar to the input case, however, the NEST-in and NEST-up sequences
  909. Xare not used here. Again, before any text is sent to output, the
  910. Xcharacter set specified as the first one is assumed. If SHIFT-OUT/IN
  911. Xsequences are not used (i.e., you have only one output character set),
  912. Xyou will not have any SHIFT-OUT/SHIFT-IN data lines.
  913. XThe KOI8 (single character set containing all Latin and Russian letters)
  914. Xto KOI7 (the set using overlapping codes switched by SHIFT-OUT/IN sequences)
  915. Xconversion could be therefore accomplished by the following table:
  916. X.br
  917. X    2        # 2 output sets
  918. X.br
  919. X    ""\0\0\0\0    ""\0\0\0\0    # Latin Letters
  920. X.br
  921. X    "\|\\\|016"    "\|\\\|017"    # Russian Letters
  922. Xcase
  923. X.sp
  924. X.ti -3m
  925. XAd.9) Transliteration table for individual character or their sequences.
  926. XIt is a core of your transliteration data.
  927. XThere are 4 columns in the transliteration
  928. Xtable:
  929. X.br
  930. X.in +3m
  931. X(inp_set_no) (inp_seq) (out_set_no) (out_seq)
  932. X.br
  933. X.in -3m
  934. XThese 4 columns are separated by spaces. The (input_set_number)
  935. Xcorresponds to the input character set number as specified above for
  936. Xinput SHIFT-OUT/SHIFT-IN data, or zero.
  937. XIf zero is used (even if number of input sets is not zero), the
  938. X(input_sequence) will be always matched, irrespectively of the current
  939. Xinput character set imposed by the SHIFT-OUT sequence. This is useful,
  940. Xsince some characters are universal (e.g., new lines, spaces, pluses,
  941. Xminuses, etc.) irrespectively of the current character set.
  942. XThe (input_sequence) is the sequence of characters to be matched with
  943. Xcharacters in the input file, and if found (within the character set
  944. Xspecified) it is replaced by the (output_sequence) and sent to output
  945. X(i.e., the matching is interrupted, the (output_sequence) sent to ouput,
  946. Xthe input file pointer is moved to the first character after the
  947. Xmatched sequence and matching resumes).
  948. XThe (output_set_number) specifies the output character set. When the
  949. Xoutput character set changes during transliteration, the appropriate SHIFT-IN
  950. Xsequence of the previous set and the current set's SHIFT-OUT sequence is sent
  951. Xto output. The (output_set_number) may also be zero (even if number of
  952. Xoutput sets is not zero). In this case, the current output set status
  953. Xis not changed, and no SHIFT-IN/OUT sequences is sent to output. Lastly, the
  954. Xoutput set code may be -1, -2 or -3.
  955. XIn this case, the substitution is performed
  956. Xwithin input string that matched but the output sequence is not sent to
  957. Xthe output yet. Depending on the code, the following action is performed:
  958. X.in +4m
  959. X.ti -2m
  960. X-1  --- program makes the substitution in the input string (i.e., substitutes
  961. Xthe matching string with the input string in the input buffer).
  962. XIt does not send the output sequence to the output, but
  963. Xcontinues matching  input sequences following the currently
  964. Xmatched one.
  965. X.ti -2m
  966. X-2  --- like code -1, but matching is resumed from the first sequence on
  967. Xthe list.
  968. X.ti -2m
  969. X-3  --- like code -1, but matching is resumed from the input SHIFT-OUT/IN
  970. Xsequences.
  971. X.in -4m
  972. XE.g., if the unprocessed text in the input file is:
  973. X.br
  974. X    mental procedure was not successful since..........
  975. X.br
  976. Xand there was a line in transliteration table:
  977. X.br
  978. X    0  "me"   -1  "you"
  979. X.br
  980. Xthe input text would be changed to:
  981. X.br
  982. X    yountal procedure was not successful since..........
  983. X.br
  984. Xand all remaining matching data would be applied to this text, rather than
  985. Xoriginal text.
  986. XThe -2 code backsteps to the point where the matching of
  987. Xtransliteration starts.
  988. XThe -3 code backsteps even further, to the point where the
  989. Xinput SHIFT-OUT and SHIFT-IN sequences are matched.
  990. XSince the order of sequences to match
  991. Xis crucial here, for the case of output set code -1/-2/-3
  992. Xeven one-character input sequences are matched in the order specified.
  993. XBE CAREFUL HERE. You may create infinite loops. If you use
  994. Xcode -2/-3, be sure that the resulting sequence after substitution
  995. Xwith the code -2/-3, will not match previous sequences
  996. Xwith codes -2/-3.
  997. X.br
  998. XThe (output_sequence)
  999. Xis a sequence which substitutes the corresponding (input_sequence).
  1000. XIf (output_sequence) is "" (i.e., empty string) then (input_sequence)
  1001. Xis effectively deleted.
  1002. XThe (input_sequence)s are compared with input in the order specified
  1003. Xunless backstepping -2/-3 code is used (the matching is done from the
  1004. Xfirst sequence again). I use the code -1 e.g.,
  1005. Xto dehyphenate words when changing to LaTeX.
  1006. XCode -2 is useful if you want to skip next comparisons, and the resulting
  1007. Xsubstitution string will match earlier matching expressions.
  1008. XI do not see any use for the code -3, but you may have one.
  1009. XThe order for multicharacter sequences is
  1010. Xtherefore important (the single character sequences are always compared
  1011. Xafter all multicharacter sequences, and can be therefore put anywhere).
  1012. XThe longer multicharacter sequences should be specified before
  1013. Xshorter ones, unless they are some "preprocessing" steps with codes
  1014. X-1/-2/-3. The order may sometimes be crucial.
  1015. XIf you need single character sequences matched in a specific order,
  1016. Xenter them as regular expressions, i.e., as {c} instead of "c".
  1017. XIn short, the multicharacter input sequences and regular expressions
  1018. Xare matched to input text in the order specified. For the sake of
  1019. Xefficiency, the single character input sequences (with exception of
  1020. Xoutput set code -1/-2/-3) and input lists are handled as a case of remapping
  1021. Xand are matched in the order of character codes associated with them.
  1022. XIf you specify the same single input character twice for a given input set,
  1023. Xthe program will complain.
  1024. XThe following combinations of input and output sequences are allowed:
  1025. X.nf
  1026. X.ta 2m 24m
  1027. X    Input Sequence    Output Sequence
  1028. X    "\fIplain string\fR"    only "\fIplain string\fR"
  1029. X    [\fIlist\fR]    [\fIlist\fR] or "\fIplain string\fR"
  1030. X    {\fIregular expression\fR}    {\fIsubstitution expression\fR} or
  1031. X.br
  1032. X         "\fIplain string\fR"
  1033. X.br
  1034. X.fi
  1035. XWhen match is found, the matching sequence is removed and substituted
  1036. Xwith an output sequence. If this results is changing the current output
  1037. Xcharacter set, the appropriate SHIFT-IN/SHIFT-OUT pair is sent to the
  1038. Xoutput before the transliterated output sequence. If list is
  1039. Xused as the input sequence, you may either use:
  1040. X.br
  1041. X.in +2m
  1042. X.ti -2m
  1043. Xa) plain string as output
  1044. Xsequence. In this case, if current input character belongs to the input list,
  1045. Xit is replaced by the output string. I use it to delete ranges of
  1046. Xcharacters which do not have any corresponding characters in the output
  1047. Xset (e.g., some graphics characters). In this case, the order of
  1048. Xcharacters on the input list is not important.
  1049. X.ti -2m
  1050. Xb) if the output string is also a
  1051. Xlist then it has to contain exactly the same number of characters as
  1052. Xthe input list. In this case, the 1st character from the input list
  1053. Xis replaced by the 1st character from the output list, the 2nd one
  1054. Xby the 2nd one, etc. Therefore, the order of characters is important.
  1055. X.br
  1056. X.in -2m
  1057. XTheoretically, if there is one-to-one correspondence between characters
  1058. Xin the input set and characters in the output set,
  1059. Xyou can make the conversion by
  1060. Xusing a single line consisting of two lists. But it looks ugly... And is
  1061. Xdifficult to read.
  1062. XAnd for the program, the substitution takes the same time, if
  1063. Xthe characters are specified separately, or when they are specified
  1064. Xas matching lists.
  1065. XIf regular expression is used to match the input characters, the matching
  1066. Xsequence may be replaced by a plain string or a substitution string,
  1067. Xwhich was described above.
  1068. X.in +3m
  1069. XExamples:
  1070. X.br
  1071. X.ta 3m 10m  20m 30m  40m
  1072. X    2    "CCCP"    0    ""\0\0\0\0
  1073. X.br
  1074. Xwill delete all occurrences of CCCP from the input file (but not Cccp or
  1075. XCCCp) for input set 2.
  1076. X.sp 1
  1077. X    0    "\|\\\|0xD1"    0    "ya"
  1078. X.br
  1079. Xwill replace all occurrences of character of the code \|\\\|0xD1 with a two
  1080. Xletter sequence "ya".
  1081. X.sp 1
  1082. X    0    \|\\\|0xD1    2    q
  1083. X.br
  1084. Xwill replace all characters \|\\\|0xD1 with a character "q" and output
  1085. XSHIFT-IN/OUT sequence if necessary.
  1086. X.sp 1
  1087. X    2    "q"    0    "\|\\\|0xD1"
  1088. X.br
  1089. Xwill replace letter q (if the current input set is 2) with a code \|\\\|0xD1.
  1090. X.sp 1
  1091. X    0    "\|\\\|0xD1"    2    "ya"
  1092. X.br
  1093. Xwill replace code \|\\\|0xD1 with a sequence ya (assuming that SHIFT-OUT
  1094. Xand SHIFT-IN sequences
  1095. Xfor output set 2 are: {\|\\\|cyr and }, respectively, you will get {\|\\\|cyr ya}).
  1096. X.sp
  1097. XIf a character is not specified in the transliteration table, it will
  1098. Xbe output as is, i.e., it corresponds to a line:
  1099. X.br
  1100. X    0    "c"    0    "c"
  1101. X.br
  1102. Xwhere c is the character. If you want to delete certain characters, you
  1103. Xneed to explicitly specify this, e.g.:
  1104. X.br
  1105. X    0    [a-z]    0    ""
  1106. X.br
  1107. Xwill delete all lower case Latin letters from the text.
  1108. X.in -3m
  1109. XBefore you decide to create your own transliteration file, please examine
  1110. Xexisting transliteration files. Do yourself (and others) a favor --- put
  1111. Xas many comments as possible there. If you allow others to use your
  1112. Xtransliteration files, please include your name and e-mail address
  1113. Xand file creation date.
  1114. X.in -4m
  1115. X.sp 2
  1116. XProgram  matches the sequences in a specific order:
  1117. X.in +4m
  1118. X.ti -2m
  1119. X\01) Match/substitute input SHIFT-OUT sequences
  1120. X.ti -2m
  1121. X\02) If matched, save current set and start new one
  1122. X.ti -2m
  1123. X\03) If matched, zero nest counter for NEST sequences
  1124. X.ti -2m
  1125. X\04) Match/substitute current set SHIFT-IN-sequence
  1126. X.ti -2m
  1127. X\05) If matched, restore previous set number
  1128. X.ti -2m
  1129. X\06) If matched, restore previous set nest counter
  1130. X.ti -2m
  1131. X\07) Match/substitute transliteration sequences
  1132. X.ti -2m
  1133. X\08) If matched and code = -1 make substitution in input buffer and
  1134. Xcontinue matching the next sequence.
  1135. X.ti -2m
  1136. X\09) If matched and code = -2 make substitution and goto 7)
  1137. X.ti -2m
  1138. X10) If matched and code = -3 make substitution and goto 1)
  1139. X.ti -2m
  1140. X11) Match (no substitution) NEST-up and NEST-down to input buffer
  1141. X.ti -2m
  1142. X12) If NEST-up matched, increment counter for current set
  1143. X.ti -2m
  1144. X13) If NEST-down matched, decrement counter for current set
  1145. X.ti -2m
  1146. X14) If match in 7) send substitute sequence to output
  1147. X.ti -2m
  1148. X15) If no match in 7) (or code -1) output current input character
  1149. X.ti -2m
  1150. X16) Advance input pointer to point at new characters
  1151. X.ti -2m
  1152. X17) If End of File, break
  1153. X.ti -2m
  1154. X18) Goto 1)
  1155. X.br
  1156. X.fi
  1157. X
  1158. X.PP
  1159. X.SH ASCII CHARACTER CODES
  1160. X.nf
  1161. X.ta 2m 6m 9m 13m 16m 20m 22m 26m 29m 33m 36m 40m
  1162. X    dec    hx    oct    ch        dec    hx    oct    ch
  1163. X
  1164. X    \0\00    00    000    ^@    NUL    \064    40    100    @
  1165. X    \0\01    01    001    ^A    SOH    \065    41    101    A
  1166. X    \0\02    02    002    ^B    STX    \066    42    102    B
  1167. X    \0\03    03    003    ^C    ETX    \067    43    103    C
  1168. X    \0\04    04    004    ^D    EOT    \068    44    104    D
  1169. X    \0\05    05    005    ^E    ENQ    \069    45    105    E
  1170. X    \0\06    06    006    ^F    ACK    \070    46    106    F
  1171. X    \0\07    07    007    ^G    BEL    \071    47    107    G
  1172. X    \0\08    08    010    ^H    BS    \072    48    110    H
  1173. X    \0\09    09    011    ^I    HT    \073    49    111    I
  1174. X    \010    0a    012    ^J    LF    \074    4a    112    J
  1175. X    \011    0b    013    ^K    VT    \075    4b    113    K
  1176. X    \012    0c    014    ^L    FF    \076    4c    114    L
  1177. X    \013    0d    015    ^M    CR    \077    4d    115    M
  1178. X    \014    0e    016    ^N    SO    \078    4e    116    N
  1179. X    \015    0f    017    ^O    SI    \079    4f    117    O
  1180. X    \016    10    020    ^P    DLE    \080    50    120    P
  1181. X    \017    11    021    ^Q    DC1    \081    51    121    Q
  1182. X    \018    12    022    ^R    DC2    \082    52    122    R
  1183. X    \019    13    023    ^S    DC3    \083    53    123    S
  1184. X    \020    14    024    ^T    DC4    \084    54    124    T
  1185. X    \021    15    025    ^U    NAK    \085    55    125    U
  1186. X    \022    16    026    ^V    SYN    \086    56    126    V
  1187. X    \023    17    027    ^W    ETB    \087    57    127    W
  1188. X    \024    18    030    ^X    CAN    \088    58    130    X
  1189. X    \025    19    031    ^Y    EM    \089    59    131    Y
  1190. X    \026    1a    032    ^Z    SUB    \090    5a    132    Z
  1191. X    \027    1b    033    ^[    ESC    \091    5b    133    [
  1192. X    \028    1c    034    ^\\    FS    \092    5c    134    \\
  1193. X    \029    1d    035    ^]    GS    \093    5d    135    ]
  1194. X    \030    1e    036    ^^    RS    \094    5e    136    ^
  1195. X    \031    1f    037    ^_    US    \095    5f    137    _
  1196. X    \032    20    040        SP    \096    60    140    `
  1197. X    \033    21    041    !        \097    61    141    a
  1198. X    \034    22    042    "        \098    62    142    b
  1199. X    \035    23    043    #        \099    63    143    c
  1200. X    \036    24    044    $        100    64    144    d
  1201. X    \037    25    045    %        101    65    145    e
  1202. X    \038    26    046    &        102    66    146    f
  1203. X    \039    27    047    '        103    67    147    g
  1204. X    \040    28    050    (        104    68    150    h
  1205. X    \041    29    051    )        105    69    151    i
  1206. X    \042    2a    052    *        106    6a    152    j
  1207. X    \043    2b    053    +        107    6b    153    k
  1208. X    \044    2c    054    ,        108    6c    154    l
  1209. X    \045    2d    055    -        109    6d    155    m
  1210. X    \046    2e    056    .        110    6e    156    n
  1211. X    \047    2f    057    /        111    6f    157    o
  1212. X    \048    30    060    0        112    70    160    p
  1213. X    \049    31    061    1        113    71    161    q
  1214. X    \050    32    062    2        114    72    162    r
  1215. X    \051    33    063    3        115    73    163    s
  1216. X    \052    34    064    4        116    74    164    t
  1217. X    \053    35    065    5        117    75    165    u
  1218. X    \054    36    066    6        118    76    166    v
  1219. X    \055    37    067    7        119    77    167    w
  1220. X    \056    38    070    8        120    78    170    x
  1221. X    \057    39    071    9        121    79    171    y
  1222. X    \058    3a    072    :        122    7a    172    z
  1223. X    \059    3b    073    ;        123    7b    173    {
  1224. X    \060    3c    074    <        124    7c    174    |
  1225. X    \061    3d    075    =        125    7d    175    }
  1226. X    \062    3e    076    >        126    7e    176    ~
  1227. X    \063    3f    077    ?        127    7f    177    DEL
  1228. X
  1229. X.br
  1230. X
  1231. X.SH CONVERSION: DECIMAL<-->OCTAL<-->HEX.
  1232. X.nf
  1233. X.cs R 24
  1234. X 000  000  00     064  100  40     128  200  80     192  300  C0   
  1235. X 001  001  01     065  101  41     129  201  81     193  301  C1   
  1236. X 002  002  02     066  102  42     130  202  82     194  302  C2   
  1237. X 003  003  03     067  103  43     131  203  83     195  303  C3   
  1238. X 004  004  04     068  104  44     132  204  84     196  304  C4   
  1239. X 005  005  05     069  105  45     133  205  85     197  305  C5   
  1240. X 006  006  06     070  106  46     134  206  86     198  306  C6   
  1241. X 007  007  07     071  107  47     135  207  87     199  307  C7   
  1242. X 008  010  08     072  110  48     136  210  88     200  310  C8   
  1243. X 009  011  09     073  111  49     137  211  89     201  311  C9   
  1244. X 010  012  0A     074  112  4A     138  212  8A     202  312  CA   
  1245. X 011  013  0B     075  113  4B     139  213  8B     203  313  CB   
  1246. X 012  014  0C     076  114  4C     140  214  8C     204  314  CC   
  1247. X 013  015  0D     077  115  4D     141  215  8D     205  315  CD   
  1248. X 014  016  0E     078  116  4E     142  216  8E     206  316  CE   
  1249. X 015  017  0F     079  117  4F     143  217  8F     207  317  CF   
  1250. X 016  020  10     080  120  50     144  220  90     208  320  D0   
  1251. X 017  021  11     081  121  51     145  221  91     209  321  D1   
  1252. X 018  022  12     082  122  52     146  222  92     210  322  D2   
  1253. X 019  023  13     083  123  53     147  223  93     211  323  D3   
  1254. X 020  024  14     084  124  54     148  224  94     212  324  D4   
  1255. X 021  025  15     085  125  55     149  225  95     213  325  D5   
  1256. X 022  026  16     086  126  56     150  226  96     214  326  D6   
  1257. X 023  027  17     087  127  57     151  227  97     215  327  D7   
  1258. X 024  030  18     088  130  58     152  230  98     216  330  D8   
  1259. X 025  031  19     089  131  59     153  231  99     217  331  D9   
  1260. X 026  032  1A     090  132  5A     154  232  9A     218  332  DA   
  1261. X 027  033  1B     091  133  5B     155  233  9B     219  333  DB   
  1262. X 028  034  1C     092  134  5C     156  234  9C     220  334  DC   
  1263. X 029  035  1D     093  135  5D     157  235  9D     221  335  DD   
  1264. X 030  036  1E     094  136  5E     158  236  9E     222  336  DE   
  1265. X 031  037  1F     095  137  5F     159  237  9F     223  337  DF   
  1266. X 032  040  20     096  140  60     160  240  A0     224  340  E0   
  1267. X 033  041  21     097  141  61     161  241  A1     225  341  E1   
  1268. X 034  042  22     098  142  62     162  242  A2     226  342  E2   
  1269. X 035  043  23     099  143  63     163  243  A3     227  343  E3   
  1270. X 036  044  24     100  144  64     164  244  A4     228  344  E4   
  1271. X 037  045  25     101  145  65     165  245  A5     229  345  E5   
  1272. X 038  046  26     102  146  66     166  246  A6     230  346  E6   
  1273. X 039  047  27     103  147  67     167  247  A7     231  347  E7   
  1274. X 040  050  28     104  150  68     168  250  A8     232  350  E8   
  1275. X 041  051  29     105  151  69     169  251  A9     233  351  E9   
  1276. X 042  052  2A     106  152  6A     170  252  AA     234  352  EA   
  1277. X 043  053  2B     107  153  6B     171  253  AB     235  353  EB   
  1278. X 044  054  2C     108  154  6C     172  254  AC     236  354  EC   
  1279. X 045  055  2D     109  155  6D     173  255  AD     237  355  ED   
  1280. X 046  056  2E     110  156  6E     174  256  AE     238  356  EE   
  1281. X 047  057  2F     111  157  6F     175  257  AF     239  357  EF   
  1282. X 048  060  30     112  160  70     176  260  B0     240  360  F0   
  1283. X 049  061  31     113  161  71     177  261  B1     241  361  F1   
  1284. X 050  062  32     114  162  72     178  262  B2     242  362  F2   
  1285. X 051  063  33     115  163  73     179  263  B3     243  363  F3   
  1286. X 052  064  34     116  164  74     180  264  B4     244  364  F4   
  1287. X 053  065  35     117  165  75     181  265  B5     245  365  F5   
  1288. X 054  066  36     118  166  76     182  266  B6     246  366  F6   
  1289. X 055  067  37     119  167  77     183  267  B7     247  367  F7   
  1290. X 056  070  38     120  170  78     184  270  B8     248  370  F8   
  1291. X 057  071  39     121  171  79     185  271  B9     249  371  F9   
  1292. X 058  072  3A     122  172  7A     186  272  BA     250  372  FA   
  1293. X 059  073  3B     123  173  7B     187  273  BB     251  373  FB   
  1294. X 060  074  3C     124  174  7C     188  274  BC     252  374  FC   
  1295. X 061  075  3D     125  175  7D     189  275  BD     253  375  FD   
  1296. X 062  076  3E     126  176  7E     190  276  BE     254  376  FE   
  1297. X 063  077  3F     127  177  7F     191  277  BF     255  377  FF   
  1298. X.cs R
  1299. X.br
  1300. X.sp
  1301. X.fi
  1302. X
  1303. X.SH INSTALLATION
  1304. XProgram is given in a source form. It was tried under UN*X, VMS and
  1305. XMS-DOS systems and ran. The file \fIreadme.doc\fR contains the details
  1306. Xon how to obtain the whole package. You can retrieve this file
  1307. Xfrom anonymous ftp on kekule.osc.edu in the directory /pub/russian/translit.
  1308. XYou can also obtain it via e-mail by sending a message:
  1309. X.br
  1310. X    get translit/readme.doc from russian
  1311. X.br
  1312. Xto OSCPOST@osc.edu or OSCPOST@OHSTPY.BITNET.
  1313. X.sp
  1314. XThe source of the program consists of several files:
  1315. X.br
  1316. X.IP  \fIpaths.h\fR
  1317. Xmust be edited before compilation. It contains its
  1318. Xown comments what to do. The defines in this file relate to the operating
  1319. Xsystem you are using and the default path for searching transliteration
  1320. Xtable.
  1321. X.br
  1322. X.IP \fItranslit.c\fR
  1323. XIt contains the main program.
  1324. XThis was intended to be a portable code.
  1325. X.br
  1326. X.IP \fIreg_exp.h\fR
  1327. Xthe include file for regular expression matching
  1328. Xlibrary of Henry Spencer from the University of Toronto. This regular
  1329. Xexpression package was posted to comp.sources.misc (volume 3). Also 4 patches
  1330. Xwere posted (in volumes: 3, 4, 4, 10). I applied the patches to the original
  1331. Xcode and made small modifications to the code, which are marked in the
  1332. Xsource code.
  1333. X.br
  1334. X.IP \fIreg_exp.c\fR
  1335. Xthe regular expression library for compilation and
  1336. Xmatching of regular expressions.
  1337. X.br
  1338. X.IP \fIreg_sub.c\fR
  1339. Xthe regular expression substitution routine.
  1340. X.br
  1341. X.sp
  1342. X.PP
  1343. XBefore you compile this program you have to edit \fIpaths.h\fR.
  1344. XRead comments in the file.
  1345. XDuring compilation, all source code should reside in the
  1346. Xcurrent directory.
  1347. X.br
  1348. XThen you may compile the program under UN*X as (for example):
  1349. X.br
  1350. X    cc -o translit translit.c reg_exp.c reg_sub.c
  1351. X.br
  1352. Xand copy the program \fItranslit\fR to some standard directory which is
  1353. Xin users' path (for example: /usr/local/bin). Then you need to copy
  1354. Xtransliteration tables to the directory which you have chosen in \fIpaths.h\fR.
  1355. XIf you get errors, then it is not OK. Please, report them to the author (with
  1356. Xall the gory details: error message, line number, machine, operating system,
  1357. Xetc.).
  1358. X.sp
  1359. XUnder VMS (VAXes) you need to compile it as:
  1360. X.br
  1361. X    cc translit
  1362. X.br
  1363. X    cc reg_exp
  1364. X.br
  1365. X    cc reg_sub
  1366. X.br
  1367. X    link translit+reg_exp+reg_sub,sys$library:vaxcrtl/lib
  1368. X.br
  1369. Xand before you can use the program, you need to type (or better put into your
  1370. XLOGIN.COM file) a line:
  1371. X.br
  1372. X    translit == "$SYS$USER:[ME.TRA]TRANSLIT.EXE"
  1373. X.br
  1374. Xor whatever is the full path to the \fItranslit\fR executable image which
  1375. Xyou created with LINK. Note the quotes and the $ sign in front of program
  1376. Xpath.
  1377. X.sp
  1378. XOn an IBM-PC I used MicroSoft C 5.1 as:
  1379. X.br
  1380. X.in +2m
  1381. X.ti -1m
  1382. Xcl /FeTRANSLIT /AL /FPc /W1 /F 5000 /Ox /Gs translit.c reg_exp.c reg_sub.c
  1383. X.in -2m
  1384. X.sp 2
  1385. X.SH RULES, CONDITIONS AND AUTHOR'S WHISHES
  1386. XYou can distribute this code and associated files under these conditions:
  1387. X.br
  1388. X.in +4m
  1389. X.ti -2m
  1390. X  1) You will distribute all files (even if you
  1391. Xthink that they are garbage). You may get the complete set from anonymous
  1392. Xftp at kekule.osc.edu in /pub/russian/translit. You can also get the program
  1393. Xand associated files via e-mail. To get the instructions for e-mail
  1394. Xdistribution send a line:
  1395. X.br
  1396. X       send translit/readme.doc from russian
  1397. X.br
  1398. Xto OSCPOST@osc.edu or OSCPOST@OHSTPY.BITNET.
  1399. XYou are not allowed to distribute the incomplete distribution. The following
  1400. Xfiles should be present in the distribution:
  1401. X.ta 2m 22n
  1402. X.nf
  1403. X    alt-gos.rus    - ALT to GOSTCII table
  1404. X    alt-koi8.rus    - ALT to KOI8 table
  1405. X    example.alt.uu    - uuencoded example in ALT
  1406. X    example.ko8.uu    - uuencoded example in KOI8
  1407. X    example.pho    - phonetic transliteration example
  1408. X    example.tex    - LaTeX example
  1409. X    gos-alt.rus    - GOSTCII to ALT table
  1410. X    gos-koi8.rus    - GOSTCII to KOI8 table
  1411. X    koi7-8.rus    - KOI7 to KOI8 table
  1412. X    koi7nl-8.rus    - KOI7 (no Latin) to KOI8 table
  1413. X    koi8-7.rus    - KOI8 to KOI7 table
  1414. X    koi8-alt.rus    - KOI8 to ALT table
  1415. X    koi8-gos.rus    - KOI8 to GOSTCII table
  1416. X    koi8-lc.rus    - KOI8 to Library of Congress table
  1417. X    koi8-phg.rus    - KOI8 to GOST transliteration
  1418. X    koi8-php.rus    - KOI8 to Pokrovsky transliteration
  1419. X    koi8-tex.rus    - KOI8 to LaTeX conversion
  1420. X    order.txt    - Order form for ordering the program
  1421. X    paths.h    - Include file for translit.c
  1422. X    phg-koi8.rus    - GOST transliteration to KOI8
  1423. X    pho-8sim.rus    - Simple phonetic to KOI8
  1424. X    pho-koi8.rus    - Various phonetic to KOI8
  1425. X    php-koi8.rus    - Pokrovsky to KOI8
  1426. X    readme.doc    - short description of the files
  1427. X    reg_exp.c    - regular expression code by Henry Spencer
  1428. X    reg_exp.h    - include for reg_exp.c and reg_sub.c
  1429. X    reg_sub.c    - regular expression code by H. Spencer
  1430. X    tex-koi8.rus    - LaTeX to KOI8
  1431. X    translit.c    - TRANSLIT main program
  1432. X    translit.ps    - TRANSLIT manual in PostScript
  1433. X    translit.1    - TRANSLIT manual in *roff
  1434. X    translit.txt    - Plain ASCII TRANSLIT manual
  1435. X.sp 1
  1436. X.fi
  1437. X.ti -2m
  1438. X  2) You may expand/change the files and the program and distribute modified
  1439. Xfiles, provided that you do
  1440. Xnot delete anything (you can always comment the unnecessary portions out)
  1441. Xand clearly mark your changes. Please send the copy of the modified
  1442. Xversion to the author, though you are not required to do so.
  1443. XI will give you all the credit for your enhancements. I simply wish that
  1444. Xthere is a single point of distribution for this code, so it is maintained
  1445. Xto some extent. If you create additional transliteration definition files,
  1446. Xplease, send them to the author if you may. I will add them to the program
  1447. Xdistribution. I want to fix bugs and expand/optimize this code,
  1448. Xbut I need your help.
  1449. XI need your transliteration files for languages which I do not know or
  1450. Xdo not use currently.
  1451. XYour suggestions for improving documentation are most welcome (I am not
  1452. Xa native English speaker).
  1453. X.ti -2m
  1454. X3) You will not charge money for the program and/or associated files,
  1455. Xexcept for media and copying costs. If you want to sell it, contact the author
  1456. Xfirst. Bear in mind
  1457. Xthat the regular expression package by Henry Spencer has some
  1458. Xcopyright restrictions.
  1459. XBut there are other regular expression packages which do not have these
  1460. Xrestrictions (which are not violated by this offering).
  1461. X.ti -2m
  1462. X4) I will gladly help you with advice on compiling this software and
  1463. Xtry to fix bugs when time allows. However, if you want a ready to run
  1464. Xexecutable, you need to order it for a very nominal fee from
  1465. X\fIJKL ENTERPRISES, INC.\fR as described in the file \fIorder.txt\fR
  1466. Xwhich must be a part of a complete distribution.
  1467. X.in -4m
  1468. X
  1469. X.SH AUTHOR
  1470. XJan Labanowski, P.O. Box 21821, Columbus, OH 43221-0821, USA.
  1471. XE-mail: jkl@osc.edu, JKL@OHSTPY.BITNET.
  1472. X
  1473. END_OF_FILE
  1474.   if test 56776 -ne `wc -c <'translit.1'`; then
  1475.     echo shar: \"'translit.1'\" unpacked with wrong size!
  1476.   fi
  1477.   # end of 'translit.1'
  1478. fi
  1479. echo shar: End of archive 1 \(of 10\).
  1480. cp /dev/null ark1isdone
  1481. MISSING=""
  1482. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1483.     if test ! -f ark${I}isdone ; then
  1484.     MISSING="${MISSING} ${I}"
  1485.     fi
  1486. done
  1487. if test "${MISSING}" = "" ; then
  1488.     echo You have unpacked all 10 archives.
  1489.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1490. else
  1491.     echo You still must unpack the following archives:
  1492.     echo "        " ${MISSING}
  1493. fi
  1494. exit 0
  1495. exit 0 # Just in case...
  1496.