def load_speaker(corpus, path):
        """
        Create a speaker instance for the given path.
        """
        base_path, speaker_name = os.path.split(path)
        base_path, gender_desc = os.path.split(base_path)
        base_path, __ = os.path.split(base_path)
        base_path, tag = os.path.split(base_path)

        gender = issuers.Gender.UNKNOWN

        if gender_desc == 'male':
            gender = issuers.Gender.MALE
        elif gender_desc == 'female':
            gender = issuers.Gender.FEMALE

        speaker = issuers.Speaker(speaker_name, gender=gender)
        corpus.import_issuers(speaker)

        return speaker
def load_speaker ( corpus , path ) : base_path , speaker_name = os . path . split ( path ) base_path , gender_desc = os . path . split ( base_path ) base_path , __ = os . path . split ( base_path ) base_path , tag = os . path . split ( base_path ) gender = issuers . Gender . UNKNOWN if gender_desc == 'male' : gender = issuers . Gender . MALE elif gender_desc == 'female' : gender = issuers . Gender . FEMALE speaker = issuers . Speaker ( speaker_name , gender = gender ) corpus . import_issuers ( speaker ) return speaker
Create a speaker instance for the given path.