示例#1
0
    def __init__(self, model):
        """

        """
        self._aligner = aligners.instantiate(model,"julius")
        self._aligner.set_infersp(False)
        self._aligner.set_outext("walign")

        # Map phoneme names from  SAMPA model-specific
        mappingfilename = os.path.join( model, "monophones.repl")
        if os.path.isfile( mappingfilename ):
            try:
                self._mapping = Mapping( mappingfilename )
            except Exception:
                self._mapping = Mapping()
        else:
            self._mapping = Mapping()

        self._alignerio  = AlignerIO()
        self._spkrate    = SpeakerRate()
        self._radius = 0.005

        self.N = 5     # initial N-gram to search the anchors
        self.NMIN = 3  # minimum N-gram to search the anchors
        self.W = 6.    # initial windows delay to search the anchors
        self.WMIN = 3. # minimum windows delay to search the anchors
        self.NBT = 12  # maximum number of tokens for chunks (and holes)
        self.ANCHORS = True   # Append anchors into the result
        self.SILENCES = False # Search automatically silences before anchors
示例#2
0
 def test_instantiate(self):
     aligner = aligners.instantiate(None,"basic")
     self.assertTrue(isinstance(aligner, basicalign.BasicAligner))