sumom****@users*****
sumom****@users*****
2009年 2月 10日 (火) 02:27:46 JST
Index: julius4/libsent/include/sent/ngram2.h diff -u julius4/libsent/include/sent/ngram2.h:1.4 julius4/libsent/include/sent/ngram2.h:1.5 --- julius4/libsent/include/sent/ngram2.h:1.4 Sat Jan 31 18:11:21 2009 +++ julius4/libsent/include/sent/ngram2.h Tue Feb 10 02:27:46 2009 @@ -97,7 +97,7 @@ * @author Akinobu LEE * @date Fri Feb 11 15:04:02 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -124,6 +124,14 @@ #define NNID_INVALID_UPPER 255 ///< Value to indicate no id at NNID_UPPER (24bit) #define NNID_MAX_24 16711679 ///< Allowed maximum number of id (255*65536-1) (24bit) +/// Default word string of beginning-of-sentence word +#define BEGIN_WORD_DEFAULT "<s>" +/// Default word string of end-of-sentence word +#define END_WORD_DEFAULT "</s>" +/// Default word string of unknown word for open vocabulary +#define UNK_WORD_DEFAULT "<unk>" +#define UNK_WORD_DEFAULT2 "<UNK>" + /** * N-gram entries for a m-gram (1 <= m <= N) * @@ -161,6 +169,7 @@ int dir; ///< direction (either DIR_LR or DIR_RL) boolean from_bin; ///< TRUE if source was bingram, otherwise ARPA boolean bigram_index_reversed; ///< TRUE if read from old (<=3.5.3) bingram, in which case the 2-gram tuple index is reversed (DIR_LR) against the RL 3-gram. + boolean bos_eos_swap; ///< TRUE if swap BOS and SOS on backward N-gram WORD_ID max_word_num; ///< N-gram vocabulary size char **wname; ///< List of word strings. PATNODE *root; ///< Root of index tree to search n-gram word ID from its name @@ -235,7 +244,7 @@ void print_ngram_info(FILE *fp, NGRAM_INFO *ndata); #include <sent/vocabulary.h> -void make_voca_ref(NGRAM_INFO *ndata, WORD_INFO *winfo); +boolean make_voca_ref(NGRAM_INFO *ndata, WORD_INFO *winfo); void fix_uniprob_srilm(NGRAM_INFO *ndata, WORD_INFO *winfo); #endif /* __SENT_NGRAM2_H__ */ Index: julius4/libsent/include/sent/ptree.h diff -u julius4/libsent/include/sent/ptree.h:1.3 julius4/libsent/include/sent/ptree.h:1.4 --- julius4/libsent/include/sent/ptree.h:1.3 Tue Sep 30 12:58:18 2008 +++ julius4/libsent/include/sent/ptree.h Tue Feb 10 02:27:46 2009 @@ -17,7 +17,7 @@ * @author Akinobu LEE * @date Fri Feb 11 17:27:24 2005 * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * */ /* @@ -70,6 +70,7 @@ PATNODE *make_ptree(char **words, int *data, int wordsnum, int bitplace); void disp_ptree(PATNODE *node, int level); int ptree_search_data(char *str, PATNODE *rootnode); +int ptree_replace_data(char *str, int val, PATNODE *node); PATNODE *ptree_make_root_node(int data); void ptree_add_entry(char *str, int data, char *matchstr, PATNODE **rootnode); void free_ptree(PATNODE *rootnode); Index: julius4/libsent/include/sent/vocabulary.h diff -u julius4/libsent/include/sent/vocabulary.h:1.4 julius4/libsent/include/sent/vocabulary.h:1.5 --- julius4/libsent/include/sent/vocabulary.h:1.4 Fri Oct 17 08:43:25 2008 +++ julius4/libsent/include/sent/vocabulary.h Tue Feb 10 02:27:46 2009 @@ -30,7 +30,7 @@ * @author Akinobu LEE * @date Sat Feb 12 12:38:13 2005 * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * */ /* @@ -46,11 +46,6 @@ #include <sent/stddefs.h> #include <sent/htk_hmm.h> -/// Default word string of beginning-of-sentence word -#define BEGIN_WORD_DEFAULT "<s>" -/// Default word string of end-of-sentence word -#define END_WORD_DEFAULT "</s>" - /// Memory allocation step in number of words when loading a word dictionary #define MAXWSTEP 4000