]>
Commit | Line | Data |
---|---|---|
feb0369e | 1 | #!/bin/sh |
2 | # A shell script for conversion of MOVA MuellerXX.koi dictionaries | |
3 | # into DICT format. | |
4 | # Written by Andrew Comech <comech@math.sunysb.edu> | |
5 | # GNU GPL (2000) | |
6 | # The latest version is available from | |
7 | # http://www.math.sunysb.edu/~comech/tools/to-dict | |
8 | ||
9 | version="0.1" | |
10 | versiondate="November 11, 2000" | |
11 | ||
12 | # We need the following binaries: | |
13 | DICTFMT=`which dictfmt` | |
14 | DICTZIP=`which dictzip` | |
15 | ||
16 | INFO () { | |
17 | echo " | |
18 | to-dict, version $version ($versiondate). | |
19 | Conversion of MOVA MuellerXX.koi dictionaries into DICT format. | |
20 | Written by Andrew Comech <comech@math.sunysb.edu>. GNU GPL (2000) | |
21 | ||
22 | The latest version is available from | |
23 | http://www.math.sunysb.edu/~comech/tools/to-dict | |
24 | " | |
25 | } | |
26 | ||
27 | REQUIREMENTS () { | |
28 | echo " | |
29 | REQUIREMENTS: you need the binaries \`dictfmt' and \`dictzip'. | |
30 | ||
31 | dictzip.c can be found in dictd-1.5.0.tar.gz (or later version) at | |
32 | ftp://ftp.cs.unc.edu/pub/users/faith/dict/ | |
33 | ||
34 | dictfmt.c can be found in Debian/GNU Linux package dict-elements at | |
35 | ftp://ftp.debian.org/debian/dists/potato/main/source/text/ | |
36 | ||
37 | Compiled binaries (dictfmt and dictzip) could be downloaded from | |
38 | http://www.wh9.tu-dresden.de/~heinrich/dict/dict_leo_ftp/static-binaries/ | |
39 | or | |
40 | http://iris.ltas.ulg.ac.be/download/apps/dict/ | |
41 | " | |
42 | } | |
43 | ||
44 | USAGE () { | |
45 | echo " | |
46 | USAGE: | |
47 | -version: show version | |
48 | -h, --help, or no parameters: show this help | |
49 | ||
50 | (*) To make DICT database from Mueller7GPL.koi available from | |
51 | http://www.chat.ru/~mueller_dic/Mueller7GPL.tgz | |
52 | ||
53 | # Remove transcription: | |
54 | ./to-dict --no-trans Mueller7GPL.koi mueller7.notr | |
55 | # Convert <source> into <data> (a file with %h, %d-headers): | |
56 | ./to-dict --src-data mueller7.notr mueller7.data && rm -i mueller7.notr | |
57 | # Convert <data> into DICT-format (files <name>.dict.dz and <name>.index): | |
58 | ./to-dict --data-dict mueller7.data mueller7 && rm -i mueller7.data | |
59 | # Expand index file (to be able to access lines like \"A, a\" by \"A\" and \"a\"): | |
60 | ./to-dict --expand-index mueller7.index mueller7.index.exp | |
61 | # Install a new dictionary with expanded index (RUN AS ROOT). | |
62 | # The location of files may depend on your distribution!!! | |
63 | cp mueller7.dict.dz /usr/share/dictd/mueller7.dict.dz | |
64 | cp mueller7.index.exp /usr/share/dictd/mueller7.index | |
65 | dictdconfig -w && (killall dictd; dictd) | |
66 | ||
67 | (*) To make DICT database from Mueller24.koi available from | |
68 | http://www.chat.ru/~mueller_dic/Mueller24.tgz (this one is preferred) | |
69 | ||
70 | # Convert <source> into <data> (a file with %h, %d): | |
71 | ./to-dict --src-data Mueller24.koi mueller24.data | |
72 | # Convert <data> into DICT-format (files <name>.dict.dz and <name>.index): | |
73 | ./to-dict --data-dict mueller24.data mueller24 && rm -i mueller24.data | |
74 | # Install a new dictionary with expanded index (RUN AS ROOT). | |
75 | # The location of files may depend on your distribution!!! | |
76 | cp mueller24.dict.dz /usr/share/dictd/mueller24.dict.dz | |
77 | cp mueller24.index /usr/share/dictd/mueller24.index | |
78 | dictdconfig -w && (killall dictd; dictd) | |
79 | ||
80 | (*) To re-convert <dict> into <data> (a file with %h, %d-headers): | |
81 | ||
82 | ./to-dict --dict-data <dict> <data> | |
83 | ||
84 | ************************************************************* | |
85 | !!WARNING!! !!WARNING!! !!WARNING!! !!WARNING!! | |
86 | ||
87 | Temporary files created by this script occupy a lot of drive space! | |
88 | 15 MB for Mueller7GPL.koi (have to strip off transcription first) | |
89 | 12 MB for Mueller24.koi | |
90 | ************************************************************* | |
91 | " | |
92 | } | |
93 | ||
94 | # To remove the transcription except for [r] and [ju:] which found in the text. | |
95 | # This procedure should not change Mueller24.koi if applied to it. | |
96 | NO_TRANS () { | |
97 |