@Test public void testArcSort() { // Input label sort test Fst fst1 = createUnsorted(); Fst fst2 = createIsorted(); assertThat(fst1, not(equalTo(fst2))); apply(fst1, new ILabelCompare()); assertThat(fst1, equalTo(fst2)); // Output label sort test fst1 = createUnsorted(); fst2 = createOsorted(); assertThat(fst1, not(equalTo(fst2))); apply(fst1, new OLabelCompare()); assertThat(fst1, equalTo(fst2)); }
Semiring s = efst.getSemiring(); Compose.augment(1, efst, s); ArcSort.apply(efst, new OLabelCompare()); Fst result = Compose.compose(efst, epsilonFilter, s, true); ArcSort.apply(result, new OLabelCompare()); result = Compose.compose(result, g2pmodel, s, true); Project.apply(result, ProjectType.OUTPUT);
Semiring s = efst.getSemiring(); Compose.augment(1, efst, s); ArcSort.apply(efst, new OLabelCompare()); Fst result = Compose.compose(efst, epsilonFilter, s, true); ArcSort.apply(result, new OLabelCompare()); result = Compose.compose(result, g2pmodel, s, true); Project.apply(result, ProjectType.OUTPUT);