This file was deleted.

@@ -0,0 +1,23 @@

myincludedir = $(pkgincludedir)/include

FLITEHEADERS = cst_alloc.h \
cst_cart.h cst_cg.h cst_endian.h \
cst_error.h cst_features.h cst_ffeatures.h \
cst_file.h cst_item.h \
cst_lexicon.h cst_lts.h \
cst_phoneset.h cst_regex.h \
cst_relation.h cst_string.h cst_synth.h \
cst_tokenstream.h cst_track.h \
cst_utt_utils.h cst_utterance.h \
cst_val.h cst_val_const.h cst_val_defs.h \
cst_voice.h cst_wave.h \
flite.h HTS_misc.h pstreamchol.h
HTSENGINEHEADERS = HTS_engine.h

BELLBIRDHEADERS = bell_audio.h bell_driver.h \
bell_file.h bell_ff_sym.h bell_relation_sym.h

myinclude_HEADERS = $(FLITEHEADERS) \
$(HTSENGINEHEADERS) \
$(BELLBIRDHEADERS)
@@ -0,0 +1,18 @@
#ifndef _BELL_AUDIO_H__
#define _BELL_AUDIO_H__

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "cst_wave.h"

bell_boolean play_wave(cst_wave *w);

#ifdef CST_AUDIO_ALSA
int audio_scheduler();
int buffer_wave(cst_wave *w, int fd);
void audio_scheduler_close(int fd);
#endif

#endif
@@ -0,0 +1,18 @@
#ifndef __BELL_HTS_ENGINE_H__
#define __BELL_HTS_ENGINE_H__

#include "HTS_engine.h"
#include "cst_voice.h"
#include "cst_tokenstream.h"

#define CLUSTERGENMODE 0
#define HTSMODE 1

float bell_file_to_speech(HTS_Engine * engine, const char *filename, cst_voice *voice, const char *outtype, const int voice_type);

float bell_hts_ts_to_speech(HTS_Engine * engine, cst_tokenstream *ts, cst_voice *voice, const char *outtype);

cst_voice * bell_voice_load(char *fn_name, const int voice_type, HTS_Engine * engine);
void bell_voice_unload(cst_voice *voice, const int voice_type, HTS_Engine * engine);

#endif
@@ -0,0 +1,97 @@
#ifndef _BELL_FF_SYM_H_
#define _BELL_FF_SYM_H_

// These are compact forms of featfunc symbols
// Using these definitions improves performance of internal_ff
// The values themselves are irrelevant it is only required they are unique
// and a single byte
// The value \x00 is unavailable as it is the string terminator

#define PH_VC "\x01"
#define PH_VLNG "\x02"
#define PH_VHEIGHT "\x03"
#define PH_VFRONT "\x04"
#define PH_VRND "\x05"
#define PH_CTYPE "\x06"
#define PH_CPLACE "\x07"
#define PH_CVOX "\x08"

#define LISP_CG_DURATION "\x10"
#define LISP_CG_STATE_POS "\x11"
#define LISP_CG_STATE_PLACE "\x12"
#define LISP_CG_STATE_INDEX "\x13"
#define LISP_CG_STATE_RINDEX "\x14"
#define LISP_CG_PHONE_PLACE "\x15"
#define LISP_CG_PHONE_INDEX "\x16"
#define LISP_CG_PHONE_RINDEX "\x17"

#define LISP_CG_POSITION_IN_PHRASEP "\x20"
#define LISP_CG_FIND_PHRASE_NUMBER "\x21"
#define LISP_IS_PAU "\x22"

#define WORD_NUMSYLS "\x30"
#define WORD_BREAK "\x31"
#define WORD_PUNC "\x32"
#define SSYL_IN "\x33"
#define SSYL_OUT "\x34"
#define SYL_IN "\x35"
#define SYL_OUT "\x36"
#define SYL_BREAK "\x37"
#define LISP_CG_BREAK "\x38"
#define OLD_SYL_BREAK "\x39"
#define SYL_ONSETSIZE "\x3a"
#define SYL_CODASIZE "\x3b"
#define ACCENTED "\x3c"
#define ASYL_IN "\x3d"
#define ASYL_OUT "\x3e"
#define LISP_CODA_FRIC "\x3f"
#define LISP_ONSET_FRIC "\x40"
#define LISP_CODA_STOP "\x41"
#define LISP_ONSET_STOP "\x42"
#define LISP_CODA_NASAL "\x43"
#define LISP_ONSET_NASAL "\x44"
#define LISP_CODA_GLIDE "\x45"
#define LISP_ONSET_GLIDE "\x46"
#define SEG_ONSETCODA "\x47"
#define POS_IN_SYL "\x48"
#define POSITION_TYPE "\x49"
#define SUB_PHRASES "\x4a"
#define LAST_ACCENT "\x4b"
#define NEXT_ACCENT "\x4c"
#define SYL_FINAL "\x4d"
#define SEGMENT_DURATION "\x4e"
#define LISP_CG_SYL_RATIO "\x4f"
#define LISP_CG_PHRASE_RATIO "\x50"
#define LISP_CG_SYLS_IN_PHRASE "\x51"
#define POS_IN_PHRASE "\x52"
#define POS_IN_WORD "\x53"
#define SYLLABLE_DURATION "\x54"
#define SYL_VOWEL "\x55"
#define SYL_NUMPHONES "\x56"

