2222#include " fstext/fst-test-utils.h"
2323#include " base/kaldi-math.h"
2424
25+ #include " fstext/openfst_compat.h"
26+
2527namespace fst {
2628using std::vector;
2729using std::cout;
@@ -94,7 +96,7 @@ template<class Arc> void TestDeterminizeLattice() {
9496 std::cout << " FST before lattice-determinizing is:\n " ;
9597 {
9698 FstPrinter<Arc> fstprinter (*fst, NULL , NULL , NULL , false , true , " \t " );
97- fstprinter. Print (& std::cout, " standard output" );
99+ printer_print ( std::cout, fstprinter , " standard output" );
98100 }
99101 VectorFst<Arc> det_fst;
100102 try {
@@ -106,7 +108,7 @@ template<class Arc> void TestDeterminizeLattice() {
106108 std::cout << " FST after lattice-determinizing is:\n " ;
107109 {
108110 FstPrinter<Arc> fstprinter (det_fst, NULL , NULL , NULL , false , true , " \t " );
109- fstprinter. Print (& std::cout, " standard output" );
111+ printer_print ( std::cout, fstprinter , " standard output" );
110112 }
111113 assert (det_fst.Properties (kIDeterministic , true ) & kIDeterministic );
112114 // OK, now determinize it a different way and check equivalence.
@@ -117,7 +119,7 @@ template<class Arc> void TestDeterminizeLattice() {
117119 std::cout << " Compact FST is:\n " ;
118120 {
119121 FstPrinter<CompactArc> fstprinter (compact_fst, NULL , NULL , NULL , false , true , " \t " );
120- fstprinter. Print (& std::cout, " standard output" );
122+ printer_print ( std::cout, fstprinter , " standard output" );
121123 }
122124 if (kaldi::Rand () % 2 == 1 )
123125 ConvertLattice<Weight, Int>(det_fst, &compact_det_fst, false );
@@ -128,7 +130,7 @@ template<class Arc> void TestDeterminizeLattice() {
128130 std::cout << " Compact version of determinized FST is:\n " ;
129131 {
130132 FstPrinter<CompactArc> fstprinter (compact_det_fst, NULL , NULL , NULL , false , true , " \t " );
131- fstprinter. Print (& std::cout, " standard output" );
133+ printer_print ( std::cout, fstprinter , " standard output" );
132134 }
133135
134136 assert (RandEquivalent (compact_det_fst, compact_fst, 5 /* paths*/ , 0.01 /* delta*/ , kaldi::Rand ()/* seed*/ , 100 /* path length, max*/ ));
@@ -149,14 +151,14 @@ template<class Arc> void TestDeterminizeLattice2() {
149151 std::cout << " FST before lattice-determinizing is:\n " ;
150152 {
151153 FstPrinter<Arc> fstprinter (*fst, NULL , NULL , NULL , false , true , " \t " );
152- fstprinter. Print (& std::cout, " standard output" );
154+ printer_print ( std::cout, fstprinter , " standard output" );
153155 }
154156 VectorFst<Arc> ofst;
155157 DeterminizeLattice<TropicalWeight, int32>(*fst, &ofst);
156158 std::cout << " FST after lattice-determinizing is:\n " ;
157159 {
158160 FstPrinter<Arc> fstprinter (ofst, NULL , NULL , NULL , false , true , " \t " );
159- fstprinter. Print (& std::cout, " standard output" );
161+ printer_print ( std::cout, fstprinter , " standard output" );
160162 }
161163 delete fst;
162164 }
0 commit comments