ó
    -Vði   ã                   óš   • S SK r S SKrS SKJr  S SKJrJrJrJr  S SK	J
r
  S SKJr  SSS.r1 S	krS
\\   S\S\\   4S jr " S S\
5      rg)é    N)ÚPath)ÚIterableÚListÚTupleÚUnion)ÚDataset)Údownload_url_to_fileÚ@209a8b4cd265013e96f4658632a9878103b0c5abf62b50d4ef3ae1be226b29e4Ú@408ccaae803641c6d7b626b6299949320c2dbca96b2220fd3fb17887b023b027)úBhttp://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7búJhttp://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b.symbols>8   ú.DOTú+PLUSú-DASHú"QUOTEú'QUOTEú(PARENú)PARENú,COMMAú--DASHú.POINTú/SLASHú:COLONú{BRACEú(PARENSú)PARENSú-HYPHENú.PERIODú"UNQUOTEú%PERCENTú.DECIMALú
"END-QUOTEú
"IN-QUOTESú
#HASH-MARKú
&AMPERSANDú
'END-QUOTEú
)END-PARENú
.FULL-STOPú#POUND-SIGNú#SHARP-SIGNú(LEFT-PARENú)END-PARENSú...ELLIPSISú;SEMI-COLONú{LEFT-BRACEú{OPEN-BRACEú"CLOSE-QUOTEú'INNER-QUOTEú(PARENTHESESú)CLOSE-PARENú)RIGHT-PARENú}CLOSE-BRACEú}RIGHT-BRACEú"DOUBLE-QUOTEú"END-OF-QUOTEú'SINGLE-QUOTEú(BEGIN-PARENSú)END-THE-PARENú;SEMI-COLON(1)ú?QUESTION-MARKú(IN-PARENTHESESú)UN-PARENTHESESú'END-INNER-QUOTEú)END-PARENTHESESú(OPEN-PARENTHESESú!EXCLAMATION-POINTú)CLOSE-PARENTHESESÚlinesÚexclude_punctuationsÚreturnc                 óÒ  • [         R                  " S5      n/ nU  HÈ  nU(       a  UR                  S5      (       a  M"  UR                  5       R	                  S5      u  pVU[
        ;   a@  U(       a  MV  UR                  S5      (       a  SnOUR                  S5      (       a  SnOUS   n[         R                  " USU5      nUR	                  S5      nUR                  XV45        MÊ     U$ )	Nz
\([0-9]+\)z;;;z  z...z--r   Ú Ú )ÚreÚcompileÚ
startswithÚstripÚsplitÚ_PUNCTUATIONSÚsubÚappend)rF   rG   Ú_alt_reÚcmudictÚlineÚwordÚphoness          Ú`D:\a\ltx-desktop-ci\ltx-desktop-ci\python-embed\Lib\site-packages\torchaudio\datasets\cmudict.pyÚ_parse_dictionaryrZ   J   sÃ   € Ü�jŠj˜Ó'€GØ+-€GÛˆÞ�t—‘ u×-Ñ-Ùà—z‘z“|×)Ñ)¨$Ó/‰ˆØ”=Ó Þ#Ùð �‰˜u×%Ñ%Ø‘Ø—‘ ×&Ñ&Ø‘à˜A‘w�ô
 �vŠv�g˜r 4Ó(ˆØ—‘˜cÓ"ˆØ�‰˜�~Ö&ñ/ ð2 €Nó    c                   ó¤   • \ rS rSrSr SSSSS.S\\\4   S\S	\S
\S\SS4S jjjr	S\
S\\\\   4   4S jrS\
4S jr\S\\   4S j5       rSrg)ÚCMUDictéi   a"  *CMU Pronouncing Dictionary* :cite:`cmudict` (CMUDict) dataset.

Args:
    root (str or Path): Path to the directory where the dataset is found or downloaded.
    exclude_punctuations (bool, optional):
        When enabled, exclude the pronounciation of punctuations, such as
        `!EXCLAMATION-POINT` and `#HASH-MARK`.
    download (bool, optional):
        Whether to download the dataset if it is not found at root path. (default: ``False``).
    url (str, optional):
        The URL to download the dictionary from.
        (default: ``"http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b"``)
    url_symbols (str, optional):
        The URL to download the list of symbols from.
        (default: ``"http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b.symbols"``)
Fr   r   )ÚdownloadÚurlÚurl_symbolsÚrootrG   r_   r`   ra   rH   Nc                ó  • X l         [        U5      U l        [        R                  R                  U R                  5      (       d  [        SU 35      eU R                  [        R                  R                  U5      -  nU R                  [        R                  R                  U5      -  n[        R                  R                  U5      (       d7  U(       d  [        SU 35      e[        R                  US 5      n[        XFU5        [        R                  R                  U5      (       d7  U(       d  [        SU 35      e[        R                  US 5      n[        XWU5        [        US5       n	U	R                  5        V
s/ s H  oªR                  5       PM     sn
U l        S S S 5        [        USSS9 n	[!        U	R                  5       U R                   S9U l        S S S 5        g s  sn
f ! , (       d  f       NO= f! , (       d  f       g = f)Nz#The root directory does not exist; z`The dictionary file is not found in the following location. Set `download=True` to download it. z\The symbol file is not found in the following location. Set `download=True` to download it. Úrzlatin-1)Úencoding)rG   )rG   r   Ú
_root_pathÚosÚpathÚisdirÚRuntimeErrorÚbasenameÚexistsÚ
_CHECKSUMSÚgetr	   ÚopenÚ	readlinesrO   Ú_symbolsrZ   Ú_dictionary)Úselfrb   rG   r_   r`   ra   Ú	dict_fileÚsymbol_fileÚchecksumÚtextrV   s              rY   Ú__init__ÚCMUDict.__init__{   s˜  € ð %9Ô!ä˜t›*ˆŒÜ�w‰w�}‰}˜TŸ_™_×-Ñ-ÜÐ!DÀTÀFÐKÓLÐLà—O‘O¤b§g¡g×&6Ñ&6°sÓ&;Ñ;ˆ	Ø—o‘o¬¯©×(8Ñ(8¸Ó(EÑEˆÜ�w‰w�~‰~˜i×(Ñ(ÞÜ"ð;Ø;D¸+ðGóð ô "—~‘~ c¨4Ó0ˆHÜ  °Ô:Ü�w‰w�~‰~˜k×*Ñ*ÞÜ"ð;Ø;F¸-ðIóð ô "—~‘~ k°4Ó8ˆHÜ  ¸8ÔDä�+˜sÔ# tØ6:·n±nÔ6FÓGÒ6F¨dŸZ™Zž\Ñ6FÑGˆDŒM÷ $ô �)˜S¨9Ò5¸Ü0°·±Ó1AÐX\×XqÑXqÑrˆDÔ÷ 6Ð5ùò H÷ $Õ#ú÷ 6Õ5ús*   Å-G*Æ G%ÆG*Æ4(G;Ç%G*Ç*
G8Ç;
H	Únc                 ó    • U R                   U   $ )zÇLoad the n-th sample from the dataset.

Args:
    n (int): The index of the sample to be loaded.

Returns:
    Tuple of a word and its phonemes

    str:
        Word
    List[str]:
        Phonemes
)rr   )rs   rz   s     rY   Ú__getitem__ÚCMUDict.__getitem__¤   s   € ð ×Ñ Ñ"Ð"r[   c                 ó,   • [        U R                  5      $ )N)Úlenrr   ©rs   s    rY   Ú__len__ÚCMUDict.__len__´   s   € Ü�4×#Ñ#Ó$Ð$r[   c                 ó6   • U R                   R                  5       $ )zLlist[str]: A list of phonemes symbols, such as ``"AA"``, ``"AE"``, ``"AH"``.)rq   Úcopyr€   s    rY   ÚsymbolsÚCMUDict.symbols·   s   € ð �}‰}×!Ñ!Ó#Ð#r[   )rr   rf   rq   rG   )T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ústrr   Úboolrx   Úintr   r   r|   r�   Úpropertyr…   Ú__static_attributes__© r[   rY   r]   r]   i   s¸   † ñð( &*ð'sð
 ØWØgò'sà�C˜�IÑð'sð #ð'sð
 ð'sð ð'sð ð'sð 
ö'sðR#˜Sð # U¨3°°S±	¨>Ñ%:ô #ð %˜ô %ð ð$˜˜c™ó $ó ó$r[   r]   )rg   rL   Úpathlibr   Útypingr   r   r   r   Útorch.utils.datar   Útorchaudio._internalr	   rm   rQ   rŒ   r�   rZ   r]   r‘   r[   rY   Ú<module>r–      sh   ðÛ 	Û 	Ý ß /Ó /å $Ý 5ð KMð SUñ€
ò9€ðx˜X c™]ð À$ð È4ÐPSÉ9ô ô>Q$ˆgõ Q$r[   