// en_US HTS symbols
#define LISP_DISTANCE_TO_P_STRESS "\x60"
#define LISP_DISTANCE_TO_N_STRESS "\x61"
#define LISP_DISTANCE_TO_P_ACCENT "\x62"
#define LISP_DISTANCE_TO_N_ACCENT "\x63"
#define WORDS_OUT "\x64"
#define HTS_CONTENT_WORDS_IN "\x65"
#define HTS_CONTENT_WORDS_OUT "\x66"
#define LISP_DISTANCE_TO_P_CONTENT "\x67"
#define LISP_DISTANCE_TO_N_CONTENT "\x68"
#define LISP_NUM_SYLS_IN_PHRASE "\x69"
#define LISP_NUM_WORDS_IN_PHRASE "\x6a"
#define LISP_TOTAL_SYLS "\x6b"
#define LISP_TOTAL_WORDS "\x6c"
#define LISP_TOTAL_PHRASES "\x6d"

// en_US symbols
#define GPOS "\x70"
#define NUM_DIGITS "\x71"
#define MONTH_RANGE "\x72"
#define TOKEN_POS_GUESS "\x73"
#define CONTENT_WORDS_IN "\x74"
#define CONTENT_WORDS_OUT "\x75"
#define LISP_CG_CONTENT_WORDS_IN_PHRASE "\x76"

#endif
@@ -0,0 +1,14 @@
#ifndef __BELL_FILE_H__
#define __BELL_FILE_H__

cst_file bell_fopen(const char * filename, const char * mode);
int bell_fgetc(cst_file fh);
size_t bell_fwrite(const void *buf, size_t size, size_t count, cst_file fh);
size_t bell_fread(void *buf, size_t size, size_t count, cst_file fh);
off_t bell_ftello(cst_file fh);
int bell_fseeko(cst_file fh, off_t offset, int whence);
int bell_fclose(cst_file fh);
int bell_fprintf(cst_file fh, const char *fmt, ...);
int bell_snprintf(char *buf, size_t n, const char *fmt, ...);

#endif
@@ -0,0 +1,20 @@
#ifndef __BELL_RELATION_SYM_H_
#define __BELL_RELATION_SYM_H_

// These are compact forms of utt_relation_create symbols
// Using these definitions improves performance of internal_ff
// The values themselves are irrelevant it is only required they are unique

#define TOKEN "\x01"
#define PHRASE "\x02"
#define SYLLABLE "\x03"
#define SYLSTRUCTURE "\x04"
#define SEGMENT "\x05"
#define WORD "\x06"

#define HMMSTATE "\x10"
#define SEGSTATE "\x11"
#define MCEP_LINK "\x12"
#define MCEP "\x13"

#endif
@@ -0,0 +1,68 @@
/* include/config.h.in. Generated from configure.ac by autoheader. */

/* Use ALSA sound driver */
#undef CST_AUDIO_ALSA

/* Don't use a sound driver */
#undef CST_AUDIO_NONE

/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H

/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H

/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H

/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H

/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR

/* Name of package */
#undef PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#undef PACKAGE_NAME

/* Define to the full name and version of this package. */
#undef PACKAGE_STRING

/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME

/* Define to the home page for this package. */
#undef PACKAGE_URL

/* Define to the version of this package. */
#undef PACKAGE_VERSION

/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

/* Version number of package */
#undef VERSION
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -33,50 +39,35 @@
/* Author: Alan W Black (awb@cs.cmu.edu) */
/* Date: July 1999 */
/*************************************************************************/
/* */
/* Basic wraparounds for malloc and free */
/* */
/*************************************************************************/


/* Basic allocators and matrix allocators */

#ifndef __CST_ALLOC_H__
#define __CST_ALLOC_H__

#include <stdio.h>

#ifndef TRUE
#define TRUE (1==1)
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE (1==0)
#define FALSE 0
#endif

typedef int bell_boolean;

/* Global allocation (the only kind on Unix) */
void *cst_safe_alloc(int size);
void *cst_safe_calloc(int size);
void *cst_safe_realloc(void *p,int size);

/* Allocate on local heap (needed on WinCE for various reasons) */
#ifdef UNDER_CE
#include <windows.h>
typedef HANDLE cst_alloc_context;

cst_alloc_context new_alloc_context(int size);
void delete_alloc_context(cst_alloc_context ctx);

void *cst_local_alloc(cst_alloc_context ctx, int size);
void cst_local_free(cst_alloc_context ctx, void *p);
#else /* not UNDER_CE */
typedef void * cst_alloc_context;
#define new_alloc_context(size) (NULL)
#define delete_alloc_context(ctx)
#define cst_local_alloc(ctx,size) cst_safe_alloc(size)
#define cst_local_free(cst,p) cst_free(p)
#endif /* UNDER_CE */

