1
/* ----------------------------------------------------------------- */
2
/* The Japanese TTS System "Open JTalk" */
3
/* developed by HTS Working Group */
4
/* http://open-jtalk.sourceforge.net/ */
5
/* ----------------------------------------------------------------- */
7
/* Copyright (c) 2008-2011 Nagoya Institute of Technology */
8
/* Department of Computer Science */
10
/* All rights reserved. */
12
/* Redistribution and use in source and binary forms, with or */
13
/* without modification, are permitted provided that the following */
14
/* conditions are met: */
16
/* - Redistributions of source code must retain the above copyright */
17
/* notice, this list of conditions and the following disclaimer. */
18
/* - Redistributions in binary form must reproduce the above */
19
/* copyright notice, this list of conditions and the following */
20
/* disclaimer in the documentation and/or other materials provided */
21
/* with the distribution. */
22
/* - Neither the name of the HTS working group nor the names of its */
23
/* contributors may be used to endorse or promote products derived */
24
/* from this software without specific prior written permission. */
26
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
27
/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
28
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
29
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
30
/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */
31
/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
32
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
33
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
34
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
35
/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */
36
/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */
37
/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
38
/* POSSIBILITY OF SUCH DAMAGE. */
39
/* ----------------------------------------------------------------- */
45
#define NJD_H_START extern "C" {
50
#endif /* __CPLUSPLUS */
56
typedef struct _NJDNode {
62
char *ctype; /* conjugation type */
63
char *cform; /* conjugation form */
64
char *orig; /* genkei */
65
char *read; /* yomi */
66
char *pron; /* hatsuon */
71
struct _NJDNode *prev;
72
struct _NJDNode *next;
75
void NJDNode_initialize(NJDNode * node);
76
void NJDNode_set_string(NJDNode * node, char *str);
77
void NJDNode_set_pos(NJDNode * node, char *str);
78
void NJDNode_set_pos_group1(NJDNode * node, char *str);
79
void NJDNode_set_pos_group2(NJDNode * node, char *str);
80
void NJDNode_set_pos_group3(NJDNode * node, char *str);
81
void NJDNode_set_ctype(NJDNode * node, char *str);
82
void NJDNode_set_cform(NJDNode * node, char *str);
83
void NJDNode_set_orig(NJDNode * node, char *str);
84
void NJDNode_set_read(NJDNode * node, char *str);
85
void NJDNode_set_pron(NJDNode * node, char *str);
86
void NJDNode_set_acc(NJDNode * node, int acc);
87
void NJDNode_set_mora_size(NJDNode * node, int size);
88
void NJDNode_set_chain_rule(NJDNode * node, char *str);
89
void NJDNode_set_chain_flag(NJDNode * node, int flag);
90
void NJDNode_add_read(NJDNode * node, char *str);
91
void NJDNode_add_pron(NJDNode * node, char *str);
92
void NJDNode_add_acc(NJDNode * node, int acc);
93
void NJDNode_add_mora_size(NJDNode * node, int size);
94
char *NJDNode_get_string(NJDNode * node);
95
char *NJDNode_get_pos(NJDNode * node);
96
char *NJDNode_get_pos_group1(NJDNode * node);
97
char *NJDNode_get_pos_group2(NJDNode * node);
98
char *NJDNode_get_pos_group3(NJDNode * node);
99
char *NJDNode_get_ctype(NJDNode * node);
100
char *NJDNode_get_cform(NJDNode * node);
101
char *NJDNode_get_orig(NJDNode * node);
102
char *NJDNode_get_read(NJDNode * node);
103
char *NJDNode_get_pron(NJDNode * node);
104
int NJDNode_get_acc(NJDNode * node);
105
int NJDNode_get_mora_size(NJDNode * node);
106
char *NJDNode_get_chain_rule(NJDNode * node);
107
int NJDNode_get_chain_flag(NJDNode * node);
108
void NJDNode_load(NJDNode * node, char *str);
109
NJDNode *NJDNode_insert(NJDNode * prev, NJDNode * next, NJDNode * node);
110
void NJDNode_copy(NJDNode * node1, NJDNode * node2);
111
void NJDNode_print(NJDNode * node);
112
void NJDNode_fprint(NJDNode * node, FILE * fp);
113
void NJDNode_sprint(NJDNode * node, char *buff, const char *split_code);
114
void NJDNode_clear(NJDNode * node);
118
typedef struct _NJD {
123
void NJD_initialize(NJD * njd);
124
void NJD_load(NJD * njd, char *str);
125
void NJD_load_from_fp(NJD * njd, FILE * fp);
126
int NJD_get_size(NJD * njd);
127
void NJD_push_node(NJD * njd, NJDNode * node);
128
void NJD_insert_node(NJD * njd, NJDNode * prev, NJDNode * next, NJDNode * node);
129
NJDNode *NJD_remove_node(NJD * njd, NJDNode * node);
130
void NJD_remove_silent_node(NJD * njd);
131
void NJD_print(NJD * njd);
132
void NJD_fprint(NJD * njd, FILE * fp);
133
void NJD_sprint(NJD * njd, char *buff, const char *split_code);
134
void NJD_refresh(NJD * njd);
135
void NJD_clear(NJD * wl);