
    |`%                     F   d Z ddlmZmZmZmZ dZdddddd	d
Zej                  Z	i dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,i d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNi dOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpi dqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddZ
i Ze
D ]  Ze
e   D ]  Zeee<   	  d Zd Zd Zi Zi Zd Zd Zy)z
This module provides functions and data to handle languages and articles
(in various languages) at the beginning of movie titles in a smart way.
    )absolute_importdivisionprint_functionunicode_literals).thelaadiederleell'ildaslesioeinundelosanunalaseinedenhetgliloosangoiazeenzha-dettazal-mgaun'unoettdemegyelseines   Ï   Çu   Ôïu   Ïé)r   r	   r   )r   r   r   r   r   r   r   r   r   r(   r)   )r   r   r   r   r   r   r   aldelunosunasr)   )r   r   r   r   r   unedesauduu   à lazde laaux)r	   asr   r    umunsumaumas )EnglishItalianSpanishFrench
PortugueseTurkishr@   )'Canada	SwazilandGhanaz	St. LuciaLiberiaJamaicaBahamaszNew ZealandLesothoKenyazSolomon IslandszUnited StateszSouth AfricazSt. Vincent and the GrenadinesFijiUKNigeria	AustraliaUSAzSt. Kitts and NevisBelizezSierra LeoneGambiaNamibia
MicronesiaKiribatiGrenadazAntigua and BarbudaBarbadosMaltaZimbabweIrelandUgandazTrinidad and TobagozSouth SudanGuyanaBotswanazUnited KingdomZambiarA   )Italyz
San MarinozVatican CityrB   )SpainMexico	ArgentinaBolivia	GuatemalaUruguayPeruCubazDominican RepublicPanamaz
Costa RicaEcuadorzEl SalvadorChilezEquatorial Guinearb   Colombia	Nicaragua	VenezuelaHondurasParaguayrC   )CameroonzBurkina FasoDominicaGabonMonacoFrancezCote d'IvoireBeninTogozCentral African RepublicMaliNigerzCongo, Republic ofGuineaz!Congo, Democratic Republic of the
LuxembourgHaitiChadBurundi
MadagascarComorosSenegalrD   )PortugalBrazilzSao Tome and Principez
Cape VerdeAngola
MozambiquezGuinea-BissauGerman)LiechtensteinAustriazWest GermanySwitzerlandzEast GermanyGermanyArabic)zSaudi ArabiaKuwaitJordanOmanYemenzUnited Arab Emirates
MauritaniaLebanonBahrainLibyazPalestinian State (proposed)QatarAlgeriaMoroccoIraqEgyptDjiboutiSudanSyriaTunisiarE   )Turkey
AzerbaijanSwahili)TanzaniaSwedish)Sweden	Icelandic)IcelandEstonian)EstoniaRomanian)RomaniaSamoan)Samoa	Slovenian)Sloveniaz	Tok Pisin)zPapua New GuineaPalauan)Palau
Macedonian)	MacedoniaHindi)IndiaDutch)NetherlandsBelgiumSurinameMarshallese)zMarshall IslandsKorean)zKorea, NorthzKorea, SouthzNorth KoreazSouth Korea
Vietnamese)VietnamDanish)DenmarkKhmer)CambodiaLao)LaosSomali)SomaliaFilipino)Philippines	Hungarian)Hungary	Ukrainian)UkraineBosnian)zBosnia and HerzegovinaGeorgian)Georgia
Lithuanian)	LithuaniaMalay)BruneiTetum)z
East Timor	Norwegian)NorwayArmenian)ArmeniaRussian)RussiaSlovak)SlovakiaThai)ThailandCroatian)CroatiaTurkmen)TurkmenistanNepali)NepalFinnish)FinlandUzbek)
UzbekistanAlbanian)AlbaniaKosovoHebrew)Israel	Bulgarian)BulgariaGreek)CyprusGreeceBurmese)MyanmarLatvian)LatviaSerbian)SerbiaAfar)EritreaCatalan)AndorraChinese)ChinaTaiwanCzech)zCzech RepublicCzechoslovakiaBislama)VanuatuJapanese)JapanKinyarwanda)RwandaAmharic)EthiopiaPersian)AfghanistanIranTajik)
Tajikistan	Mongolian)MongoliaDzongkha)BhutanUrdu)PakistanPolish)PolandSinhala)z	Sri Lankac                 \    t        | D cg c]  }|j                  d       c}      S c c}w )z<Convert a list of unicode articles to utf-8 encoded strings.utf8)tupleencode)articlesarts     2/usr/lib/python3/dist-packages/imdb/linguistics.pytoUTF8r     s$    9#**V$9::9s   )c                     t        |       }t        |D cg c]  }||f c}      t        | D cg c]  }||f c}      fS c c}w c c}w )zGiven a list of unicode encoded articles, build two dictionary (one
    utf-8 encoded and another one with unicode keys) for faster matches.)r  dict)r  utf8Articlesxs      r  toDictsr!     sG     (#L.A!Q./x6P!1v6P1QQQ.6Ps
   AA
c                     g }g }| D ]?  }|d   dvr|dz  }|j                  |j                  d             |j                  |       A ||fS )zFrom the given list of unicode articles, return two
    lists (one utf-8 encoded and another one in unicode) where a space
    is added at the end - if the last char is not ' or -.)'- r  )appendr  )r  _spArticles_spUnicodeArticlesarticles       r  addTrailingSpacer+     sf     K +2;j(sNG7>>&12!!'*	+
 ***    c                 l    | t         v r	t         |    S t        t        | t                    }|t         | <   |S )zuReturn dictionaries of articles specific for the given language, or the
    default one if the language is not known.)
_ART_CACHEr!  LANG_ARTICLESgetGENERIC_ARTICLES)langartDictss     r  articlesDictsForLangr3     s9     z$'.>?@HJtOr,  c                 l    | t         v r	t         |    S t        t        | t                    }|t         | <   |S )zReturn lists of articles (plus optional spaces) specific for the
    given language, or the default one if the language is not known.)_SP_ART_CACHEr+  r/  r0  )r1  
spArticless     r  spArticlesForLangr7     s:     }T""!"249I"JKJ$M$r,  N)__doc__
__future__r   r   r   r   r0  LANG_ARTICLESgetr/  LANG_COUNTRIESCOUNTRY_LANGr1  countryr  r!  r+  r.  r5  r3  r7  r?   r,  r  <module>r?     s  *
 S R4  "T aD	 !$$ _ _ 6_  _"  #_.  /_6  7_<  =_F 'G_H }I_J {K_L M_N O_P Q_R jS_T U_V &W_X zY_Z .[_\ Z]_^ 3__` (a_b Lc_d ,e_f lg_h ]i_j 
9k_l lm_n  o_p q_r s_t *u_v w_x .y_z [{_| _}_~ _@ A_B {C_D mE_F MG_H I_J  K_L jM_N |O_P _Q_R %S_T kU_V W_X !Y_Z |[_\ {]_^ {__` La_b |c_d "e_f 1g_h |i_j 
k_l ;m_n }o_p &q_r _s_t u_v w_x My_z k{_| ~}_D  %D!$' % $W%%
;
R+ 
r,  