/* The public interface to the alloc functions */

/* Note the underlying call is calloc, so everything is zero'd */
#define cst_alloc(TYPE,SIZE) ((TYPE *)cst_safe_alloc(sizeof(TYPE)*(SIZE)))
#define cst_calloc(TYPE,SIZE) ((TYPE *)cst_safe_calloc(sizeof(TYPE)*(SIZE)))
#define cst_realloc(P,TYPE,SIZE) ((TYPE *)cst_safe_realloc((void *)(P),sizeof(TYPE)*(SIZE)))

void cst_free(void *p);

/* double matrix allocation and deallocation */
double **bell_alloc_dmatrix(size_t row, size_t col);
void bell_free_dmatrix(double **p);

#endif

This file was deleted.

This file was deleted.

@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,20 +46,12 @@
#ifndef _CST_CART_H__
#define _CST_CART_H__

#include "cst_file.h"
#include "cst_val.h"
#include "cst_features.h"
#include "cst_item.h"
#include "cst_relation.h"

#define CST_CART_OP_NONE 255
#define CST_CART_OP_LEAF 255
#define CST_CART_OP_IS 0
#define CST_CART_OP_IN 1
#define CST_CART_OP_LESS 2
#define CST_CART_OP_GREATER 3
#define CST_CART_OP_MATCHES 4
#define CST_CART_OP_EQUALS 5

typedef struct cst_cart_node_struct {
unsigned char feat;
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -48,9 +54,14 @@

#include "cst_cart.h"
#include "cst_track.h"
#include "cst_voice.h"
#include "cst_wave.h"
#include "cst_audio.h"
#include "cst_synth.h" /* for dur_stat */

typedef struct cst_dur_stats_struct {
char *phone;
float mean;
float stddev;
} dur_stat;

typedef struct cst_cg_db_struct {
/* Please do not change this structure, but if you do only add things
@@ -88,7 +99,7 @@ typedef struct cst_cg_db_struct {

float frame_advance;

/* duration models (cart + phonedurs) */
/* duration model (cart + phonedurs) */
int num_dur_models;
const dur_stat *** dur_stats;
const cst_cart ** dur_cart;
@@ -97,14 +108,12 @@ typedef struct cst_cg_db_struct {
const char * const * const *phone_states;

/* Other parameters */
int do_mlpg; /* implies deltas are in the model_vectors */
float *dynwin;
int dynwinsize;

float mlsa_alpha;
float mlsa_beta;

int multimodel;
int mixed_excitation;

/* filters for Mixed Excitation */
@@ -115,26 +124,20 @@ typedef struct cst_cg_db_struct {
int spamf0;
float gain;

int freeable; /* doesn't get dumped, but 1 when this a freeable struct */

} cst_cg_db;

/* Access model parameters, unpacking them as required */
#define CG_MODEL_VECTOR(M,N,X,Y) \
(M->model_min[Y]+((float)(M->N[X][Y])/65535.0*M->model_range[Y]))

CST_VAL_USER_TYPE_DCLS(cg_db,cst_cg_db)
void delete_cg_db(cst_cg_db *db);

cst_utterance *cg_synth(cst_utterance *utt);
cst_wave *mlsa_resynthesis(const cst_track *t,
const cst_track *str,
cst_cg_db *cg_db,
cst_audio_streaming_info *asc);
cst_track *mlpg(const cst_track *param_track, cst_cg_db *cg_db);
cst_cg_db *cg_db);

cst_voice *cst_cg_load_voice(const char *voxdir,
const cst_lang lang_table[]);
int cst_cg_dump_voice(const cst_voice *v,const cst_string *filename);

cst_track *cg_mlpg(const cst_track *param_track, cst_cg_db *cg_db);

#endif

This file was deleted.

This file was deleted.

@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,33 +46,17 @@
#ifndef __CST_ENDIAN_H__
#define __CST_ENDIAN_H__

/* This gets set to 1 and we test where the on bit is to determine byteorder */
extern const int cst_endian_loc;
/* Sun, HP, SGI Mips, M68000, PowerPC */
#define CST_BIG_ENDIAN (((char *)&cst_endian_loc)[0] == 0)
/* Intel, Alpha, DEC Mips, Vax, ARM, Other MIPS (Casio, Ben Nanonote etc) */
#define CST_LITTLE_ENDIAN (((char *)&cst_endian_loc)[0] != 0)
/* Perq (from Three Rivers) has a third byte order -- but we have no support */

/* EST byte order strings */
#define BYTE_ORDER_BIG "10"
#define BYTE_ORDER_LITTLE "01"
#include<stdint.h>
/* Big endian support is signalled in this code by defining WORDS_BIGENDIAN */
/* If this is not set then little endian support is assumed */

#define SWAPINT(x) ((((unsigned int)x) & 0xff) << 24 | \
(((unsigned int)x) & 0xff00) << 8 | \
(((unsigned int)x) & 0xff0000) >> 8 | \
(((unsigned int)x) & 0xff000000) >> 24)
/* For m68k we want to be a little more explicit */
#define SWAPLONG(x) ((((unsigned long)x) & 0xff) << 24 | \
(((unsigned long)x) & 0xff00) << 8 | \
(((unsigned long)x) & 0xff0000) >> 8 | \
(((unsigned long)x) & 0xff000000) >> 24)
#define SWAPSHORT(x) ((((unsigned short)x) & 0xff) << 8 | \
(((unsigned short)x) & 0xff00) >> 8)

