Beispiel #1
0
        public virtual ArrayList phoneticize(ArrayList entry, int nbest)
        {
            Fst      fst      = this.entryToFSA(entry);
            Semiring semiring = fst.getSemiring();

            Compose.augment(1, fst, semiring);
            ArcSort.apply(fst, new OLabelCompare());
            Fst fst2 = Compose.compose(fst, this.epsilonFilter, semiring, true);

            ArcSort.apply(fst2, new OLabelCompare());
            fst2 = Compose.compose(fst2, this.g2pmodel, semiring, true);
            Project.apply(fst2, ProjectType.__OUTPUT);
            if (nbest == 1)
            {
                fst2 = NShortestPaths.get(fst2, 1, false);
            }
            else
            {
                fst2 = NShortestPaths.get(fst2, nbest * 10, false);
            }
            fst2 = RmEpsilon.get(fst2);
            return(this.findAllPaths(fst2, nbest, this.skipSeqs, this.tie));
        }