4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
40 #pragma ident "%Z%%M% %I% %E% SMI"
45 #define HY_BIT 0200 /* stuff in here only works for ascii */
56 #define THRESH 160 /*digram goodness threshold*/
67 while (punct(cbits(*i
++)))
69 if (!alph(cbits(*--i
)))
72 while (alph(cbits(*i
++)))
74 hyend
= wdend
= --i
- 1;
75 while (punct(cbits(*i
++)))
79 if ((wdend
- wdstart
- 4) < 0)
84 if (!exword() && !suffix())
90 for (hyp
= hyptr
+ 1; *hyp
!= 0; hyp
++) {
91 if (*(hyp
- 1) > *hyp
) {
117 if (i
>= 'a' && i
<= 'z' || i
>= 'A' && i
<= 'Z')
147 if ((j
= nexth
) >= (hbuf
+ NHEX
- 2))
150 if (ismot(t
= getch()))
153 if (i
== ' ' || i
== '\n') {
166 *j
++ = maplow(i
) | k
;
168 if (j
>= (hbuf
+ NHEX
- 2))
174 errprint(gettext("exception word list full."));
194 while (*e
&& w
<= hyend
&& (*e
& 0177) == maplow(cbits(*w
))) {
199 if (w
-1 == hyend
|| (w
== wdend
&& maplow(cbits(*w
)) == 's')) {
201 for (e
= save
; *e
; e
++) {
204 if (hyp
> (hyptr
+ NHYP
- 1))
205 hyp
= hyptr
+ NHYP
- 1;
228 extern char *suftab
[];
229 extern tchar
*chkvow();
232 if (!alph(cbits(i
= cbits(*hyend
))))
236 if ((s0
= suftab
[i
-'a']) == 0)
239 if ((i
= *s0
& 017) == 0)
243 while (s
> s0
&& w
>= wdstart
&& (*s
& 0177) == maplow(cbits(*w
))) {
279 if (ischar(i
) && isupper(i
))
306 while (--w
>= wdstart
)
307 if (vowel(cbits(*w
)))
318 tchar
* nhyend
, *maxw
;
320 extern char bxh
[26][13], bxxh
[26][13], xxh
[26][13], xhx
[26][13], hxx
[26][13];
323 if (!(w
= chkvow(hyend
+ 1)))
326 if (!(w
= chkvow(hyend
)))
331 while ((++w
< hyend
) && (w
< (wdend
- 1))) {
334 val
*= dilook('a', cbits(*w
), bxh
);
335 else if (w
== wdstart
+ 1)
336 val
*= dilook(cbits(*(w
-1)), cbits(*w
), bxxh
);
338 val
*= dilook(cbits(*(w
-1)), cbits(*w
), xxh
);
339 val
*= dilook(cbits(*w
), cbits(*(w
+1)), xhx
);
340 val
*= dilook(cbits(*(w
+1)), cbits(*(w
+2)), hxx
);
360 i
= t
[maplow(a
)-'a'][(j
= maplow(b
)-'a')/2];