• Home
  • Raw
  • Download

Lines Matching refs:Arc

62 template <class Arc, class WeightGenerator>
65 typedef typename Arc::Label Label;
66 typedef typename Arc::StateId StateId;
67 typedef typename Arc::Weight Weight;
69 WeightedTester(int seed, const Fst<Arc> &zero_fst, const Fst<Arc> &one_fst, in WeightedTester()
70 const Fst<Arc> &univ_fst, WeightGenerator *weight_generator) in WeightedTester()
74 void Test(const Fst<Arc> &T1, const Fst<Arc> &T2, const Fst<Arc> &T3) { in Test()
85 void TestRational(const Fst<Arc> &T1, const Fst<Arc> &T2, in TestRational()
86 const Fst<Arc> &T3) { in TestRational()
90 VectorFst<Arc> U1(T1); in TestRational()
92 UnionFst<Arc> U2(T1, T2); in TestRational()
99 VectorFst<Arc> C1(T1); in TestRational()
101 ConcatFst<Arc> C2(T1, T2); in TestRational()
103 VectorFst<Arc> C3(T2); in TestRational()
110 VectorFst<Arc> C1(T1); in TestRational()
112 ClosureFst<Arc> C2(T1, CLOSURE_STAR); in TestRational()
118 VectorFst<Arc> C1(T1); in TestRational()
120 ClosureFst<Arc> C2(T1, CLOSURE_PLUS); in TestRational()
126 VectorFst<Arc> U1(T1); in TestRational()
130 VectorFst<Arc> U3(T2); in TestRational()
132 VectorFst<Arc> U4(T1); in TestRational()
140 UnionFst<Arc> U1(T1, T2); in TestRational()
141 UnionFst<Arc> U2(U1, T3); in TestRational()
143 UnionFst<Arc> U3(T2, T3); in TestRational()
144 UnionFst<Arc> U4(T1, U3); in TestRational()
152 UnionFst<Arc> U1(T1, T2); in TestRational()
155 UnionFst<Arc> U3(T2, T3); in TestRational()
156 UnionFst<Arc> U4(T1, U3); in TestRational()
163 VectorFst<Arc> C1(T1); in TestRational()
167 VectorFst<Arc> C3(T2); in TestRational()
169 VectorFst<Arc> C4(T1); in TestRational()
177 ConcatFst<Arc> C1(T1, T2); in TestRational()
178 ConcatFst<Arc> C2(C1, T3); in TestRational()
180 ConcatFst<Arc> C3(T2, T3); in TestRational()
181 ConcatFst<Arc> C4(T1, C3); in TestRational()
188 ConcatFst<Arc> C1(T1, T2); in TestRational()
191 ConcatFst<Arc> C3(T2, T3); in TestRational()
192 ConcatFst<Arc> C4(T1, C3); in TestRational()
201 VectorFst<Arc> U1(T1); in TestRational()
203 VectorFst<Arc> C1(T3); in TestRational()
206 VectorFst<Arc> C2(T3); in TestRational()
208 VectorFst<Arc> C3(T3); in TestRational()
210 VectorFst<Arc> U2(C2); in TestRational()
219 VectorFst<Arc> U1(T1); in TestRational()
221 VectorFst<Arc> C1(U1); in TestRational()
224 VectorFst<Arc> C2(T1); in TestRational()
226 VectorFst<Arc> C3(T2); in TestRational()
228 VectorFst<Arc> U2(C2); in TestRational()
236 UnionFst<Arc> U1(T1, T2); in TestRational()
237 ConcatFst<Arc> C1(T3, U1); in TestRational()
239 ConcatFst<Arc> C2(T3, T1); in TestRational()
240 ConcatFst<Arc> C3(T3, T2); in TestRational()
241 UnionFst<Arc> U2(C2, C3); in TestRational()
248 UnionFst<Arc> U1(T1, T2); in TestRational()
249 ConcatFst<Arc> C1(U1, T3); in TestRational()
251 ConcatFst<Arc> C2(T1, T3); in TestRational()
252 ConcatFst<Arc> C3(T2, T3); in TestRational()
253 UnionFst<Arc> U2(C2, C3); in TestRational()
261 VectorFst<Arc> S(T1); in TestRational()
263 VectorFst<Arc> C(T1); in TestRational()
266 VectorFst<Arc> P(T1); in TestRational()
275 VectorFst<Arc> S(T1); in TestRational()
277 VectorFst<Arc> C(S); in TestRational()
280 VectorFst<Arc> P(T1); in TestRational()
288 ClosureFst<Arc> S(T1, CLOSURE_STAR); in TestRational()
289 ConcatFst<Arc> C(T1, S); in TestRational()
291 ClosureFst<Arc> P(T1, CLOSURE_PLUS); in TestRational()
298 ClosureFst<Arc> S(T1, CLOSURE_STAR); in TestRational()
299 ConcatFst<Arc> C(S, T1); in TestRational()
301 ClosureFst<Arc> P(T1, CLOSURE_PLUS); in TestRational()
308 void TestMap(const Fst<Arc> &T) { in TestMap()
312 VectorFst<Arc> P1(T); in TestMap()
314 ProjectFst<Arc> P2(T, PROJECT_INPUT); in TestMap()
321 VectorFst<Arc> I1(T); in TestMap()
323 InvertFst<Arc> I2(T); in TestMap()
329 VectorFst<Arc> P1(T); in TestMap()
330 VectorFst<Arc> I1(T); in TestMap()
339 VectorFst<Arc> P1(T); in TestMap()
340 VectorFst<Arc> I1(T); in TestMap()
349 ProjectFst<Arc> P1(T, PROJECT_INPUT); in TestMap()
350 InvertFst<Arc> I1(T); in TestMap()
351 ProjectFst<Arc> P2(I1, PROJECT_OUTPUT); in TestMap()
358 ProjectFst<Arc> P1(T, PROJECT_OUTPUT); in TestMap()
359 InvertFst<Arc> I1(T); in TestMap()
360 ProjectFst<Arc> P2(I1, PROJECT_INPUT); in TestMap()
381 VectorFst<Arc> R(T); in TestMap()
394 RelabelFst<Arc> Rdelay(T, ipairs1, opairs1); in TestMap()
396 RelabelFst<Arc> RRdelay(Rdelay, ipairs2, opairs2); in TestMap()
402 VectorFst<Arc> D(T); in TestMap()
408 EncodeMapper<Arc> encoder(encode_props, ENCODE); in TestMap()
421 EncodeMapper<Arc> encoder(encode_props, ENCODE); in TestMap()
422 EncodeFst<Arc> E(T, &encoder); in TestMap()
423 VectorFst<Arc> Encoded(E); in TestMap()
424 DecodeFst<Arc> D(Encoded, encoder); in TestMap()
430 ToGallicMapper<Arc> to_mapper; in TestMap()
431 FromGallicMapper<Arc> from_mapper; in TestMap()
432 VectorFst< GallicArc<Arc> > G; in TestMap()
433 VectorFst<Arc> F; in TestMap()
441 ToGallicMapper<Arc> to_mapper; in TestMap()
442 FromGallicMapper<Arc> from_mapper; in TestMap()
443 ArcMapFst<Arc, GallicArc<Arc>, ToGallicMapper<Arc> > in TestMap()
445 ArcMapFst<GallicArc<Arc>, Arc, FromGallicMapper<Arc> > in TestMap()
452 void TestCompose(const Fst<Arc> &T1, const Fst<Arc> &T2, in TestCompose()
453 const Fst<Arc> &T3) { in TestCompose()
457 VectorFst<Arc> S1(T1); in TestCompose()
458 VectorFst<Arc> S2(T2); in TestCompose()
459 VectorFst<Arc> S3(T3); in TestCompose()
461 ILabelCompare<Arc> icomp; in TestCompose()
462 OLabelCompare<Arc> ocomp; in TestCompose()
470 ComposeFst<Arc> C1(S1, S2); in TestCompose()
472 ComposeFst<Arc> C2(C1, S3); in TestCompose()
473 ComposeFst<Arc> C3(S2, S3); in TestCompose()
474 ComposeFst<Arc> C4(S1, C3); in TestCompose()
481 UnionFst<Arc> U1(S2, S3); in TestCompose()
482 ComposeFst<Arc> C1(S1, U1); in TestCompose()
484 ComposeFst<Arc> C2(S1, S2); in TestCompose()
485 ComposeFst<Arc> C3(S1, S3); in TestCompose()
486 UnionFst<Arc> U2(C2, C3); in TestCompose()
493 UnionFst<Arc> U1(S1, S2); in TestCompose()
494 ComposeFst<Arc> C1(U1, S3); in TestCompose()
496 ComposeFst<Arc> C2(S1, S3); in TestCompose()
497 ComposeFst<Arc> C3(S2, S3); in TestCompose()
498 UnionFst<Arc> U2(C2, C3); in TestCompose()
503 VectorFst<Arc> A1(S1); in TestCompose()
504 VectorFst<Arc> A2(S2); in TestCompose()
505 VectorFst<Arc> A3(S3); in TestCompose()
512 IntersectFst<Arc> I1(A1, A2); in TestCompose()
513 IntersectFst<Arc> I2(A2, A1); in TestCompose()
519 typedef Matcher< Fst<Arc> > M; in TestCompose()
520 ComposeFst<Arc> C1(S1, S2); in TestCompose()
521 ComposeFst<Arc> C2( in TestCompose()
523 ComposeFstOptions<Arc, M, AltSequenceComposeFilter<M> >()); in TestCompose()
524 ComposeFst<Arc> C3( in TestCompose()
526 ComposeFstOptions<Arc, M, MatchComposeFilter<M> >()); in TestCompose()
534 void TestSort(const Fst<Arc> &T) { in TestSort()
535 ILabelCompare<Arc> icomp; in TestSort()
536 OLabelCompare<Arc> ocomp; in TestSort()
540 VectorFst<Arc> S1(T); in TestSort()
547 VectorFst<Arc> S1(T); in TestSort()
549 ArcSortFst< Arc, ILabelCompare<Arc> > S2(T, icomp); in TestSort()
555 VectorFst<Arc> S1(T); in TestSort()
556 VectorFst<Arc> S2(T); in TestSort()
566 VectorFst<Arc> S1(T); in TestSort()
573 VectorFst< ReverseArc<Arc> > R1; in TestSort()
574 VectorFst<Arc> R2; in TestSort()
582 void TestOptimize(const Fst<Arc> &T) { in TestOptimize()
586 VectorFst<Arc> A(T); in TestOptimize()
591 VectorFst<Arc> C1(T); in TestOptimize()
599 VectorFst<Arc> R1(T); in TestOptimize()
605 RmEpsilonFst<Arc> R2(T); in TestOptimize()
612 VectorFst<Arc> U; in TestOptimize()
613 ArcMap(T, &U, EpsMapper<Arc>()); in TestOptimize()
614 VectorFst<Arc> V; in TestOptimize()
616 Arc arc(1, 1, Weight::One(), V.AddState()); in TestOptimize()
625 VectorFst<Arc> U1(U); in TestOptimize()
630 RmEpsilonFst<Arc> U2(U); in TestOptimize()
638 DeterminizeFst<Arc> D(A); in TestOptimize()
646 VectorFst<Arc> M(D); in TestOptimize()
662 VectorFst<Arc> R; in TestOptimize()
665 DeterminizeFst<Arc> DR(R); in TestOptimize()
666 VectorFst<Arc> RD; in TestOptimize()
668 DeterminizeFst<Arc> DRD(RD); in TestOptimize()
669 VectorFst<Arc> M(DRD); in TestOptimize()
675 if (Arc::Type() == LogArc::Type() || Arc::Type() == StdArc::Type()) { in TestOptimize()
678 VectorFst<Arc> RI(T); in TestOptimize()
679 VectorFst<Arc> RF(T); in TestOptimize()
694 VectorFst<Arc> P1; in TestOptimize()
695 Push<Arc, REWEIGHT_TO_FINAL>(T, &P1, kPushLabels); in TestOptimize()
698 VectorFst<Arc> P2; in TestOptimize()
699 Push<Arc, REWEIGHT_TO_FINAL>(T, &P2, kPushWeights); in TestOptimize()
702 VectorFst<Arc> P3; in TestOptimize()
703 Push<Arc, REWEIGHT_TO_FINAL>(T, &P3, kPushLabels | kPushWeights); in TestOptimize()
709 VectorFst<Arc> P1; in TestOptimize()
710 Push<Arc, REWEIGHT_TO_INITIAL>(T, &P1, kPushLabels); in TestOptimize()
713 VectorFst<Arc> P2; in TestOptimize()
714 Push<Arc, REWEIGHT_TO_INITIAL>(T, &P2, kPushWeights); in TestOptimize()
716 VectorFst<Arc> P3; in TestOptimize()
717 Push<Arc, REWEIGHT_TO_INITIAL>(T, &P3, kPushLabels | kPushWeights); in TestOptimize()
727 VectorFst<Arc> P1(T); in TestOptimize()
729 VectorFst<Arc> P2; in TestOptimize()
737 VectorFst< ReverseArc<Arc> > R; in TestOptimize()
738 VectorFst<Arc> P1(T); in TestOptimize()
739 VectorFst<Arc> P2; in TestOptimize()
750 VectorFst<Arc> P; in TestOptimize()
752 DifferenceFst<Arc> C(A, DeterminizeFst<Arc> in TestOptimize()
753 (RmEpsilonFst<Arc> in TestOptimize()
754 (ArcMapFst<Arc, Arc, in TestOptimize()
755 RmWeightMapper<Arc> > in TestOptimize()
756 (P, RmWeightMapper<Arc>())))); in TestOptimize()
764 SynchronizeFst<Arc> S(T); in TestOptimize()
770 void TestSearch(const Fst<Arc> &T) { in TestSearch()
773 VectorFst<Arc> A(T); in TestSearch()
778 VectorFst<Arc> path; in TestSearch()
787 VectorFst<Arc> R(A); in TestSearch()
790 VectorFst<Arc> paths; in TestSearch()
797 ArcIterator< Fst<Arc> > piter(paths, pstart); in TestSearch()
802 VectorFst<Arc> path; in TestSearch()
806 ArcMap(&path, RmWeightMapper<Arc>()); in TestSearch()
807 VectorFst<Arc> S; in TestSearch()
817 bool Equiv(const Fst<Arc> &fst1, const Fst<Arc> &fst2) { in Equiv()
822 UniformArcSelector<Arc> uniform_selector(seed_); in Equiv()
823 RandGenOptions< UniformArcSelector<Arc> > in Equiv()
832 VectorFst<Arc> zero_fst_;
835 VectorFst<Arc> one_fst_;
838 VectorFst<Arc> univ_fst_;
880 template <class Arc>
883 UnweightedTester(const Fst<Arc> &zero_fsa, const Fst<Arc> &one_fsa, in UnweightedTester()
884 const Fst<Arc> &univ_fsa) {} in UnweightedTester()
886 void Test(const Fst<Arc> &A1, const Fst<Arc> &A2, const Fst<Arc> &A3) {} in Test()
896 typedef StdArc Arc; typedef
897 typedef Arc::Label Label;
898 typedef Arc::StateId StateId;
899 typedef Arc::Weight Weight;
901 UnweightedTester(const Fst<Arc> &zero_fsa, const Fst<Arc> &one_fsa, in UnweightedTester()
902 const Fst<Arc> &univ_fsa) in UnweightedTester()
905 void Test(const Fst<Arc> &A1, const Fst<Arc> &A2, const Fst<Arc> &A3) { in Test()
913 void TestRational(const Fst<Arc> &A1, const Fst<Arc> &A2, in TestRational()
914 const Fst<Arc> &A3) { in TestRational()
918 VectorFst<Arc> U(A1); in TestRational()
927 UnionFst<Arc> U(A1, A2); in TestRational()
935 VectorFst<Arc> C(one_fsa_); in TestRational()
940 VectorFst<Arc> S(A1); in TestRational()
948 Fst<Arc> *C = new VectorFst<Arc>(one_fsa_); in TestRational()
950 ConcatFst<Arc> *F = new ConcatFst<Arc>(*C, A1); in TestRational()
954 ClosureFst<Arc> S(A1, CLOSURE_STAR); in TestRational()
961 void TestIntersect(const Fst<Arc> &A1, const Fst<Arc> &A2, in TestIntersect()
962 const Fst<Arc> &A3) { in TestIntersect()
963 VectorFst<Arc> S1(A1); in TestIntersect()
964 VectorFst<Arc> S2(A2); in TestIntersect()
965 VectorFst<Arc> S3(A3); in TestIntersect()
967 ILabelCompare<Arc> comp; in TestIntersect()
975 IntersectFst<Arc> I1(S1, S2); in TestIntersect()
982 IntersectFst<Arc> I1(S1, S2); in TestIntersect()
983 UnionFst<Arc> U1(I1, S3); in TestIntersect()
985 UnionFst<Arc> U2(S1, S3); in TestIntersect()
986 UnionFst<Arc> U3(S2, S3); in TestIntersect()
987 ArcSortFst< Arc, ILabelCompare<Arc> > S4(U3, comp); in TestIntersect()
988 IntersectFst<Arc> I2(U2, S4); in TestIntersect()
993 VectorFst<Arc> C1; in TestIntersect()
994 VectorFst<Arc> C2; in TestIntersect()
1003 UnionFst<Arc> U(S1, C1); in TestIntersect()
1009 IntersectFst<Arc> I(S1, C1); in TestIntersect()
1015 UnionFst<Arc> U(C1, C2); in TestIntersect()
1017 IntersectFst<Arc> I(S1, S2); in TestIntersect()
1018 VectorFst<Arc> C3; in TestIntersect()
1025 IntersectFst<Arc> I(C1, C2); in TestIntersect()
1027 UnionFst<Arc> U(S1, S2); in TestIntersect()
1028 VectorFst<Arc> C3; in TestIntersect()
1035 void TestOptimize(const Fst<Arc> &A) { in TestOptimize()
1038 DeterminizeFst<Arc> D(A); in TestOptimize()
1046 RmEpsilonFst<Arc> R(A); in TestOptimize()
1047 DeterminizeFst<Arc> D(R); in TestOptimize()
1048 VectorFst<Arc> M(D); in TestOptimize()
1057 VectorFst<Arc> R; in TestOptimize()
1060 DeterminizeFst<Arc> DR(R); in TestOptimize()
1061 VectorFst<Arc> RD; in TestOptimize()
1063 DeterminizeFst<Arc> DRD(RD); in TestOptimize()
1064 VectorFst<Arc> M(DRD); in TestOptimize()
1072 bool Equiv(const Fst<Arc> &fsa1, const Fst<Arc> &fsa2) { in Equiv()
1077 VectorFst<Arc> vfsa1(fsa1); in Equiv()
1078 VectorFst<Arc> vfsa2(fsa2); in Equiv()
1081 DeterminizeFst<Arc> dfa1(vfsa1); in Equiv()
1082 DeterminizeFst<Arc> dfa2(vfsa2); in Equiv()
1088 ILabelCompare<Arc> comp; in Equiv()
1089 VectorFst<Arc> sdfa1(dfa1); in Equiv()
1091 VectorFst<Arc> sdfa2(dfa2); in Equiv()
1094 DifferenceFst<Arc> dfsa1(sdfa1, sdfa2); in Equiv()
1095 DifferenceFst<Arc> dfsa2(sdfa2, sdfa1); in Equiv()
1097 VectorFst<Arc> ufsa(dfsa1); in Equiv()
1109 bool Subset(const Fst<Arc> &fsa1, const Fst<Arc> &fsa2) { in Subset()
1128 void Complement(const Fst<Arc> &ifsa, MutableFst<Arc> *ofsa) { in Complement()
1129 RmEpsilonFst<Arc> rfsa(ifsa); in Complement()
1130 DeterminizeFst<Arc> dfa(rfsa); in Complement()
1131 DifferenceFst<Arc> cfsa(univ_fsa_, dfa); in Complement()
1136 VectorFst<Arc> zero_fsa_;
1139 VectorFst<Arc> one_fsa_;
1142 VectorFst<Arc> univ_fsa_;
1152 template <class Arc, class WeightGenerator>
1155 typedef typename Arc::Label Label;
1156 typedef typename Arc::StateId StateId;
1157 typedef typename Arc::Weight Weight;
1169 univ_fst_.AddArc(0, Arc(i, i, Weight::One(), 0)); in AlgoTester()
1177 VectorFst<Arc> T1; in Test()
1178 VectorFst<Arc> T2; in Test()
1179 VectorFst<Arc> T3; in Test()
1183 WeightedTester<Arc, WeightGenerator> in Test()
1188 VectorFst<Arc> A1(T1); in Test()
1189 VectorFst<Arc> A2(T2); in Test()
1190 VectorFst<Arc> A3(T3); in Test()
1197 UnweightedTester<Arc> unweighted_tester(zero_fst_, one_fst_, univ_fst_); in Test()
1204 void RandFst(MutableFst<Arc> *fst) { in RandFst()
1228 Arc arc; in RandFst()
1269 VectorFst<Arc> zero_fst_;
1272 VectorFst<Arc> one_fst_;
1275 VectorFst<Arc> univ_fst_;
1278 RmWeightMapper<Arc> rm_weight_mapper;