1 /***************************************************************************
2 * Copyright 1991, 1992, 1993, 1994, 1995, 1996, 2001, 2002 *
3 * David R. Hill, Leonard Manzara, Craig Schock *
4 * *
5 * This program is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
18 // 2014-09
19 // This file was copied from Gnuspeech and modified by Marcelo Y. Matuda.
20
21 #include "en/letter_to_sound/ie_to_y.h"
22
23
24
25 namespace GS {
26 namespace En {
27
28 /******************************************************************************
29 *
30 * function: ie_to_y
31 *
32 * purpose: If final two characters are "ie" replace with "y" and
33 * return true.
34 *
35 * arguments: in, end
36 *
37 * internal
38 * functions: none
39 *
40 * library
41 * functions: none
42 *
43 ******************************************************************************/
44 int
ie_to_y(char *,char ** end)45 ie_to_y(char * /* in */, char **end)
46 {
47 register char *t = *end;
48
49 if ((*(t - 2) == 'i') && (*(t - 1) == 'e')) {
50 *(t - 2) = 'y';
51 *(t - 1) = '#';
52 *end = --t;
53 return(1);
54 }
55 return(0);
56 }
57
58 } /* namespace En */
59 } /* namespace GS */
60