+
    ÖÇÜhÁ  ã                   óX   € R t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	  ! R R]4      t
R# )av  
An NLTK interface for the n-gram statistics gathered from
the corpora for each language using An Crubadan.

There are multiple potential applications for the data but
this reader was created with the goal of using it in the
context of language identification.

For details about An Crubadan, this data, and its potential uses, see:
http://borel.slu.edu/crubadan/index.html
N)Úpath)ÚCorpusReader)ÚZipFilePathPointer)ÚFreqDistc                   óf   a a€ ] tR t^t oRtRt/ tRV 3R lltR tR t	R t
R tR tR	 tR
tVtV ;t# )ÚCrubadanCorpusReaderzC
A corpus reader used to access language An Crubadan n-gram files.
z	table.txtc                óX   <€ \         SV `  WR R7       . V n        V P                  4        R# )Úutf8©ÚencodingN)ÚsuperÚ__init__Ú_lang_mapping_dataÚ_load_lang_mapping_data)ÚselfÚrootÚfileidsr   ÚtagsetÚ	__class__s   &&&&&€Ú=/usr/lib/python3/dist-packages/nltk/corpus/reader/crubadan.pyr   ÚCrubadanCorpusReader.__init__%   s)   ø€ Ü‰Ñ˜°ÐÔ8Ø"$ˆÔØ×$Ñ$Ö&ó    c                ó„   € WP                   9  d   V P                  V4      V P                   V&   V P                   V,          # )zLReturn n-gram FreqDist for a specific language
given ISO 639-3 language code)Ú_all_lang_freqÚ_load_lang_ngrams)r   Úlangs   &&r   Ú	lang_freqÚCrubadanCorpusReader.lang_freq*   s<   € ð ×*Ñ*Ô*Ø(,×(>Ñ(>¸tÓ(DˆD×Ñ Ñ%à×"Ñ" 4Õ(Ð(r   c                óP   € V P                    Uu. uF  q^,          NK  	  up# u upi )z7Return a list of supported languages as ISO 639-3 codes©r   )r   Úrows   & r   ÚlangsÚCrubadanCorpusReader.langs3   s&   € à"&×"9Ò"9Ó:Ñ"9˜3�A—�Ñ"9Ñ:Ð:ùÒ:s   �#c                ó–   € V P                    F8  pV^,          P                  4       VP                  4       8X  g   K/  V^ ,          u # 	  R# )z5Return internal Crubadan code based on ISO 639-3 codeN©r   Úlower©r   r   Úis   && r   Úiso_to_crubadanÚ$CrubadanCorpusReader.iso_to_crubadan7   ó3   € à×(Ô(ˆAØ��t�z‰z‹|˜tŸz™z›|Ö+Ø˜•t’ó )r   c                ó–   € V P                    F8  pV^ ,          P                  4       VP                  4       8X  g   K/  V^,          u # 	  R# )z2Return ISO 639-3 code given internal Crubadan codeNr$   r&   s   && r   Úcrubadan_to_isoÚ$CrubadanCorpusReader.crubadan_to_iso=   r*   r   c                ó&  € \        V P                  \        4      '       d   \        R4      h\        P
                  ! V P                  V P                  4      pV P                  V P                  4       9  d   \        RV,           4      h\        VRR7      ;_uu_ 4       pVP                  4       P                  4       pVP                  R4       Uu. uF  qDP                  R4      NK  	  upV n        RRR4       R# u upi   + '       g   i     R# ; i)zCLoad language mappings between codes and description from table.txtz?Please install the 'crubadan' corpus first, use nltk.download()z%Could not find language mapper file: úutf-8r
   Ú
Ú	N)Ú
isinstancer   r   ÚRuntimeErrorr   ÚjoinÚ_LANG_MAPPER_FILEr   ÚopenÚreadÚstripÚsplitr   )r   Úmapper_fileÚrawÚ	strip_rawr    s   &    r   r   Ú,CrubadanCorpusReader._load_lang_mapping_dataC   sË   € ä�d—i‘iÔ!3×4Ò4ÜØQóð ô —i’i §	¡	¨4×+AÑ+AÓBˆØ×!Ñ!¨¯©«Ô7ÜÐFÈÕTÓUÐUä�+¨×0Õ0°CØŸ™›
×(Ñ(Ó*ˆIàBKÇ/Á/ÐRVÔBWÓ&XÑBW¸3§y¡y°¦ÑBWÑ&XˆDÔ#÷ 1Ñ0ùò 'Y÷ 1×0Ð0ús   Â2C?ÃC:Ã(C?Ã:C?Ã?D	c                ó  € WP                  4       9  d   \        R4      hV P                  V4      p\        P                  ! V P
                  VR,           4      p\        P                  ! V4      '       g   \        R4      h\        4       p\        VRR7      ;_uu_ 4       pV FB  pVP                  R4      pV^,          P                  R4      p\        V^ ,          4      p	W”V&   KD  	  RRR4       V#   + '       g   i     T# ; i)	zZLoad single n-gram language file given the ISO 639-3 language code
and return its FreqDistzUnsupported language.z-3grams.txtz,No N-gram file found for requested language.r/   r
   Ú r0   N)r!   r3   r(   r   r4   r   Úisfiler   r6   r9   r8   Úint)
r   r   Úcrubadan_codeÚ
ngram_fileÚcountsÚfÚlineÚdataÚngramÚfreqs
   &&        r   r   Ú&CrubadanCorpusReader._load_lang_ngramsS   sÏ   € ð —z‘z“|Ô#ÜÐ6Ó7Ð7à×,Ñ,¨TÓ2ˆÜ—Y’Y˜tŸy™y¨-¸-Õ*GÓHˆ
ä�{Š{˜:×&Ò&ÜÐMÓNÐNä“ˆÜ�* w×/Õ/°1Û�Ø—z‘z #“�à˜Q�Ÿ™ dÓ+�Ü˜4 �7“|�à $�u“ñ ÷ 0ð ˆ÷ 0Ö/ð ˆús   ÂA	C2Ã2D	r   )r	   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r5   r   r   r   r!   r(   r,   r   r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   Ú__classdict__s   @@r   r   r      s@   ù‡ € ñð $ÐØ€N÷'ò
)ò;òòòY÷ ò r   r   )rO   ÚreÚosr   Únltk.corpus.readerr   Ú	nltk.datar   Únltk.probabilityr   r   © r   r   Ú<module>rZ      s)   ðñ
ó 
Ý å +Ý (Ý %ôM˜<ö Mr   