From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 773] CVS update: julius4/adinrec Message-ID: <1344130014.213353.2553.nullmailer@users.sourceforge.jp> Index: julius4/adinrec/adinrec.c diff -u julius4/adinrec/adinrec.c:1.10 julius4/adinrec/adinrec.c:1.11 --- julius4/adinrec/adinrec.c:1.10 Fri Jul 27 17:44:48 2012 +++ julius4/adinrec/adinrec.c Sun Aug 5 10:26:53 2012 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Wed Mar 23 20:33:01 2005 * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * */ /* @@ -45,7 +45,7 @@ fprintf(stderr, "adinrec --- record one sentence input to a file\n"); fprintf(stderr, "Usage: adinrec [options..] filename\n"); fprintf(stderr, " [-input mic|pulseaudio|alsa|oss|esd|...] input source (mic)\n"); - fprintf(stderr, " [-freq frequency] sampling frequency in Hz (%ld)\n", jconf->am_root->analysis.para_default.smp_freq); + fprintf(stderr, " [-freq frequency] sampling frequency in Hz (%d)\n", jconf->am_root->analysis.para_default.smp_freq); fprintf(stderr, " [-48] 48000Hz recording with down sampling (16kHz only)\n"); fprintf(stderr, " [-lv unsignedshort] silence cut level threshold (%d)\n", jconf->detect.level_thres); fprintf(stderr, " [-zc zerocrossnum] silence cut zerocross num (%d)\n", jconf->detect.zero_cross_num); From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 774] CVS update: julius4/libsent/src/wav2mfcc Message-ID: <1344130014.635281.2607.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/wav2mfcc/para.c diff -u julius4/libsent/src/wav2mfcc/para.c:1.10 julius4/libsent/src/wav2mfcc/para.c:1.11 --- julius4/libsent/src/wav2mfcc/para.c:1.10 Fri Jul 27 17:44:57 2012 +++ julius4/libsent/src/wav2mfcc/para.c Sun Aug 5 10:26:54 2012 @@ -16,7 +16,7 @@ * @author Akinobu Lee * @date Fri Oct 27 14:55:00 2006 * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * */ /* @@ -369,8 +369,8 @@ if (para->absesup) fprintf(fp, ", abs energy supressed"); if (para->cmn) fprintf(fp, " with CMN"); fprintf(fp, ")\n"); - fprintf(fp, "\tsample frequency = %5ld Hz\n", para->smp_freq); - fprintf(fp, "\t sample period = %4ld (1 = 100ns)\n", para->smp_period); + fprintf(fp, "\tsample frequency = %5d Hz\n", para->smp_freq); + fprintf(fp, "\t sample period = %4d (1 = 100ns)\n", para->smp_period); fprintf(fp, "\t window size = %4d samples (%.1f ms)\n", para->framesize, (float)para->smp_period * (float)para->framesize / 10000.0); fprintf(fp, "\t frame shift = %4d samples (%.1f ms)\n", para->frameshift, From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 775] CVS update: julius4/libjulius/src Message-ID: <1344130014.435982.2581.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/m_usage.c diff -u julius4/libjulius/src/m_usage.c:1.17 julius4/libjulius/src/m_usage.c:1.18 --- julius4/libjulius/src/m_usage.c:1.17 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/m_usage.c Sun Aug 5 10:26:54 2012 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Fri May 13 15:04:34 2005 * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * */ /* @@ -167,8 +167,8 @@ fprintf(fp, "\n Acoustic analysis:\n"); fprintf(fp, " [-htkconf file] load parameters from the HTK Config file\n"); - fprintf(fp, " [-smpFreq freq] sample period (Hz) (%ld)\n", jconf->am_root->analysis.para_default.smp_freq); - fprintf(fp, " [-smpPeriod period] sample period (100ns) (%ld)\n", jconf->am_root->analysis.para_default.smp_period); + fprintf(fp, " [-smpFreq freq] sample period (Hz) (%d)\n", jconf->am_root->analysis.para_default.smp_freq); + fprintf(fp, " [-smpPeriod period] sample period (100ns) (%d)\n", jconf->am_root->analysis.para_default.smp_period); fprintf(fp, " [-fsize sample] window size (sample) (%d)\n", jconf->am_root->analysis.para_default.framesize); fprintf(fp, " [-fshift sample] frame shift (sample) (%d)\n", jconf->am_root->analysis.para_default.frameshift); fprintf(fp, " [-preemph] pre-emphasis coef. (%.2f)\n", jconf->am_root->analysis.para_default.preEmph); From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 776] CVS update: julius4/libsent/src/hmminfo Message-ID: <1344130014.570033.2599.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/hmminfo/read_binhmm.c diff -u julius4/libsent/src/hmminfo/read_binhmm.c:1.8 julius4/libsent/src/hmminfo/read_binhmm.c:1.9 --- julius4/libsent/src/hmminfo/read_binhmm.c:1.8 Fri Jul 27 17:44:50 2012 +++ julius4/libsent/src/hmminfo/read_binhmm.c Sun Aug 5 10:26:54 2012 @@ -22,7 +22,7 @@ * @author Akinobu LEE * @date Wed Feb 16 05:23:59 2005 * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * */ /* @@ -137,10 +137,22 @@ jlog("Stat: rd_para: found embedded acoutic parameter (ver.%d)\n", version); /* read parameters */ - rdn(fp, &(para->smp_period), sizeof(long), 1); - rdn(fp, &(para->smp_freq), sizeof(long), 1); + rdn(fp, &(para->smp_period), sizeof(int), 1); + rdn(fp, &(para->smp_freq), sizeof(int), 1); rdn(fp, &(para->framesize), sizeof(int), 1); rdn(fp, &(para->frameshift), sizeof(int), 1); + /* tweak to read 64bit binhmm with older version (smp_period, smp_freq = 8byte) */ + if (para->smp_period == 0 && para->framesize == 0 && + para->smp_freq != 0 && para->frameshift != 0) { + jlog("Warning: rd_para: smp_period=%d, smp_freq=%d, framesize=%d, frameshift=%d\n", para->smp_period, para->smp_freq, para->framesize, para->frameshift); + jlog("Warning: rd_para: wrong values, may be reading binhmm created at 64bit?\n"); + jlog("Warning: rd_para: try to re-parse values from 64bit to 32bit...\n"); + para->smp_period = para->smp_freq; + para->smp_freq = para->frameshift; + rdn(fp, &(para->framesize), sizeof(int), 1); + rdn(fp, &(para->frameshift), sizeof(int), 1); + jlog("Warning: rd_para: smp_period=%d, smp_freq=%d, framesize=%d, frameshift=%d\n", para->smp_period, para->smp_freq, para->framesize, para->frameshift); + } rdn(fp, &(para->preEmph), sizeof(float), 1); rdn(fp, &(para->lifter), sizeof(int), 1); rdn(fp, &(para->fbank_num), sizeof(int), 1); Index: julius4/libsent/src/hmminfo/write_binhmm.c diff -u julius4/libsent/src/hmminfo/write_binhmm.c:1.6 julius4/libsent/src/hmminfo/write_binhmm.c:1.7 --- julius4/libsent/src/hmminfo/write_binhmm.c:1.6 Fri Jul 27 17:44:50 2012 +++ julius4/libsent/src/hmminfo/write_binhmm.c Sun Aug 5 10:26:54 2012 @@ -22,7 +22,7 @@ * @author Akinobu LEE * @date Wed Feb 16 06:03:36 2005 * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * */ /* @@ -31,7 +31,7 @@ * All rights reserved */ -/* $Id: write_binhmm.c,v 1.6 2012/07/27 08:44:50 sumomo Exp $ */ +/* $Id: write_binhmm.c,v 1.7 2012/08/05 01:26:54 sumomo Exp $ */ #include #include @@ -146,8 +146,8 @@ version = VALUE_VERSION; wrt(fp, &version, sizeof(short), 1); - wrt(fp, &(para->smp_period), sizeof(long), 1); - wrt(fp, &(para->smp_freq), sizeof(long), 1); + wrt(fp, &(para->smp_period), sizeof(int), 1); + wrt(fp, &(para->smp_freq), sizeof(int), 1); wrt(fp, &(para->framesize), sizeof(int), 1); wrt(fp, &(para->frameshift), sizeof(int), 1); wrt(fp, &(para->preEmph), sizeof(float), 1); From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 777] CVS update: julius4/mkss Message-ID: <1344130014.699204.2615.nullmailer@users.sourceforge.jp> Index: julius4/mkss/mkss.c diff -u julius4/mkss/mkss.c:1.6 julius4/mkss/mkss.c:1.7 --- julius4/mkss/mkss.c:1.6 Fri Jul 27 17:44:57 2012 +++ julius4/mkss/mkss.c Sun Aug 5 10:26:54 2012 @@ -8,7 +8,7 @@ /* * mkss --- compute average spectrum of mic input for SS in Julius * - * $Id: mkss.c,v 1.6 2012/07/27 08:44:57 sumomo Exp $ + * $Id: mkss.c,v 1.7 2012/08/05 01:26:54 sumomo Exp $ * */ @@ -32,7 +32,7 @@ { fprintf(stderr, "mkss --- compute averate spectrum of mic input for SS\n"); fprintf(stderr, "Usage: mkss [options..] filename\n"); - fprintf(stderr, " [-freq frequency] sampling freq in Hz (%ld)\n", jconf->am_root->analysis.para_default.smp_freq); + fprintf(stderr, " [-freq frequency] sampling freq in Hz (%d)\n", jconf->am_root->analysis.para_default.smp_freq); fprintf(stderr, " [-len msec] record length in msec (%d)\n", slen); fprintf(stderr, " [-fsize samplenum] window size (%d)\n", jconf->am_root->analysis.para_default.framesize); fprintf(stderr, " [-fshift samplenum] frame shift (%d)\n", jconf->am_root->analysis.para_default.frameshift); From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 778] CVS update: julius4/adintool Message-ID: <1344130014.280304.2563.nullmailer@users.sourceforge.jp> Index: julius4/adintool/adintool.c diff -u julius4/adintool/adintool.c:1.15 julius4/adintool/adintool.c:1.16 --- julius4/adintool/adintool.c:1.15 Fri Jul 27 17:44:48 2012 +++ julius4/adintool/adintool.c Sun Aug 5 10:26:54 2012 @@ -35,7 +35,7 @@ * @author Akinobu LEE * @date Wed Mar 23 20:43:32 2005 * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * */ /* @@ -125,7 +125,7 @@ fprintf(stderr, " [-segment] force segmentation of input speech\n"); fprintf(stderr, " [-cutsilence] (same as \"-segment\")\n"); fprintf(stderr, " [-oneshot] record only the first segment\n"); - fprintf(stderr, " [-freq frequency] sampling frequency in Hz (%ld)\n", jconf->am_root->analysis.para_default.smp_freq); + fprintf(stderr, " [-freq frequency] sampling frequency in Hz (%d)\n", jconf->am_root->analysis.para_default.smp_freq); fprintf(stderr, " [-48] 48000Hz recording with down sampling (16kHz only)\n"); fprintf(stderr, " [-lv unsignedshort] silence cut level threshold (%d)\n", jconf->detect.level_thres); fprintf(stderr, " [-zc zerocrossnum] silence cut zerocross num (%d)\n", jconf->detect.zero_cross_num); From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 779] CVS update: julius4/libsent/include/sent Message-ID: <1344130014.500399.2589.nullmailer@users.sourceforge.jp> Index: julius4/libsent/include/sent/mfcc.h diff -u julius4/libsent/include/sent/mfcc.h:1.5 julius4/libsent/include/sent/mfcc.h:1.6 --- julius4/libsent/include/sent/mfcc.h:1.5 Fri Sep 18 17:31:08 2009 +++ julius4/libsent/include/sent/mfcc.h Sun Aug 5 10:26:54 2012 @@ -27,7 +27,7 @@ * @author Akinobu LEE * @date Fri Feb 11 03:40:52 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ @@ -74,8 +74,8 @@ /// mfcc configuration parameter values typedef struct { - long smp_period; ///< Sampling period in 100ns units - long smp_freq; ///< Sampling frequency + int smp_period; ///< Sampling period in 100ns units + int smp_freq; ///< Sampling frequency int framesize; ///< Window size in samples, similar to WINDOWSIZE in HTK (unit is different) int frameshift; ///< Frame shift length in samples float preEmph; ///< Pre-emphasis coefficient, corresponds to PREEMCOEF in HTK From sumomo @ users.sourceforge.jp Sun Aug 5 10:26:54 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sun, 05 Aug 2012 10:26:54 +0900 Subject: [Julius-cvs 780] CVS update: julius4/libjulius/include/julius Message-ID: <1344130014.371407.2571.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/include/julius/jconf.h diff -u julius4/libjulius/include/julius/jconf.h:1.13 julius4/libjulius/include/julius/jconf.h:1.14 --- julius4/libjulius/include/julius/jconf.h:1.13 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/include/julius/jconf.h Sun Aug 5 10:26:54 2012 @@ -23,7 +23,7 @@ * @author Akinobu Lee * @date Fri Feb 16 13:42:28 2007 * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * */ /* @@ -835,12 +835,12 @@ * Sampling frequency * */ - long sfreq; + int sfreq; /** * Sampling period in 100ns units * */ - long period; + int period; /** * Window size in samples, similar to WINDOWSIZE in HTK (unit is different) * From sumomo @ users.sourceforge.jp Sat Aug 11 19:44:02 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Sat, 11 Aug 2012 19:44:02 +0900 Subject: [Julius-cvs 781] CVS update: julius4/mkbingram Message-ID: <1344681842.762345.31640.nullmailer@users.sourceforge.jp> Index: julius4/mkbingram/Makefile.in diff -u julius4/mkbingram/Makefile.in:1.7 julius4/mkbingram/Makefile.in:1.8 --- julius4/mkbingram/Makefile.in:1.7 Fri Jul 27 17:44:57 2012 +++ julius4/mkbingram/Makefile.in Sat Aug 11 19:44:02 2012 @@ -3,7 +3,7 @@ # Copyright (c) 2005-2012 Julius project team, Nagoya Institute of Technology # All rights reserved # -# $Id: Makefile.in,v 1.7 2012/07/27 08:44:57 sumomo Exp $ +# $Id: Makefile.in,v 1.8 2012/08/11 10:44:02 sumomo Exp $ # SHELL=/bin/sh .SUFFIXES: @@ -21,7 +21,7 @@ exec_prefix=@exec_prefix@ INSTALL=@INSTALL@ -OBJ=mkbingram.o +OBJ=mkbingram.o charconv.o TARGET=mkbingram @ EXEEXT@ all: $(TARGET) Index: julius4/mkbingram/charconv.c diff -u /dev/null julius4/mkbingram/charconv.c:1.1 --- /dev/null Sat Aug 11 19:44:02 2012 +++ julius4/mkbingram/charconv.c Sat Aug 11 19:44:02 2012 @@ -0,0 +1,224 @@ +/* + * Copyright (c) 1991-2012 Kawahara Lab., Kyoto University + * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology + * Copyright (c) 2005-2012 Julius project team, Nagoya Institute of Technology + * All rights reserved + */ + +#include +#include + +#define strmatch !strcmp + +#if defined(_WIN32) + +/* winnls */ +#include +#include +#define UNICODE_BUFFER_SIZE 4096 ///< Buffer length for unicode conversion +static unsigned int from_cp; ///< Source codepage +static unsigned int to_cp; ///< Target codepage +static wchar_t unibuf[UNICODE_BUFFER_SIZE]; ///< buffer for unicode conversion + +#else + +/* iconv */ +#include +#include +#include +static iconv_t cd = (iconv_t)-1; ///< Converstion descriptor + +#endif + +static int convert_enabled = 0; ///< 1 if charset converstion is enabled + + +#if defined(_WIN32) + +static int +str2code(char *codestr, unsigned int *code) +{ + if (strmatch(codestr, "euc-jp") + || strmatch(codestr, "euc") + || strmatch(codestr, "eucjp")) { + /* input = Shift_jis (codepage 932) */ + *code = CODE_JPN_EUC; + } else if (strmatch(codestr, "ansi")) { + /* ANSI codepage (MBCS) ex. shift-jis in Windows XP Japanese edition.*/ + *code = CP_ACP; + } else if (strmatch(codestr, "mac")) { + /* Macintosh codepage */ + *code = CP_MACCP; + } else if (strmatch(codestr, "oem")) { + /* OEM localized default codepage */ + *code = CP_OEMCP; + } else if (strmatch(codestr, "utf-7")) { + /* UTF-7 codepage */ + *code = CP_UTF7; + } else if (strmatch(codestr, "utf-8")) { + /* UTF-8 codepage */ + *code = CP_UTF8; + } else if (strmatch(codestr, "sjis") + || strmatch(codestr, "sjis-win") + || strmatch(codestr, "shift-jis") + || strmatch(codestr, "shift_jis")) { + /* sjis codepage = 932 */ + *code = 932; + } else if (codestr[0] >= '0' && codestr[0] <= '9') { + /* codepage number */ + *code = atoi(codestr); + if (! IsValidCodePage(*code)) { + jlog("Error: charconv_win32: codepage \"%d\" not found\n", codestr); + return -1; + } + } else { + fprintf(stderr, "Error: str2code: unknown source codepage \"%s\"\n", codestr); + fprintf(stderr, "Error: str2code: valids are \"euc-jp\", \"ansi\", \"mac\", \"oem\", \"utf-7\", \"utf-8\", \"sjis\" and codepage number\n"); + return -1; + } + + return 0; +} +#endif + + +/** + * Setup charset conversion. + * + * @param fromcode [in] input charset name (only libjcode accepts NULL) + * @param tocode [in] output charset name, or NULL when disable conversion + * + * @return 0 on success, -1 on failure. + */ +int +charconv_setup(char *fromcode, char *tocode) +{ + convert_enabled = 0; + + if (fromcode == NULL || tocode == NULL) { + fprintf(stderr, "Error: charconv_setup: input code or output code not specified\n"); + return -1; + } + +#if defined(_WIN32) + if (str2code(fromcode, &from_cp) == -1) { + fpritnf(stderr, "Error: charconv_setup: unknown codepage specified\n"); + return -1; + } + if (str2code(tocode, &to_cp) == -1) { + fpritnf(stderr, "Error: charconv_setup: unknown codepage specified\n"); + return -1; + } +#else + /* clear already allocated descriptor */ + if (cd != (iconv_t)-1) { + if (iconv_close(cd) < 0) { + fprintf(stderr, "Error: charconv_setup: failed to close iconv\n"); + return -1; + } + cd = (iconv_t)-1; + } + /* allocate conversion descriptor */ + cd = iconv_open(tocode, fromcode); + if (cd == (iconv_t)-1) { + /* allocation failed */ + fprintf(stderr, "Error: charconv_setup: unknown charset name in \"%s\" or \"%s\"\n", fromcode, tocode); + fprintf(stderr, "Error: charconv_setup: do \"iconv --list\" to get the list of available charset names.\n"); + return -1; + } + +#endif + + convert_enabled = 1; + + return(0); +} + +/** + * Apply charset conversion to a string. + * + * @param instr [in] source string + * @param outstr [in] destination buffer + * @param maxoutlen [in] allocated length of outstr in byte. + * + * @return either of instr or outstr, that holds the result string. + * + */ +char * +charconv(char *instr, char *outstr, int maxoutlen) +{ + +#if defined(_WIN32) + + int unilen, newlen; + char *srcbuf; + + /* if diabled return instr itself */ + if (convert_enabled == 0) return(instr); /* no conversion */ + + srcbuf = instr; + + /* get length of unicode string */ + unilen = MultiByteToWideChar(from_cp, 0, srcbuf, -1, NULL, 0); + if (unilen <= 0) { + jlog("Error: charconv: conversion error?\n"); + return(instr); + } + if (unilen > UNICODE_BUFFER_SIZE) { + jlog("Error: charconv: unicode buffer size exceeded (%d > %d)!\n", unilen, UNICODE_BUFFER_SIZE); + return(instr); + } + /* convert source string to unicode */ + MultiByteToWideChar(from_cp, 0, srcbuf, -1, unibuf, unilen); + /* get length of target string */ + newlen = WideCharToMultiByte(to_cp, 0, unibuf, -1, outstr, 0, NULL, NULL); + if (newlen <= 0) { + jlog("Error: charconv: conversion error?\n"); + return(instr); + } + if (newlen > maxoutlen) { + jlog("Error: charconv: target buffer size exceeded (%d > %d)!\n", newlen, maxoutlen); + return(instr); + } + /* convert unicode to target string */ + WideCharToMultiByte(to_cp, 0, unibuf, -1, outstr, newlen, NULL, NULL); + return(outstr); + +#else + + char *src, *dst; + size_t srclen, dstlen; + size_t ret; + + /* if diabled return instr itself */ + if (convert_enabled == 0) return(instr); /* no conversion */ + + if (cd == (iconv_t)-1) { + fprintf(stderr, "Error: charconv: conversion descriptor not allocated\n"); + return(instr); + } + + srclen = strlen(instr)+1; + dstlen = maxoutlen; + src = instr; + dst = outstr; + ret = iconv(cd, &src, &srclen, &dst, &dstlen); + if (ret == -1) { + switch(errno) { + case EILSEQ: + fprintf(stderr, "Error: charconv: invalid multibyte sequence in the input\n"); exit(-1); + break; + case EINVAL: + fprintf(stderr, "Error: charconv: incomplete multibyte sequence in the input\n"); exit(-1); + break; + case E2BIG: + fprintf(stderr, "Error: charconv: converted string size exceeded buffer (>%d)\n", maxoutlen); exit(-1); + break; + } + } + + return(outstr); + +#endif + +} Index: julius4/mkbingram/charconv.h diff -u /dev/null julius4/mkbingram/charconv.h:1.1 --- /dev/null Sat Aug 11 19:44:02 2012 +++ julius4/mkbingram/charconv.h Sat Aug 11 19:44:02 2012 @@ -0,0 +1,7 @@ +#ifndef __CHARCONV_H__ +#define __CHARCONV_H__ + +int charconv_setup(char *fromcode, char *tocode); +char *charconv(char *instr, char *outstr, int maxoutlen); + +#endif /* __CHARCONV_H__ */ Index: julius4/mkbingram/mkbingram.c diff -u julius4/mkbingram/mkbingram.c:1.5 julius4/mkbingram/mkbingram.c:1.6 --- julius4/mkbingram/mkbingram.c:1.5 Fri Jul 27 17:44:57 2012 +++ julius4/mkbingram/mkbingram.c Sat Aug 11 19:44:02 2012 @@ -18,7 +18,7 @@ * @author Akinobu LEE * @date Thu Mar 24 12:22:27 2005 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * */ /* @@ -30,13 +30,15 @@ /* mkbingram --- make binary n-gram for JULIUS from ARPA standard format */ -/* $Id: mkbingram.c,v 1.5 2012/07/27 08:44:57 sumomo Exp $ */ +/* $Id: mkbingram.c,v 1.6 2012/08/11 10:44:02 sumomo Exp $ */ #include #include #include #include +#include "charconv.h" + static NGRAM_INFO *ngram; void @@ -48,6 +50,7 @@ printf(" -nlr file forward N-gram in ARPA format\n"); printf(" -nrl file backward N-gram in ARPA format\n"); printf(" -d bingramfile Julius binary N-gram file input\n"); + printf(" -c from to convert character code\n"); printf(" -swap swap \"%s\" and \"%s\"\n", BEGIN_WORD_DEFAULT, END_WORD_DEFAULT); printf("\n When both \"-nlr\" and \"-nrl\" are specified, \n"); printf(" Julius will use the BACKWARD N-gram as main LM\n"); @@ -66,9 +69,13 @@ time_t now; char *binfile, *lrfile, *rlfile, *outfile; int i; + char *from_code, *to_code, *buf; + boolean charconv_enabled = FALSE; boolean force_swap = FALSE; + WORD_ID w; binfile = lrfile = rlfile = outfile = NULL; + from_code = to_code = NULL; if (argc <= 1) { usage(argv[0]); return -1; @@ -106,6 +113,21 @@ usage(argv[0]); return -1; } + } else if (argv[i][1] == 'c') { + if (++i >= argc) { + printf("Error: no argument for option \"%s\"\n", argv[i]); + usage(argv[0]); + return -1; + } + from_code = strcpy((char*)mymalloc(strlen(argv[i])+1), argv[i]); + if (++i >= argc) { + printf("Error: no argument for option \"%s\"\n", argv[i]); + usage(argv[0]); + free(from_code); + return -1; + } + to_code = strcpy((char*)mymalloc(strlen(argv[i])+1),argv[i]); + charconv_enabled = TRUE; } else if (argv[i][1] == 's') { force_swap = TRUE; } @@ -184,6 +206,21 @@ } print_ngram_info(stdout, ngram); + + if (charconv_enabled == TRUE) { + /* do character conversion */ + if (charconv_setup(from_code, to_code) == -1) { + fprintf(stderr, "failed to setup character convertsion\n"); + return -1; + } + buf = (char *)mymalloc(4096); + for (w = 0; w < ngram->max_word_num; w++) { + charconv(ngram->wname[w], buf, 4096); + ngram->wname[w] = mybmalloc2(strlen(buf)+1, &(ngram->mroot)); + strcpy(ngram->wname[w], buf); + } + free(buf); + } /* write in JULIUS binary format */ if ((fp = fopen_writefile(outfile)) == NULL) { From sumomo @ users.sourceforge.jp Wed Aug 15 15:50:28 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Wed, 15 Aug 2012 15:50:28 +0900 Subject: [Julius-cvs 782] CVS update: julius4/libjulius/src Message-ID: <1345013428.229400.14480.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/src/adin-cut.c diff -u julius4/libjulius/src/adin-cut.c:1.18 julius4/libjulius/src/adin-cut.c:1.19 --- julius4/libjulius/src/adin-cut.c:1.18 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/src/adin-cut.c Wed Aug 15 15:50:27 2012 @@ -95,7 +95,7 @@ * @author Akinobu LEE * @date Sat Feb 12 13:20:53 2005 * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * */ /* @@ -348,6 +348,9 @@ /*************/ for (;;) { + /* check end of input by end of stream */ + if (a->end_of_stream && a->bp == 0) break; + /****************************/ /* read in new speech input */ /****************************/ @@ -874,8 +877,6 @@ /* purge processed samples and update queue */ adin_purge(a, i); - /* end of input by end of stream */ - if (a->end_of_stream && a->bp == 0) break; } break_input: From skawasaki @ a-and-m-ion.com Mon Aug 27 11:13:38 2012 From: skawasaki @ a-and-m-ion.com (kawasaki) Date: Mon, 27 Aug 2012 11:13:38 +0900 Subject: [Julius-cvs 783] =?iso-2022-jp?b?GyRCJE8kOCRhJEZFajlGJDckXiQ5ISMbKEI=?= Message-ID: <10B16F54DAEA4B349EC52D5AC5E19A78@your6aaa1329c2> はじめて投稿させていただきます。 河崎といいます。 juliusをwindows、Linuxへインストールしようとしていますが、よく手順がわからなくて 詳しく記載してあるページ(何をダウンロードすればOKなのか等)教えていただきたいです。 よろしくお願いします。 -------------- next part -------------- HTMLの添付ファイルを保管しました... URL: http://lists.sourceforge.jp/mailman/archives/julius-cvs/attachments/20120827/5555b50e/attachment.htm From sumomo @ users.sourceforge.jp Fri Aug 31 14:17:29 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Fri, 31 Aug 2012 14:17:29 +0900 Subject: [Julius-cvs 784] CVS update: julius4/libsent/src/ngram Message-ID: <1346390249.307158.22096.nullmailer@users.sourceforge.jp> Index: julius4/libsent/src/ngram/ngram_malloc.c diff -u julius4/libsent/src/ngram/ngram_malloc.c:1.7 julius4/libsent/src/ngram/ngram_malloc.c:1.8 --- julius4/libsent/src/ngram/ngram_malloc.c:1.7 Fri Jul 27 17:44:57 2012 +++ julius4/libsent/src/ngram/ngram_malloc.c Fri Aug 31 14:17:28 2012 @@ -12,7 +12,7 @@ * @author Akinobu LEE * @date Wed Feb 16 16:48:56 2005 * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * */ /* @@ -37,6 +37,7 @@ new = (NGRAM_INFO *)mymalloc(sizeof(NGRAM_INFO)); new->n = 0; + new->wname = NULL; new->d = NULL; new->bo_wt_1 = NULL; new->p_2 = NULL; @@ -71,17 +72,22 @@ ngram_info_free(NGRAM_INFO *ndata) { int i; + WORD_ID w; + /* bin test only */ /* free word names */ if (ndata->from_bin) { - free(ndata->wname[0]); - free(ndata->wname); + if (ndata->wname) { + if (ndata->wname[0]) free(ndata->wname[0]); + free(ndata->wname); + } } else { - WORD_ID w; - for(w=0;wmax_word_num;w++) { - free(ndata->wname[w]); + if (ndata->wname) { + for(w=0;wmax_word_num;w++) { + if (ndata->wname[w]) free(ndata->wname[w]); + } + free(ndata->wname); } - free(ndata->wname); } /* free 2-gram for the 1st pass */ if (ndata->bo_wt_1) free(ndata->bo_wt_1); Index: julius4/libsent/src/ngram/ngram_read_arpa.c diff -u julius4/libsent/src/ngram/ngram_read_arpa.c:1.19 julius4/libsent/src/ngram/ngram_read_arpa.c:1.20 --- julius4/libsent/src/ngram/ngram_read_arpa.c:1.19 Fri Jul 27 17:44:57 2012 +++ julius4/libsent/src/ngram/ngram_read_arpa.c Fri Aug 31 14:17:28 2012 @@ -20,7 +20,7 @@ * @author Akinobu LEE * @date Wed Feb 16 16:52:24 2005 * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * */ /* @@ -30,7 +30,7 @@ * All rights reserved */ -/* $Id: ngram_read_arpa.c,v 1.19 2012/07/27 08:44:57 sumomo Exp $ */ +/* $Id: ngram_read_arpa.c,v 1.20 2012/08/31 05:17:28 sumomo Exp $ */ /* words should be alphabetically sorted */ @@ -113,6 +113,9 @@ /* malloc name area */ ndata->wname = (char **)mymalloc(sizeof(char *) * ndata->max_word_num); + for (nid = 0; nid < ndata->max_word_num; nid++) { + ndata->wname[nid] = NULL; + } /* malloc data area */ //t->bgn_upper = t->bgn_lower = t->bgn = t->num = NULL; Index: julius4/libsent/src/ngram/ngram_read_bin.c diff -u julius4/libsent/src/ngram/ngram_read_bin.c:1.10 julius4/libsent/src/ngram/ngram_read_bin.c:1.11 --- julius4/libsent/src/ngram/ngram_read_bin.c:1.10 Fri Jul 27 17:44:57 2012 +++ julius4/libsent/src/ngram/ngram_read_bin.c Fri Aug 31 14:17:28 2012 @@ -48,7 +48,7 @@ * @author Akinobu LEE * @date Wed Feb 16 17:12:08 2005 * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * */ /* @@ -267,6 +267,7 @@ rdn(fp, w, 1, len); /* assign... */ ndata->wname = (char **)mymalloc(sizeof(char *) * ndata->max_word_num); + ndata->wname[0] = NULL; p = w; i = 0; while (p < w + len) { ndata->wname[i++] = p; From sumomo @ users.sourceforge.jp Fri Aug 31 14:25:48 2012 From: sumomo @ users.sourceforge.jp (sumomo @ users.sourceforge.jp) Date: Fri, 31 Aug 2012 14:25:48 +0900 Subject: [Julius-cvs 785] CVS update: julius4/libjulius/include/julius Message-ID: <1346390748.485162.5516.nullmailer@users.sourceforge.jp> Index: julius4/libjulius/include/julius/plugin.h diff -u julius4/libjulius/include/julius/plugin.h:1.3 julius4/libjulius/include/julius/plugin.h:1.4 --- julius4/libjulius/include/julius/plugin.h:1.3 Fri Jul 27 17:44:49 2012 +++ julius4/libjulius/include/julius/plugin.h Fri Aug 31 14:25:48 2012 @@ -12,7 +12,7 @@ * @author Akinobu Lee * @date Sat Aug 2 13:04:15 2008 * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * */ /* @@ -47,6 +47,7 @@ "fvin_get_configuration", "fvin_standby", \ "fvin_open", "fvin_read", "fvin_close", \ "fvin_resume", "fvin_pause", "fvin_terminate", \ + "fvin_input_name",\ "fvin_postprocess", \ "calcmix_get_optname", "calcmix", "calcmix_init", "calcmix_free", \ "result_best_str", \