void swap_bytes_short(short * b,int n);

void swapdouble(double *d);
void swapfloat(float *f);
void swap_bytes_int16(int16_t * b,int n);

#endif
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -42,37 +48,10 @@

#include <stdlib.h>

#ifdef DIE_ON_ERROR
# ifdef UNDER_CE
# define cst_error() *(int *)0=0
# else
# define cst_error() abort()
# endif
#elif __palmos__
#ifdef __ARM_ARCH_4T__

typedef long *jmp_buf[10]; /* V1-V8, SP, LR (see po_setjmp.c) */
extern jmp_buf *cst_errjmp;
extern char cst_error_msg[];
int setjmp(register jmp_buf env);
void longjmp(register jmp_buf env, register int value);

# define cst_error() (cst_errjmp ? longjmp(*cst_errjmp,1) : 0)
#else /* m68K */
/* I've never tested this or even compiled it (Flite is ARM compiled) */
# define cst_error() ErrFatalDisplayIf(-1, "cst_error")
#endif
#else /* not palmos */
#include <setjmp.h>
extern jmp_buf *cst_errjmp;
# define cst_error() (cst_errjmp ? longjmp(*cst_errjmp,1) : exit(-1))
#endif
# define cst_error() exit(1)

/* WinCE sometimes doesn't have stdio, so this is a wrapper for
fprintf(stderr, ...) */
int cst_errmsg(const char *fmt, ...);
#define cst_dbgmsg cst_errmsg

/* Need macros to help set catches */

