@@ -47,12 +47,14 @@ int main(int argc, char *argv[]) {
4747
4848 bool write_compact = true ;
4949 int32 num_states_cache = 50000 ;
50- int32 phi_label = fst::kNoLabel ; // == -1
51- po.Register (" write-compact" , &write_compact, " If true, write in normal (compact) form." );
52- po.Register (" phi-label" , &phi_label, " If >0, the label on backoff arcs of the LM" );
50+ int32 phi_label = fst::kNoLabel ; // == -1
51+ po.Register (" write-compact" , &write_compact,
52+ " If true, write in normal (compact) form." );
53+ po.Register (" phi-label" , &phi_label,
54+ " If >0, the label on backoff arcs of the LM" );
5355 po.Register (" num-states-cache" , &num_states_cache,
54- " Number of states we cache when mapping LM FST to lattice type. "
55- " More -> more memory but faster." );
56+ " Number of states we cache when mapping LM FST to lattice type."
57+ " More -> more memory but faster." );
5658 po.Read (argc, argv);
5759
5860 if (po.NumArgs () != 3 ) {
@@ -72,10 +74,11 @@ int main(int argc, char *argv[]) {
7274 CompactLatticeWriter compact_lattice_writer;
7375 LatticeWriter lattice_writer;
7476
75- if (write_compact)
77+ if (write_compact) {
7678 compact_lattice_writer.Open (lats_wspecifier);
77- else
79+ } else {
7880 lattice_writer.Open (lats_wspecifier);
81+ }
7982
8083 if (ClassifyRspecifier (arg2, NULL , NULL ) == kNoRspecifier ) {
8184 std::string fst_rxfilename = arg2;
@@ -105,8 +108,11 @@ int main(int argc, char *argv[]) {
105108 Lattice lat1 = lattice_reader1.Value ();
106109 ArcSort (&lat1, fst::OLabelCompare<LatticeArc>());
107110 Lattice composed_lat;
108- if (phi_label > 0 ) PhiCompose (lat1, mapped_fst2, phi_label, &composed_lat);
109- else Compose (lat1, mapped_fst2, &composed_lat);
111+ if (phi_label > 0 ) {
112+ PhiCompose (lat1, mapped_fst2, phi_label, &composed_lat);
113+ } else {
114+ Compose (lat1, mapped_fst2, &composed_lat);
115+ }
110116 if (composed_lat.Start () == fst::kNoStateId ) {
111117 KALDI_WARN << " Empty lattice for utterance " << key << " (incompatible LM?)" ;
112118 n_fail++;
@@ -123,7 +129,7 @@ int main(int argc, char *argv[]) {
123129 }
124130 delete fst2;
125131 } else {
126- // composing with each utterance with different fst,
132+ // Compose each utterance with its matching (by key) FST.
127133 std::string fst_rspecifier2 = arg2;
128134 RandomAccessTableReader<fst::VectorFstHolder> fst_reader2 (fst_rspecifier2);
129135
@@ -135,7 +141,7 @@ int main(int argc, char *argv[]) {
135141
136142 if (!fst_reader2.HasKey (key)) {
137143 KALDI_WARN << " Not producing output for utterance " << key
138- << " because not present in second table." ;
144+ << " because it's not present in second table." ;
139145 n_fail++;
140146 continue ;
141147 }
0 commit comments