summaryrefslogtreecommitdiff
blob: 25f162012fa1b821f11d3c943739be6f4c2635b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
--- speech_tools/include/EST_simplestats.h	2006/07/21 02:18:39	1.1
+++ speech_tools/include/EST_simplestats.h	2006/07/21 02:35:43
@@ -194,7 +194,7 @@ enum EST_tprob_type {tprob_string, tprob
     for example
     \begin{verbatim}
        EST_DiscreteProbistribution pdf;
-       for (int i=pdf.item_start(); i < pdf.item_end(); i=pdf.item_next(i))
+       for (long i=pdf.item_start(); i < pdf.item_end(); i=pdf.item_next(i))
        {
           EST_String name;
           double prob;
@@ -265,17 +265,17 @@ public:
     /// 
     double frequency(const int i) const; 
     /// Used for iterating through members of the distribution
-    int item_start() const;
+    long item_start() const;
     /// Used for iterating through members of the distribution
-    int item_next(int idx) const;
+    long item_next(long idx) const;
     /// Used for iterating through members of the distribution
-    int item_end(int idx) const;
+    int item_end(long idx) const;
     /// During iteration returns name given index 
-    const EST_String &item_name(int idx) const;
+    const EST_String &item_name(long idx) const;
     /// During iteration returns name and frequency given index  
-    void item_freq(int idx,EST_String &s,double &freq) const;
+    void item_freq(long idx,EST_String &s,double &freq) const;
     /// During iteration returns name and probability given index
-    void item_prob(int idx,EST_String &s,double &prob) const;
+    void item_prob(long idx,EST_String &s,double &prob) const;
 
     /// Returns discrete vocabulary of distribution
     inline const EST_Discrete *const get_discrete() const { return discrete; };
--- speech_tools/stats/wagon/wagon_aux.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/stats/wagon/wagon_aux.cc	2006/07/21 02:36:09
@@ -537,7 +537,7 @@ ostream & operator <<(ostream &s, WImpur
     }
     else if (imp.t == wnim_class)
     {
-	int i;
+	long i;
 	EST_String name;
 	double prob;
 
--- speech_tools/stats/EST_DProbDist.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/stats/EST_DProbDist.cc	2006/07/21 02:41:32
@@ -305,15 +305,15 @@ double EST_DiscreteProbDistribution::ent
 }
 
 //  For iterating through members of a probability distribution
-int EST_DiscreteProbDistribution::item_start(void) const
+long EST_DiscreteProbDistribution::item_start(void) const
 {
     if (type == tprob_discrete)
 	return 0;
     else
-	return (int)scounts.list.head();
+	return (long)scounts.list.head();
 }
 
-int EST_DiscreteProbDistribution::item_end(int idx) const
+int EST_DiscreteProbDistribution::item_end(long idx) const
 {
     if (type == tprob_discrete)
 	return (idx >= icounts.length());
@@ -321,15 +321,15 @@ int EST_DiscreteProbDistribution::item_e
 	return ((EST_Litem *)idx == 0);
 }
 
-int EST_DiscreteProbDistribution::item_next(int idx) const
+long EST_DiscreteProbDistribution::item_next(long idx) const
 {
     if (type == tprob_discrete)
 	return ++idx;
     else
-	return (int)next((EST_Litem *)idx);
+	return (long)next((EST_Litem *)idx);
 }
 
-const EST_String &EST_DiscreteProbDistribution::item_name(int idx) const
+const EST_String &EST_DiscreteProbDistribution::item_name(long idx) const
 {
     if (type == tprob_discrete)
 	return discrete->name(idx);
@@ -337,7 +337,7 @@ const EST_String &EST_DiscreteProbDistri
 	return scounts.list((EST_Litem *)idx).k;
 }
 
-void EST_DiscreteProbDistribution::item_freq(int idx,EST_String &s,double &freq) const
+void EST_DiscreteProbDistribution::item_freq(long idx,EST_String &s,double &freq) const
 {
     if (type == tprob_discrete)
     {
@@ -351,7 +351,7 @@ void EST_DiscreteProbDistribution::item_
     }
 }
 
-void EST_DiscreteProbDistribution::item_prob(int idx,EST_String &s,double &prob) const
+void EST_DiscreteProbDistribution::item_prob(long idx,EST_String &s,double &prob) const
 {
     if (type == tprob_discrete)
     {
@@ -368,7 +368,7 @@ void EST_DiscreteProbDistribution::item_
 ostream & operator<<(ostream &s, const EST_DiscreteProbDistribution &pd)
 {
     // Output best with probabilities
-    int i;
+    long i;
     double prob;
     double sum=0;
     EST_String name;
--- speech_tools/grammar/ngram/EST_Ngrammar.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/grammar/ngram/EST_Ngrammar.cc	2006/07/21 02:38:54
@@ -180,7 +180,7 @@ bool EST_BackoffNgrammarState::accumulat
 					  const double count)
 {
 
-//    int i;
+//    long i;
 //    cerr << "accumulate level " << p_level << " : ";
 //    for(i=0;i<words.n();i++)
 //    {
@@ -302,7 +302,7 @@ void EST_BackoffNgrammarState::print_fre
     // not right - just print out, then recurse through children
     // change to use 'backoff_traverse'
     
-    int k;
+    long k;
     double freq;
     EST_String name;
     for (k=p_pdf.item_start();
@@ -369,7 +369,7 @@ void EST_BackoffNgrammarState::zap()
 {
 
     // recursively delete this state and all its children
-    int k;
+    long k;
     double freq;
     EST_String name;
     for (k=p_pdf.item_start();
@@ -452,7 +452,7 @@ bool EST_BackoffNgrammarState::set_backo
 
 void EST_BackoffNgrammarState::frequency_of_frequencies(EST_DVector &ff)
 {
-    int k,max=ff.n();
+    long k; int max=ff.n();
     double freq;
     EST_String name;
     for (k=p_pdf.item_start();
@@ -911,7 +911,7 @@ void EST_Ngrammar::accumulate(const EST_
 {
     
     /*
-       int i;
+       long i;
        for(i=0;i<words.n();i++)
        {
        cerr << vocab_pdf.item_name(words(i));
@@ -1581,7 +1581,7 @@ void EST_Ngrammar::prune_backoff_represe
     // remove any branches with zero frequency count
     
     // find children of this state with zero freq and zap them
-    int k;
+    long k;
     double freq;
     EST_String name;
     for (k=start_state->pdf_const().item_start();
@@ -2320,7 +2320,7 @@ void EST_Ngrammar::print_freqs(ostream &
 	backoff_representation->print_freqs(os,p_order);
     else
     {
-	int i,j,k;
+	int i,j; long k;
 	EST_IVector window(p_order-1);
 	
 	for (i=0; i < p_num_states; i++)
@@ -2661,7 +2661,7 @@ EST_Ngrammar::backoff_traverse(EST_Backo
     function(start_state,params);
     
     // and recurse down the tree
-    int k;
+    long k;
     double freq;
     EST_String name;
     for (k=start_state->pdf_const().item_start();
@@ -2692,7 +2692,7 @@ EST_Ngrammar::backoff_traverse(EST_Backo
     {
 	// and recurse down the tree if we haven't
 	// reached the level yet
-	int k;
+	long k;
 	double freq;
 	EST_String name;
 	
--- speech_tools/grammar/ngram/ngrammar_io.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/grammar/ngram/ngrammar_io.cc	2006/07/21 02:39:05
@@ -281,7 +281,7 @@ EST_read_status 
 load_ngram_cstr_bin(const EST_String filename, EST_Ngrammar &n)
 {
     EST_TokenStream ts;
-    int i,j,k,order;
+    int i,j,order; long k;
     int num_entries;
     double approx_num_samples = 0.0;
     long freq_data_start, freq_data_end;
@@ -407,7 +407,7 @@ EST_write_status
 save_ngram_htk_ascii_sub(const EST_String &word, ostream *ost, 
 			 EST_Ngrammar &n, double floor)
 {
-    int k;
+    long k;
     EST_String name;
     double freq;
     EST_StrVector this_ngram(2); // assumes bigram
@@ -734,7 +734,7 @@ save_ngram_cstr_ascii(const EST_String f
     // awb's format
     (void)trace;
     ostream *ost;
-    int i,k;
+    int i; long k;
     
     if (filename == "-")
 	ost = &cout;
@@ -831,7 +831,7 @@ save_ngram_cstr_bin(const EST_String fil
     if (n.representation() == EST_Ngrammar::sparse)
 	return misc_write_error;
     
-    int i,k;
+    int i; long k;
     FILE *ofd;
     double lfreq = -1;
     double count = -1;
--- speech_tools/grammar/ngram/ngrammar_aux.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/grammar/ngram/ngrammar_aux.cc	2006/07/21 02:39:20
@@ -117,7 +117,7 @@ smooth_ExponentialFit(EST_DVector &N, in
 
 void make_f_of_f(EST_BackoffNgrammarState *s,void *params)
 {
-    int k;
+    long k;
     double freq;
     EST_String name;
 
@@ -138,7 +138,7 @@ void make_f_of_f(EST_BackoffNgrammarStat
 
 void get_max_f(EST_BackoffNgrammarState *s,void *params)
 {
-    int k;
+    long k;
     double freq;
     EST_String name;
 
@@ -158,7 +158,7 @@ void get_max_f(EST_BackoffNgrammarState 
 
 void map_f_of_f(EST_BackoffNgrammarState *s,void *params)
 {
-    int k;
+    long k;
     double freq;
     EST_String name;
 
@@ -184,7 +184,7 @@ void map_f_of_f(EST_BackoffNgrammarState
 
 void zero_small_f(EST_BackoffNgrammarState *s,void *params)
 {
-    int k;
+    long k;
     double freq;
     EST_String name;
 
@@ -204,7 +204,7 @@ void zero_small_f(EST_BackoffNgrammarSta
 
 void frequency_of_frequencies(EST_DVector &ff, EST_Ngrammar &n,int this_order)
 {
-  int i,k,size;
+  int i,size; long k;
   double max=0.0;
 
   // if ff has zero size, do complete frequency of frequencies
@@ -302,7 +302,7 @@ void frequency_of_frequencies(EST_DVecto
 
 void map_frequencies(EST_Ngrammar &n, const EST_DVector &map, const int this_order)
 {
-  int i,k;
+  int i; long k;
 
 
   switch(n.representation())
--- speech_tools/grammar/ngram/EST_PST.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/grammar/ngram/EST_PST.cc	2006/07/21 02:39:31
@@ -71,7 +71,7 @@ EST_PredictionSuffixTree_tree_node::prin
 	// Base -- print from pd 
 	EST_String s;
 	double freq;
-	for (int i = pd.item_start(); 
+	for (long i = pd.item_start(); 
 	     !pd.item_end(i); 
 	     i=pd.item_next(i))
 	{
@@ -98,7 +98,7 @@ EST_PredictionSuffixTree_tree_node::prin
 	EST_String s;
 	double prob;
 	os << get_path() << " :";
-	for (int i = pd.item_start(); !pd.item_end(i) ; i=pd.item_next(i))
+	for (long i = pd.item_start(); !pd.item_end(i) ; i=pd.item_next(i))
 	{
 	    pd.item_prob(i,s,prob);
 	    os << " " << s << " " << prob;
--- speech_tools/grammar/ngram/freqsmooth.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/grammar/ngram/freqsmooth.cc	2006/07/21 02:46:42
@@ -74,7 +74,7 @@ void fs_build_backoff_ngrams(EST_Ngramma
 				 EST_Ngrammar &ngram)
 {
     // Build all the backoff grammars back to uni-grams
-    int i,j,k,l;
+    int i,j,l; long k;
 
     for (i=0; i < ngram.order()-1; i++)
 	backoff_ngrams[i].init(i+1,EST_Ngrammar::dense,
@@ -110,7 +110,7 @@ int fs_backoff_smooth(EST_Ngrammar *back
 {
     // For all ngrams which are too infrequent, adjust their
     // frequencies based on their backoff probabilities
-    int i,j;
+    int i; long j;
     double occurs;
     double backoff_prob;
 
--- speech_tools/grammar/wfst/wfst_train.cc	2006/07/21 02:18:39	1.1
+++ speech_tools/grammar/wfst/wfst_train.cc	2006/07/21 02:39:47
@@ -299,7 +299,7 @@ static LISP find_best_split(EST_WFST &wf
     LISP *ssplits;
     gc_protect(&splits);
     EST_String sname;
-    int b,best_b,i;
+    int b,best_b; long i;
     int num_pdfs;
     double best_score, score, sfreq;
 
@@ -374,7 +374,7 @@ static double score_pdf_combine(EST_Disc
     // Find score of (a+b) vs (all-(a+b))
     EST_DiscreteProbDistribution ab(a);
     EST_DiscreteProbDistribution all_but_ab(all);
-    int i;
+    long i;
     EST_String sname;
     double sfreq, score;
     for (i=b.item_start(); !b.item_end(i);
@@ -506,7 +506,7 @@ static double find_score_if_split(EST_WF
     EST_DiscreteProbDistribution pdf_split(&wfst.in_symbols());
     EST_DiscreteProbDistribution pdf_remain(&wfst.in_symbols());
     int in, tostate, id;
-    int i;
+    long i;
     double sfreq;
     EST_String sname;