#endif
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -52,16 +58,11 @@ typedef struct cst_featvalpair_struct {

typedef struct cst_features_struct {
struct cst_featvalpair_struct *head;
cst_alloc_context ctx;
cst_val *owned_strings; /* fnames that are owned by this struct */

/* Link to other cst_features that we search too */
const struct cst_features_struct *linked;
} cst_features;

/* Constructor functions */
cst_features *new_features(void);
cst_features *new_features_local(cst_alloc_context ctx);
void delete_features(cst_features *f);

/* Accessor functions */
@@ -94,9 +95,9 @@ const char *feat_own_string(cst_features *f,const char *name);
CST_VAL_USER_TYPE_DCLS(features,cst_features)

int feat_copy_into(const cst_features *from,cst_features *to);
/* Link FROM into TO so FROM's features will be searched after TO's features */
int feat_link_into(const cst_features *from,cst_features *to);
/* For debugging */
int cst_feat_print(cst_file fd,const cst_features *f);

#if defined(CART_DEBUG) || defined(SSML_DEBUG)
int bell_feat_print(const cst_features *f);
#endif // defined(CART_DEBUG) || defined(SSML_DEBUG)

#endif
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -42,24 +48,6 @@
#include "cst_val.h"
#include "cst_item.h"

const cst_val *ph_vc(const cst_item *p);
const cst_val *ph_vlng(const cst_item *p);
const cst_val *ph_vheight(const cst_item *p);
const cst_val *ph_vrnd(const cst_item *p);
const cst_val *ph_vfront(const cst_item *p);
const cst_val *ph_ctype(const cst_item *p);
const cst_val *ph_cplace(const cst_item *p);
const cst_val *ph_cvox(const cst_item *p);

const cst_val *cg_duration(const cst_item *p);
const cst_val *cg_state_pos(const cst_item *p);
const cst_val *cg_state_place(const cst_item *p);
const cst_val *cg_state_index(const cst_item *p);
const cst_val *cg_state_rindex(const cst_item *p);
const cst_val *cg_phone_place(const cst_item *p);
const cst_val *cg_phone_index(const cst_item *p);
const cst_val *cg_phone_rindex(const cst_item *p);

void basic_ff_register(cst_features *ffunctions);
void basic_ff_register(cst_ffunction *ffunctions);

#endif /* _CST_FFEATURES_H */
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,85 +46,7 @@
#ifndef _CST_FILE_H__
#define _CST_FILE_H__

#define CST_WRONG_FORMAT -2
#define CST_ERROR_FORMAT -1
#define CST_OK_FORMAT 0

#ifdef UNDER_CE
/* File access stuff (WinCE 2.11 is really damaged) */
#include <windows.h>
#include <winbase.h>
typedef HANDLE cst_file;
#elif __palmos__
#include <PalmOS.h>
#include <System/StdIOPalm.h>
typedef FILE * cst_file;
#else
#include <stdio.h>
typedef FILE * cst_file;
#endif

/* File mapping stuff */
#ifdef _WIN32
#include <windows.h>
typedef struct cst_filemap_struct {
void *mem;
cst_file fh;
size_t mapsize;
HANDLE h;
} cst_filemap;
#elif __palmos__
typedef struct cst_filemap_struct {
void *mem;
cst_file fh;
unsigned int mapsize;
int fd;
} cst_filemap;
#else
typedef struct cst_filemap_struct {
void *mem;
cst_file fh;
size_t mapsize;
int fd;
} cst_filemap;
#endif

#define CST_OPEN_WRITE (1<<0)
#define CST_OPEN_READ (1<<1)
#define CST_OPEN_APPEND (1<<2)
#define CST_OPEN_BINARY (1<<3)

#define CST_SEEK_ABSOLUTE 0
#define CST_SEEK_RELATIVE 1
#define CST_SEEK_ENDREL 2

cst_file cst_fopen(const char *path, int mode);
long cst_fwrite(cst_file fh, const void *buf, long size, long count);
long cst_fread(cst_file fh, void *buf, long size, long count);
int cst_fprintf(cst_file fh, const char *fmt, ...);
int cst_sprintf(char *s, const char *fmt, ...);
#if defined(__palmos__)
#include <stdarg.h>
int cst_vsprintf(char *s, const char *fmt, va_list args);
#endif
int cst_fclose(cst_file fh);
int cst_fgetc(cst_file fh);

/* These aren't LFS-compliant. I don't think we'll need >2G files. */
long cst_ftell(cst_file fh);
long cst_fseek(cst_file fh, long pos, int whence);
long cst_filesize(cst_file fh);

cst_filemap *cst_mmap_file(const char *path);
int cst_munmap_file(cst_filemap *map);

cst_filemap *cst_read_whole_file(const char *path);
int cst_free_whole_file(cst_filemap *map);

cst_filemap *cst_read_part_file(const char *path);
int cst_free_part_file(cst_filemap *map);

int cst_urlp(const char *url);
cst_file cst_url_open(const char *url);

#endif

This file was deleted.

@@ -40,7 +40,6 @@
#ifndef _CST_ITEM_H__
#define _CST_ITEM_H__

#include "cst_file.h"
#include "cst_features.h"

/* Everyone needs these so forward define these */
@@ -69,14 +68,10 @@ struct cst_item_struct {

/* Constructor functions */
cst_item *new_item_relation(cst_relation *r,cst_item *i);
cst_item_contents *new_item_contents(cst_item *i);

/* Remove this item from this references */
void delete_item(cst_item *item);

void item_contents_set(cst_item *current, cst_item *i);
void item_unref_contents(cst_item *i);

cst_item *item_as(const cst_item *i,const char *rname);

cst_utterance *item_utt(const cst_item *i);
@@ -90,13 +85,10 @@ cst_item *item_prepend(cst_item *i,cst_item *new_item);

/* Tree accessor/manipulator function */
cst_item *item_parent(const cst_item *i);
cst_item *item_nth_daughter(const cst_item *i,int n);
cst_item *item_daughter(const cst_item *i);
cst_item *item_last_daughter(const cst_item *i);

cst_item *item_add_daughter(cst_item *i,cst_item *new_item);
cst_item *item_append_sibling(cst_item *i,cst_item *new_item);
cst_item *item_prepend_sibling(cst_item *i,cst_item *new_item);

/* Feature accessor/manipulator functions */
int item_feat_present(const cst_item *i,const char *name);
@@ -111,7 +103,7 @@ void item_set_int(const cst_item *i,const char *name,int val);
void item_set_float(const cst_item *i,const char *name,float val);
void item_set_string(const cst_item *i,const char *name,const char *val);

#define item_name(I) item_feat_string(I,"name")
#define ITEM_NAME(I) item_feat_string(I,"name")

int item_equal(const cst_item *a, const cst_item *b);

@@ -123,10 +115,8 @@ cst_item* path_to_item(const cst_item *item,const char *featpath);

/* Feature function, for features that are derived algorithmically from others. */
typedef const cst_val *(*cst_ffunction)(const cst_item *i);
CST_VAL_USER_FUNCPTR_DCLS(ffunc,cst_ffunction)
void ff_register(cst_features *ffeatures, const char *name,
void ff_register(cst_ffunction *ffeatures, const char *name,
cst_ffunction f);
void ff_unregister(cst_features *ffeatures, const char *name);

/* Generalized item hook function, like cst_uttfunc. */
typedef cst_val *(*cst_itemfunc)(cst_item *i);
@@ -45,7 +45,6 @@

typedef struct lexicon_struct {
char *name;
int num_entries;
/* Entries are centered around bytes with value 255 */
/* entries and forward (compressed) pronunciations and backwards */
/* each are terminated (preceeded in pron case) by 0 */
@@ -58,9 +57,6 @@ typedef struct lexicon_struct {

int (*syl_boundary)(const cst_item *i,const cst_val *p);

cst_val *(*lts_function)(const struct lexicon_struct *l, const char *word, const char *pos, const cst_features *feats);

char ***addenda;
/* ngram frequency table used for packed entries */
const char * const *phone_hufftable;
const char * const *entry_hufftable;
@@ -71,19 +67,18 @@ typedef struct lexicon_struct {

} cst_lexicon;

cst_lexicon *new_lexicon();
void delete_lexicon(cst_lexicon *lex);
cst_val *cst_lex_load_addenda(const cst_lexicon *lex, const char *lexfile);

const cst_val *get_entry_lex_addenda(const char *word,
const cst_val *lex_addenda);

cst_val *cst_lex_make_entry(const cst_lexicon *lex,
const cst_string *entry);
cst_val *cst_lex_load_addenda(const cst_lexicon *lex,
const char *lexfile);
cst_val *get_phones_lex_addenda(const cst_val *entry);

cst_val *lex_lookup(const cst_lexicon *l, const char *word, const char *pos,
const cst_features *feats);
int in_lex(const cst_lexicon *l, const char *word, const char *pos,
const cst_features *feats);
cst_val *lex_lookup(const cst_lexicon *l, const char *word, const char *pos);
int in_lex(const cst_lexicon *l, const char *word, const char *pos);

CST_VAL_USER_TYPE_DCLS(lexicon,cst_lexicon)

void delete_lexicon(cst_lexicon *lexicon);

#endif
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -48,9 +54,6 @@ typedef unsigned char cst_lts_feat;
typedef unsigned char cst_lts_letter;
typedef unsigned char cst_lts_model;

/* end of rule value */
#define CST_LTS_EOR 255

typedef struct cst_lts_rules_struct {
char *name;
const cst_lts_addr *letter_index; /* index into model first state */
@@ -69,10 +72,7 @@ typedef struct cst_lts_rule_struct {
cst_lts_addr qfalse;
} cst_lts_rule;

cst_lts_rules *new_lts_rules();

cst_val *lts_apply(const char *word,const char *feats,const cst_lts_rules *r);
cst_val *lts_apply_val(const cst_val *wlist,const char *feats,const cst_lts_rules *r);

#endif

This file was deleted.

This file was deleted.

@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,7 +46,6 @@
#ifndef _CST_PHONESET_H__
#define _CST_PHONESET_H__

#include "cst_file.h"
#include "cst_val.h"
#include "cst_features.h"
#include "cst_item.h"
@@ -53,22 +58,16 @@ struct cst_phoneset_struct {
const char *silence;
const int num_phones;
const int * const * fvtable;
int freeable; /* 0 if const in memory, 1 if we alloc'd it */
};
typedef struct cst_phoneset_struct cst_phoneset;

/* Constructor functions */
cst_phoneset *new_phoneset();
void delete_phoneset(const cst_phoneset *u);

const cst_val *phone_feature(const cst_phoneset *ps,
const char* phonename,
const char *featname);
const char *phone_feature_string(const cst_phoneset *ps,
const char* phonename,
const char *featname);
int phone_id(const cst_phoneset *ps,const char* phonename);
int phone_feat_id(const cst_phoneset *ps,const char* featname);

const cst_phoneset *item_phoneset(const cst_item *i);

@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -84,12 +90,6 @@
#include "cst_file.h"
#include "cst_string.h"

/*
* The first byte of the regexp internal "program" is actually this magic
* number; the start node begins in the second byte.
*/
#define CST_REGMAGIC 0234

typedef struct cst_regex_struct {
char regstart; /* Internal use only. */
char reganch; /* Internal use only. */
@@ -111,34 +111,12 @@ cst_regex *new_cst_regex(const char *str);
void delete_cst_regex(cst_regex *r);

int cst_regex_match(const cst_regex *r, const char *str);
cst_regstate *cst_regex_match_return(const cst_regex *r, const char *str);

/* Internal functions from original HS code */
cst_regex *hs_regcomp(const char *);
cst_regstate *hs_regexec(const cst_regex *, const char *);
void hs_regdelete(cst_regex *);

/* Works similarly to snprintf(3), in that at most max characters are
written to out, including the trailing NUL, and the return value is
the number of characters written, *excluding* the trailing NUL.
Also works similarly to wcstombs(3) in that passing NULL as out
will count the number of characters that would be written without
doing any actual conversion, and ignoring max. So, you could use
it like this:
rx = new_cst_regex("\\(.*\\)_\\(.*\\)");
if ((rs = cst_regex_match_return(rx, "foo_bar")) != NULL) {
size_t n;
n = cst_regsub(rs, "\\1_\\2_quux", NULL, 0) + 1;
out = cst_alloc(char, n);
cst_regsub(rs, "\\1_\\2_quux", out, n);
} */
size_t cst_regsub(const cst_regstate *r, const char *in, char *out, size_t max);

/* Initialize the regex engine and global regex constants */
void cst_regex_init();

/* Regexps used in text processing (these are latin-alphabet specific
and to some extent US English-specific) */
extern const cst_regex * const cst_rx_white;
@@ -155,6 +133,5 @@ extern const cst_regex * const cst_rx_dotted_abbrev;

/* Table of regexps used in CART trees (only one so far) */
extern const cst_regex * const cst_regex_table[];
#define CST_RX_dotted_abbrev_NUM 0

#endif
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,8 +46,6 @@
#ifndef _CST_RELATION_H__
#define _CST_RELATION_H__

#include "cst_file.h"
#include "cst_val.h"
#include "cst_features.h"
#include "cst_item.h"
#include "cst_utterance.h"
@@ -61,12 +65,7 @@ void delete_relation(cst_relation *r);

cst_item *relation_head(cst_relation *r);
cst_item *relation_tail(cst_relation *r);
const char *relation_name(cst_relation *r);

cst_item *relation_append(cst_relation *r,cst_item *i);
cst_item *relation_prepend(cst_relation *r,cst_item *i);

int relation_load(cst_relation *r, const char *filename);
int relation_save(cst_relation *r, const char *filename);

#endif

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -42,20 +48,12 @@

#include <string.h>

#if defined(UNDER_CE) && (UNDER_CE < 300)
#define isalnum(a) iswalnum((wint_t)(a))
#define isupper(a) iswupper((wint_t)(a))
#define islower(a) iswlower((wint_t)(a))
#endif

/* typedef unsigned char cst_string; */
typedef char cst_string;

double cst_atof(const char *str);

cst_string *cst_strdup(const cst_string *s);
cst_string *cst_strchr(const cst_string *s, int c);
cst_string *cst_strrchr(const cst_string *str, int c);
#define cst_strstr(h,n) \
((cst_string *)strstr((const char *)h,(const char *)n))
#define cst_strlen(s) (strlen((const char *)s))
@@ -64,11 +62,10 @@ cst_string *cst_strrchr(const cst_string *str, int c);
int cst_member_string(const char *str, const char * const *slist);
char *cst_substr(const char *str,int start, int length);

char *cst_string_before(const char *s,const char *c);
char *cst_strcat(const char *a,const char *b);
char *cst_strcat3(const char *a, const char *b, const char *c);

cst_string *cst_downcase(const cst_string *str);
cst_string *cst_upcase(const cst_string *str);

int bell_validate_atof(const char * str, float * floatout);
int bell_validate_atoi(const char * str, int * intout);

#endif

This file was deleted.

@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,8 +46,9 @@
#ifndef _SYNTH_H__
#define _SYNTH_H__

#include "cst_hrg.h"
#include "cst_relation.h"
#include "cst_tokenstream.h"
#include "cst_utterance.h"
#include "cst_voice.h"
#include "cst_wave.h"

@@ -55,41 +62,10 @@ int default_utt_break(cst_tokenstream *ts,
/* You must call utt_init before any of the others. */
cst_utterance *utt_init(cst_utterance *u, cst_voice *vox);
cst_utterance *utt_synth(cst_utterance *u);
cst_utterance *utt_synth_phones(cst_utterance *u);
cst_utterance *utt_synth_tokens(cst_utterance *u);
cst_utterance *utt_synth_wave(cst_wave *w,cst_voice *v);

typedef struct cst_dur_stats_struct {
char *phone;
float mean;
float stddev;
} dur_stat;
typedef dur_stat *dur_stats; /* only one star, due to funky cst_val magic */
CST_VAL_USER_TYPE_DCLS(dur_stats,dur_stats)

cst_utterance *default_segmentanalysis(cst_utterance *u);

cst_utterance *default_tokenization(cst_utterance *u);
cst_utterance *default_textanalysis(cst_utterance *u);
cst_val *default_tokentowords(cst_item *i);
cst_utterance *default_phrasing(cst_utterance *u);
cst_utterance *default_pos_tagger(cst_utterance *u);
cst_utterance *default_lexical_insertion(cst_utterance *u);
cst_utterance *default_pause_insertion(cst_utterance *u);
cst_utterance *hts_phrasing(cst_utterance *u);

cst_utterance *cart_intonation(cst_utterance *u);
cst_utterance *cart_duration(cst_utterance *u);

cst_utterance *flat_prosody(cst_utterance *u);

typedef struct cst_synth_module_struct {
const char *hookname;
cst_uttfunc defhook;
} cst_synth_module;

cst_utterance *apply_synth_module(cst_utterance *u,
const cst_synth_module *mod);
cst_utterance *apply_synth_method(cst_utterance *u,
const cst_synth_module meth[]);
#endif

@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,16 +46,13 @@
#ifndef _CST_TOKENSTREAM_H__
#define _CST_TOKENSTREAM_H__

#include "cst_alloc.h"
#include "cst_string.h"
#include "cst_file.h"
#include "cst_features.h"

typedef struct cst_tokenstream_struct {
cst_file fd;
int file_pos;
int line_number;
int eof_flag;
cst_string *string_buffer;

int current_char;
@@ -64,10 +67,6 @@ typedef struct cst_tokenstream_struct {
int postp_max;
cst_string *postpunctuation;

cst_features *tags; /* e.g xml tags */
/* if set will find token boundaries at every utf8 character */
int utf8_explode_mode;

void *streamtype_data;

/* Should only be set through set_charclasses as charclass table needs */
@@ -78,30 +77,9 @@ typedef struct cst_tokenstream_struct {
const cst_string *p_postpunctuationsymbols;

cst_string charclass[256];

/* To allow externally specified reading functions e.g. epub/xml */
int (*open)(struct cst_tokenstream_struct *ts, const char *filename);
void (*close)(struct cst_tokenstream_struct *ts);
int (*eof)(struct cst_tokenstream_struct *ts);
int (*seek)(struct cst_tokenstream_struct *ts, int pos);
int (*tell)(struct cst_tokenstream_struct *ts);
int (*size)(struct cst_tokenstream_struct *ts);
int (*getc)(struct cst_tokenstream_struct *ts);
} cst_tokenstream;

#define TS_CHARCLASS_NONE 0
#define TS_CHARCLASS_WHITESPACE 2
#define TS_CHARCLASS_SINGLECHAR 4
#define TS_CHARCLASS_PREPUNCT 8
#define TS_CHARCLASS_POSTPUNCT 16
#define TS_CHARCLASS_QUOTE 32

#define ts_charclass(C,CLASS,TS) ((TS)->charclass[(unsigned char)C] & CLASS)

extern const cst_string * const cst_ts_default_whitespacesymbols;
extern const cst_string * const cst_ts_default_prepunctuationsymbols;
extern const cst_string * const cst_ts_default_postpunctuationsymbols;
extern const cst_string * const cst_ts_default_singlecharsymbols;

/* Public functions for tokenstream manipulation */
cst_tokenstream *ts_open(const char *filename,
@@ -114,20 +92,6 @@ cst_tokenstream *ts_open_string(const cst_string *string,
const cst_string *singlecharsymbols,
const cst_string *prepunctsymbols,
const cst_string *postpunctsymbols);
cst_tokenstream *ts_open_generic(const char *filename,
const cst_string *whitespacesymbols,
const cst_string *singlecharsymbols,
const cst_string *prepunctsymbols,
const cst_string *postpunctsymbols,
void *streamtype_data,
int (*open)(cst_tokenstream *ts,
const char *filename),
void (*close)(cst_tokenstream *ts),
int (*eof)(cst_tokenstream *ts),
int (*seek)(cst_tokenstream *ts, int pos),
int (*tell)(cst_tokenstream *ts),
int (*size)(cst_tokenstream *ts),
int (*getc)(cst_tokenstream *ts));
void ts_close(cst_tokenstream *ts);

int ts_eof(cst_tokenstream *ts);
@@ -136,20 +100,11 @@ const cst_string *ts_get(cst_tokenstream *ts);
const cst_string *ts_get_quoted_token(cst_tokenstream *ts,
char quote,
char escape);
/* Externally specified ts interfaces may need this */
cst_string private_ts_getc(cst_tokenstream *ts);


void set_charclasses(cst_tokenstream *ts,
const cst_string *whitespace,
const cst_string *singlecharsymbols,
const cst_string *prepunctuation,
const cst_string *postpunctuation);

int ts_read(void *buff, int size, int num, cst_tokenstream *ts);
void set_singlecharsymbols(cst_tokenstream *ts,
const cst_string *singlecharsymbols);

int ts_set_stream_pos(cst_tokenstream *ts,int pos);
int ts_get_stream_pos(cst_tokenstream *ts);
int ts_get_stream_size(cst_tokenstream *ts);

#endif
@@ -1,4 +1,10 @@
/*************************************************************************/
/* This code has been modified for Bellbird. */
/* See COPYING for more copyright details. */
/* The unmodified source code copyright notice */
/* is included below. */
/*************************************************************************/
/*************************************************************************/
/* */
/* Language Technologies Institute */
/* Carnegie Mellon University */
@@ -40,32 +46,17 @@
#ifndef _CST_TRACK_H__
#define _CST_TRACK_H__

#include "cst_file.h"
#include "cst_error.h"
#include "cst_alloc.h"
#include "cst_endian.h"
#include "cst_file.h"
#include "cst_val.h"

typedef struct cst_track_struct {
const char *type;
int num_frames;
int num_channels;
float *times;
float **frames;
} cst_track;

cst_track *new_track();
cst_track *new_track(int num_frames, int num_channels);
void delete_track(cst_track *val);

float track_frame_shift(cst_track *t, int frame);
void cst_track_resize(cst_track *t,int num_frames, int num_channels);
cst_track *cst_track_copy(const cst_track *t);

int cst_track_save_est(cst_track *t, const char *filename);
int cst_track_save_est_binary(cst_track *t, const char *filename);
int cst_track_load_est(cst_track *t, const char *filename);

CST_VAL_USER_TYPE_DCLS(track,cst_track)

#endif

This file was deleted.