~logan/ubuntu/quantal/julius/new-upstream

« back to all changes in this revision

Viewing changes to libsent/src/voca/voca_load_htkdict.c

  • Committer: Bazaar Package Importer
  • Author(s): Siegfried-Angel Gevatter Pujals
  • Date: 2009-06-18 13:08:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090618130841-d9elgw6tnu0ls5uh
Tags: 4.1.2-0ubuntu1
NOTE: If you have been using Julius before with "-input mic" and
with this update you notice a considerable accuracy drop in the
recognitions, try using "oss", "alsa" or "esd" instead of "mic".

* New upstream version. For a list of changes see Release.txt.
   - Fixes segfault when an empty .jconf file is used (LP: #298495).
   - Drop patches/fix-julius-manpage.patch, not necessary anymore.
   - Install accept_check and nextword, they work now.
* debian/patches/fix-japanese-manpages-install-dir.patch
   - Install Japanses manpages into usr/share/man/ja/man1 instead of
     usr/share/man/man1/ja.
* debian/doc/:
   - Disable all manpages in favour of upstreams, except for
     dfa_minimize, which has better examples, and julius-generate,
     which upstream doesn't ship.
* debian/rules:
   - Remove manpages for commands we don't ship and rename and adapt
     manpages for commands we renamed.
* debian/watch:
   - Fix it.
* debian/rules:
   - Do not install file ChangeLog, as it isn't up-to-date.
* debian/control:
   - Bump Standards-Version to 3.8.2.
* debian/copyright:
   - Specify that the packaging is GPLv2+.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * @author Akinobu LEE
20
20
 * @date   Fri Feb 18 19:43:06 2005
21
21
 *
22
 
 * $Revision: 1.3 $
 
22
 * $Revision: 1.7 $
23
23
 * 
24
24
 */
25
25
/*
143
143
  buf = (char *)mymalloc(strlen(name) + 1);
144
144
  strcpy(buf, name);
145
145
  if (winfo->errph_root == NULL) {
146
 
    winfo->errph_root = aptree_make_root_node(buf);
 
146
    winfo->errph_root = aptree_make_root_node(buf, &(winfo->mroot));
147
147
  } else {
148
148
    match = aptree_search_data(buf, winfo->errph_root);
149
149
    if (match == NULL || !strmatch(match, buf)) {
150
 
      aptree_add_entry(buf, buf, match, &(winfo->errph_root));
 
150
      aptree_add_entry(buf, buf, match, &(winfo->errph_root), &(winfo->mroot));
151
151
    }
152
152
  }
153
153
}
292
292
 
293
293
 
294
294
/** 
295
 
 * Top function to read word dictionary via file pointer
 
295
 * Top function to read word dictionary via file pointer (gzip enabled)
296
296
 * 
297
297
 * @param fp [in] file pointer
298
298
 * @param winfo [out] pointer to word dictionary to store the read data.
317
317
 
318
318
 
319
319
/** 
320
 
 * Top function to read word dictionary via file descriptor.
321
 
 * 
322
 
 * @param fd [in] file descriptor
323
 
 * @param winfo [out] pointer to word dictionary to store the read data.
324
 
 * @param hmminfo [in] HTK %HMM definition data.  if NULL, phonemes are ignored.
325
 
 * @param ignore_tri_conv [in] TRUE if triphone conversion is ignored
326
 
 * 
327
 
 * @return TRUE on success, FALSE on any error word.
328
 
 */
329
 
boolean
330
 
voca_load_htkdict_fd(int fd, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo, boolean ignore_tri_conv)
331
 
{
332
 
  boolean ret;
333
 
 
334
 
  voca_load_start(winfo, hmminfo, ignore_tri_conv);
335
 
  while(getl_fd(buf, MAXLINELEN, fd) != NULL) {
336
 
    if (voca_load_line(buf, winfo, hmminfo) == FALSE) break;
337
 
  }
338
 
  ret = voca_load_end(winfo);
339
 
 
340
 
  return(ret);
341
 
}
342
 
 
343
 
/** 
344
 
 * Top function to read word dictionary via socket descriptor.
345
 
 * 
346
 
 * @param sd [in] socket descriptor
347
 
 * @param winfo [out] pointer to word dictionary to store the read data.
348
 
 * @param hmminfo [in] HTK %HMM definition data.  if NULL, phonemes are ignored.
349
 
 * @param ignore_tri_conv [in] TRUE if triphone conversion is ignored
350
 
 * 
351
 
 * @return TRUE on success, FALSE on any error word.
352
 
 */
353
 
boolean
354
 
voca_load_htkdict_sd(int sd, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo, boolean ignore_tri_conv)
355
 
{
356
 
  boolean ret;
357
 
 
358
 
  voca_load_start(winfo, hmminfo, ignore_tri_conv);
359
 
  while(getl_sd(buf, MAXLINELEN, sd) != NULL) {
 
320
 * Top function to read word dictionary via normal file pointer.
 
321
 * 
 
322
 * @param fp [in] file pointer
 
323
 * @param winfo [out] pointer to word dictionary to store the read data.
 
324
 * @param hmminfo [in] HTK %HMM definition data.  if NULL, phonemes are ignored.
 
325
 * @param ignore_tri_conv [in] TRUE if triphone conversion is ignored
 
326
 * 
 
327
 * @return TRUE on success, FALSE on any error word.
 
328
 */
 
329
boolean
 
330
voca_load_htkdict_fp(FILE *fp, WORD_INFO *winfo, HTK_HMM_INFO *hmminfo, boolean ignore_tri_conv)
 
331
{
 
332
  boolean ret;
 
333
 
 
334
  voca_load_start(winfo, hmminfo, ignore_tri_conv);
 
335
  while(getl_fp(buf, MAXLINELEN, fp) != NULL) {
360
336
    if (voca_load_line(buf, winfo, hmminfo) == FALSE) break;
361
337
  }
362
338
  ret = voca_load_end(winfo);
669
645
  int i;
670
646
 
671
647
  n = woffset;
 
648
  while (n >= dstinfo->maxnum) {
 
649
    if (winfo_expand(dstinfo) == FALSE) return FALSE;
 
650
  }
672
651
  for(w=0;w<srcinfo->num;w++) {
673
652
    /* copy data */
674
653
    dstinfo->wlen[n] = srcinfo->wlen[w];
686
665
    if (n >= dstinfo->maxnum) {
687
666
      if (winfo_expand(dstinfo) == FALSE) return FALSE;
688
667
    }
 
668
 
689
669
  }
690
670
  dstinfo->num = n;
691
671