2 ** This module uses code from the NIST implementation of FIPS-181,
3 ** but the algorythm is CHANGED and I think that I CAN
4 ** copyright it. See copiright notes below.
8 ** Copyright (c) 1999, 2000, 2001, 2002, 2003
9 ** Adel I. Mirzazhanov. All rights reserved
11 ** Redistribution and use in source and binary forms, with or without
12 ** modification, are permitted provided that the following conditions
15 ** 1.Redistributions of source code must retain the above copyright notice,
16 ** this list of conditions and the following disclaimer.
17 ** 2.Redistributions in binary form must reproduce the above copyright
18 ** notice, this list of conditions and the following disclaimer in the
19 ** documentation and/or other materials provided with the distribution.
20 ** 3.The name of the author may not be used to endorse or promote products
21 ** derived from this software without specific prior written permission.
23 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
24 ** OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
27 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 ** GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 #ifndef APG_PRONPASS_H
38 #define APG_PRONPASS_H 1
40 #ifndef APG_OWN_TYPES_H
42 #endif /* APG_OWN_TYPES_H */
46 //#endif /* APG_RND_H */
48 #define RULE_SIZE (sizeof(rules)/sizeof(struct unit))
49 #define ALLOWED(flag) (digram[units_in_syllable[current_unit -1]][unit] & (flag))
51 #define MAX_UNACCEPTABLE 20
52 #define MAX_RETRIES (4 * (int) pwlen + RULE_SIZE)
54 #define NOT_BEGIN_SYLLABLE 010
55 #define NO_FINAL_SPLIT 04
57 #define ALTERNATE_VOWEL 01
58 #define NO_SPECIAL_RULE 0
61 #define NOT_BEGIN 0100
64 #define ILLEGAL_PAIR 010
68 #define ANY_COMBINATION 0
74 extern int gen_pron_pass (char *word, char *hyphenated_word, USHORT minlen,
75 USHORT maxlen, unsigned int pass_mode);
77 USHORT random_unit (USHORT type);
78 USHORT get_random (USHORT minlen, USHORT maxlen);
79 boolean have_initial_y (USHORT *units, USHORT unit_size);
80 boolean illegal_placement (USHORT *units, USHORT pwlen);
81 boolean improper_word (USHORT *units, USHORT word_size);
82 boolean have_final_split (USHORT *units, USHORT unit_size);
83 int gen_word (char *word, char *hyphenated_word, USHORT pwlen,
84 unsigned int pass_mode);
85 char *gen_syllable(char *syllable, USHORT pwlen, USHORT *units_in_syllable,
86 USHORT *syllable_length);
92 #endif /* APG_PRONPASS_H */