§
    ¢”j­,  ã                   óÖ  — d Z ddlZddlZdZg d¢Zg d¢Zh d£Zdeded	dfd
„Zd.dede	d	efd„Z
ded	efd„Zded	efd„Zded	efd„Zded	efd„Zd/deded	efd„Zded	efd„Zded	efd„Zded	efd„Zded	efd„Zded	efd„Zded	efd„Z edd¦  «          ed d!¦  «          ed"d#¦  «          ed$d%¦  «          ed&d'¦  «          ed(d)¦  «          ed*d+¦  «          ed,d-¦  «         dS )0z¶
    inflection
    ~~~~~~~~~~~~

    A port of Ruby on Rails' inflector to Python.

    :copyright: (c) 2012-2020 by Janne Vanhala

    :license: MIT, see LICENSE for more details.
é    Nz0.5.0))z(?i)(quiz)$z\1zes)z(?i)^(oxen)$ú\1)z
(?i)^(ox)$z\1en)ú(?i)(m|l)ice$ú\1ice)z(?i)(m|l)ouse$r   )z(?i)(passer)s?by$z\1sby)z(?i)(matr|vert|ind)(?:ix|ex)$z\1ices)z(?i)(x|ch|ss|sh)$ú\1es)z(?i)([^aeiouy]|qu)y$z\1ies)z(?i)(hive)$z\1s)z(?i)([lr])f$ú\1ves)z(?i)([^f])fe$r   )z(?i)sis$Úses)ú(?i)([ti])a$ú\1a)z(?i)([ti])um$r
   )z(?i)(buffal|potat|tomat)o$z\1oes)z
(?i)(bu)s$z\1ses)z(?i)(alias|status)$r   )z(?i)(octop|vir)i$ú\1i)z(?i)(octop|vir)us$r   )z(?i)^(ax|test)is$r   )ú(?i)s$Ús)ú$r   )!)z(?i)(database)s$r   )z(?i)(quiz)zes$r   )z(?i)(matr)ices$z\1ix)z(?i)(vert|ind)ices$z\1ex)z(?i)(passer)sby$z\1by)z(?i)^(ox)enr   )z(?i)(alias|status)(es)?$r   )z(?i)(octop|vir)(us|i)$z\1us)z(?i)^(a)x[ie]s$z\1xis)z(?i)(cris|test)(is|es)$z\1is)z(?i)(shoe)s$r   )z
(?i)(o)es$r   )z(?i)(bus)(es)?$r   )r   z\1ouse)z(?i)(x|ch|ss|sh)es$r   )z(?i)(m)ovies$z\1ovie)z(?i)(s)eries$z\1eries)z(?i)([^aeiouy]|qu)ies$z\1y)z(?i)([lr])ves$z\1f)z(?i)(tive)s$r   )z(?i)(hive)s$r   )z(?i)([^f])ves$z\1fe)z(?i)(t)he(sis|ses)$z\1hesis)z(?i)(s)ynop(sis|ses)$z	\1ynopsis)z(?i)(p)rogno(sis|ses)$z
\1rognosis)z(?i)(p)arenthe(sis|ses)$z\1arenthesis)z(?i)(d)iagno(sis|ses)$z
\1iagnosis)z(?i)(b)a(sis|ses)$z\1asis)z(?i)(a)naly(sis|ses)$z	\1nalysis)r	   z\1um)z(?i)(n)ews$z\1ews)z	(?i)(ss)$r   )r   Ú >	   ÚfishÚriceÚjeansÚmoneyÚsheepÚseriesÚspeciesÚ	equipmentÚinformationÚsingularÚpluralÚreturnc                 ó2  — dt           dt           fd„}| d                              ¦   «         |d                              ¦   «         k    ràt                               dd                     | d         | dd…         ¦  «        d|dd…         z   f¦  «         t                               dd                     |d         |dd…         ¦  «        d|dd…         z   f¦  «         t
                               dd                     |d         |dd…         ¦  «        d| dd…         z   f¦  «         dS t                               dd	                     | d                              ¦   «          || dd…         ¦  «        ¦  «        |d                              ¦   «         |dd…         z   f¦  «         t                               dd	                     | d                              ¦   «          || dd…         ¦  «        ¦  «        |d                              ¦   «         |dd…         z   f¦  «         t                               dd	                     |d                              ¦   «          ||dd…         ¦  «        ¦  «        |d                              ¦   «         |dd…         z   f¦  «         t                               dd	                     |d                              ¦   «          ||dd…         ¦  «        ¦  «        |d                              ¦   «         |dd…         z   f¦  «         t
                               dd	                     |d                              ¦   «          ||dd…         ¦  «        ¦  «        | d                              ¦   «         | dd…         z   f¦  «         t
                               dd	                     |d                              ¦   «          ||dd…         ¦  «        ¦  «        | d                              ¦   «         | dd…         z   f¦  «         dS )
zÑ
    A convenience function to add appropriate rules to plurals and singular
    for irregular words.

    :param singular: irregular word in singular form
    :param plural: irregular word in plural form
    Ústringr   c                 ó@   — d                      d„ | D ¦   «         ¦  «        S )Nr   c              3   óP   K  — | ]!}d |z   |                      ¦   «         z   dz   V — Œ"dS )ú[ú]N)Úupper)Ú.0Úchars     úY/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/inflection.pyú	<genexpr>z6_irregular.<locals>.caseinsensitive.<locals>.<genexpr>d   s8   è è € ÐJÐJ¸4�s˜T‘z D§J¢J¡L¤LÑ0°3Ñ6ÐJÐJÐJÐJÐJÐJó    )Újoin)r   s    r%   Úcaseinsensitivez#_irregular.<locals>.caseinsensitivec   s#   € Ø�wŠwÐJÐJÀ6ÐJÑJÔJÑJÔJÐJr'   r   z(?i)({}){}$é   Nr   z{}{}$)Ústrr"   ÚPLURALSÚinsertÚformatÚ	SINGULARSÚlower)r   r   r)   s      r%   Ú
_irregularr1   [   sý  € ðK¥ð K­ð Kð Kð Kð Kð �„{×ÒÑÔ˜f QœiŸošoÑ/Ô/Ò/Ð/Ý�Š�qØ×!Ò! (¨1¤+¨x¸¸¸¬|Ñ<Ô<Ø�F˜1˜2˜2”JÑð
ñ 	ô 	ð 	õ 	�Š�qØ×!Ò! &¨¤)¨V°A°B°B¬ZÑ8Ô8Ø�F˜1˜2˜2”JÑð
ñ 	ô 	ð 	õ 	×Ò˜Ø×!Ò! &¨¤)¨V°A°B°B¬ZÑ8Ô8Ø�H˜Q˜R˜R”LÑ ð
ñ 	ô 	ð 	ð 	ð 	õ
 	�Š�qØ�OŠO˜H QœK×-Ò-Ñ/Ô/Ø+˜O¨H°Q°R°R¬LÑ9Ô9ñ;ô ;à�1ŒI�OŠOÑÔ  q r r¤
Ñ*ð
ñ 	ô 	ð 	õ
 	�Š�qØ�OŠO˜H QœK×-Ò-Ñ/Ô/Ø+˜O¨H°Q°R°R¬LÑ9Ô9ñ;ô ;à�1ŒI�OŠOÑÔ  q r r¤
Ñ*ð
ñ 	ô 	ð 	õ
 	�Š�qØ�OŠO˜F 1œIŸOšOÑ-Ô-¨¨¸vÀaÀbÀb¼zÑ/JÔ/JÑKÔKØ�1ŒI�OŠOÑÔ  q r r¤
Ñ*ð
ñ 	ô 	ð 	õ 	�Š�qØ�OŠO˜F 1œIŸOšOÑ-Ô-¨¨¸vÀaÀbÀb¼zÑ/JÔ/JÑKÔKØ�1ŒI�OŠOÑÔ  q r r¤
Ñ*ð
ñ 	ô 	ð 	õ 	×Ò˜Ø�OŠO˜F 1œIŸOšOÑ-Ô-¨¨¸vÀaÀbÀb¼zÑ/JÔ/JÑKÔKØ�QŒK×ÒÑÔ (¨1¨2¨2¤,Ñ.ð
ñ 	ô 	ð 	õ 	×Ò˜Ø�OŠO˜F 1œIŸOšOÑ-Ô-¨¨¸vÀaÀbÀb¼zÑ/JÔ/JÑKÔKØ�QŒK×ÒÑÔ (¨1¨2¨2¤,Ñ.ð
ñ 	ô 	ð 	ð 	ð 	r'   Tr   Úuppercase_first_letterc                 ó˜   — |rt          j        dd„ | ¦  «        S | d                              ¦   «         t          | ¦  «        dd…         z   S )aC  
    Convert strings to CamelCase.

    Examples::

        >>> camelize("device_type")
        'DeviceType'
        >>> camelize("device_type", False)
        'deviceType'

    :func:`camelize` can be thought of as a inverse of :func:`underscore`,
    although there are some cases where that does not hold::

        >>> camelize(underscore("IOError"))
        'IoError'

    :param uppercase_first_letter: if set to `True` :func:`camelize` converts
        strings to UpperCamelCase. If set to `False` :func:`camelize` produces
        lowerCamelCase. Defaults to `True`.
    z
(?:^|_)(.)c                 óP   — |                       d¦  «                             ¦   «         S ©Nr*   ©Úgroupr"   ©Úms    r%   ú<lambda>zcamelize.<locals>.<lambda>¦   ó   € ¨q¯wªw°q©z¬z×/?Ò/?Ñ/AÔ/A€ r'   r   r*   N)ÚreÚsubr0   Úcamelize)r   r2   s     r%   r>   r>   �   sN   € ð* ð 8ÝŒv�mÐ%AÐ%AÀ6ÑJÔJÐJà�aŒy�ŠÑ Ô ¥8¨FÑ#3Ô#3°A°B°BÔ#7Ñ7Ð7r'   Úwordc                 ó.   — |                       dd¦  «        S )z{Replace underscores with dashes in the string.

    Example::

        >>> dasherize("puni_puni")
        'puni-puni'

    Ú_ú-)Úreplace©r?   s    r%   Ú	dasherizerE   «   s   € ð �<Š<˜˜SÑ!Ô!Ð!r'   c                 óº   — t          j        dd| ¦  «        } |                      dd¦  «        } t          j        dd„ | ¦  «        } t          j        dd„ | ¦  «        } | S )	a<  
    Capitalize the first word and turn underscores into spaces and strip a
    trailing ``"_id"``, if any. Like :func:`titleize`, this is meant for
    creating pretty output.

    Examples::

        >>> humanize("employee_salary")
        'Employee salary'
        >>> humanize("author_id")
        'Author'

    z_id$r   rA   ú z(?i)([a-z\d]*)c                 óP   — |                       d¦  «                             ¦   «         S r5   )r7   r0   r8   s    r%   r:   zhumanize.<locals>.<lambda>Ç   r;   r'   z^\wc                 óP   — |                       d¦  «                             ¦   «         S )Nr   r6   r8   s    r%   r:   zhumanize.<locals>.<lambda>È   s   €  A§G¢G¨A¡J¤J×$4Ò$4Ñ$6Ô$6€ r'   )r<   r=   rC   rD   s    r%   ÚhumanizerJ   ·   s^   € õ Œ6�'˜2˜tÑ$Ô$€DØ�<Š<˜˜SÑ!Ô!€DÝŒ6Ð#Ð%AÐ%AÀ4ÑHÔH€DÝŒ6�&Ð6Ð6¸Ñ=Ô=€DØ€Kr'   Únumberc                 ó†   — t          t          | ¦  «        ¦  «        } | dz  dv rdS ddddœ                     | dz  d¦  «        S )	a€  
    Return the suffix that should be added to a number to denote the position
    in an ordered sequence such as 1st, 2nd, 3rd, 4th.

    Examples::

        >>> ordinal(1)
        'st'
        >>> ordinal(2)
        'nd'
        >>> ordinal(1002)
        'nd'
        >>> ordinal(1003)
        'rd'
        >>> ordinal(-11)
        'th'
        >>> ordinal(-1021)
        'st'

    éd   )é   é   é   ÚthÚstÚndÚrd)r*   é   é   é
   )ÚabsÚintÚget©rK   s    r%   Úordinalr\   Ì   sZ   € õ* •�V‘”ÑÔ€FØ��|�|Ð#Ð#Øˆtð ØØð
ð 
÷ Š#ˆf�r‰k˜4Ñ
 Ô
 ð		!r'   c                 óH   — d                      | t          | ¦  «        ¦  «        S )a›  
    Turn a number into an ordinal string used to denote the position in an
    ordered sequence such as 1st, 2nd, 3rd, 4th.

    Examples::

        >>> ordinalize(1)
        '1st'
        >>> ordinalize(2)
        '2nd'
        >>> ordinalize(1002)
        '1002nd'
        >>> ordinalize(1003)
        '1003rd'
        >>> ordinalize(-11)
        '-11th'
        >>> ordinalize(-1021)
        '-1021st'

    z{}{})r.   r\   r[   s    r%   Ú
ordinalizer^   ì   s   € ð* �=Š=˜¥¨¡¤Ñ1Ô1Ð1r'   rB   Ú	separatorc                 ó&  — t          | ¦  «        } t          j        d|| ¦  «        } |rWt          j        |¦  «        }t          j        d|z  || ¦  «        } t          j        d                     |¬¦  «        d| ¦  «        } |                      ¦   «         S )z½
    Replace special characters in a string so that it may be used as part of a
    'pretty' URL.

    Example::

        >>> parameterize(u"Donald E. Knuth")
        'donald-e-knuth'

    z(?i)[^a-z0-9\-_]+z%s{2,}z(?i)^{sep}|{sep}$)Úsepr   )Útransliterater<   r=   Úescaper.   r0   )r   r_   Úre_seps      r%   Úparameterizere     sˆ   € õ ˜6Ñ"Ô"€FåŒVÐ(¨)°VÑ<Ô<€FØð MÝ”˜9Ñ%Ô%ˆå”˜	 FÑ*¨I°vÑ>Ô>ˆå”Ð,×3Ò3¸Ð3Ñ?Ô?ÀÀVÑLÔLˆà�<Š<‰>Œ>Ðr'   c                 ó¸   — | r|                       ¦   «         t          v r| S t          D ]2\  }}t          j        || ¦  «        rt          j        ||| ¦  «        c S Œ3| S )a	  
    Return the plural form of a word.

    Examples::

        >>> pluralize("posts")
        'posts'
        >>> pluralize("octopus")
        'octopi'
        >>> pluralize("sheep")
        'sheep'
        >>> pluralize("CamelOctopus")
        'CamelOctopi'

    )r0   ÚUNCOUNTABLESr,   r<   Úsearchr=   )r?   ÚruleÚreplacements      r%   Ú	pluralizerk     so   € ð  ð �4—:’:‘<”<¥<Ð/Ð/Øˆå!(ð 	7ð 	7ÑˆD�+ÝŒy˜˜tÑ$Ô$ð 7Ý”v˜d K°Ñ6Ô6Ð6Ð6Ð6ð7àˆr'   c                 óÆ   — t           D ]}t          j        d|z  | ¦  «        r| c S Œt          D ]2\  }}t          j        || ¦  «        rt          j        ||| ¦  «        c S Œ3| S )ac  
    Return the singular form of a word, the reverse of :func:`pluralize`.

    Examples::

        >>> singularize("posts")
        'post'
        >>> singularize("octopi")
        'octopus'
        >>> singularize("sheep")
        'sheep'
        >>> singularize("word")
        'word'
        >>> singularize("CamelOctopi")
        'CamelOctopus'

    z(?i)\b(%s)\Z)rg   r<   rh   r/   r=   )r?   Ú
inflectionri   rj   s       r%   Úsingularizern   5  sˆ   € õ$ #ð ð ˆ
ÝŒ9�_ zÑ1°4Ñ8Ô8ð 	ØˆKˆKˆKð	õ 'ð 3ð 3ÑˆˆkÝŒ9�T˜4Ñ Ô ð 	3Ý”6˜$ ¨TÑ2Ô2Ð2Ð2Ð2ð	3à€Kr'   c                 ó:   — t          t          | ¦  «        ¦  «        S )as  
    Create the name of a table like Rails does for models to table names. This
    method uses the :func:`pluralize` method on the last word in the string.

    Examples::

        >>> tableize('RawScaledScorer')
        'raw_scaled_scorers'
        >>> tableize('egg_and_ham')
        'egg_and_hams'
        >>> tableize('fancyCategory')
        'fancy_categories'
    )rk   Ú
underscorerD   s    r%   Útableizerq   Q  s   € õ •Z Ñ%Ô%Ñ&Ô&Ð&r'   c           	      óˆ   — t          j        dd„ t          t          | ¦  «        ¦  «                             ¦   «         ¦  «        S )aé  
    Capitalize all the words and replace some characters in the string to
    create a nicer looking title. :func:`titleize` is meant for creating pretty
    output.

    Examples::

      >>> titleize("man from the boondocks")
      'Man From The Boondocks'
      >>> titleize("x-men: the last stand")
      'X Men: The Last Stand'
      >>> titleize("TheManWithoutAPast")
      'The Man Without A Past'
      >>> titleize("raiders_of_the_lost_ark")
      'Raiders Of The Lost Ark'

    z\b('?\w)c                 óP   — |                       d¦  «                             ¦   «         S r5   )r7   Ú
capitalize)Úmatchs    r%   r:   ztitleize.<locals>.<lambda>v  s   € �e—k’k !‘n”n×/Ò/Ñ1Ô1€ r'   )r<   r=   rJ   rp   ÚtitlerD   s    r%   Útitleizerw   b  s@   € õ$ Œ6ØØ1Ð1Ý•˜DÑ!Ô!Ñ"Ô"×(Ò(Ñ*Ô*ñô ð r'   c                 ó~   — t          j        d| ¦  «        }|                     dd¦  «                             d¦  «        S )u5  
    Replace non-ASCII characters with an ASCII approximation. If no
    approximation exists, the non-ASCII character is ignored. The string must
    be ``unicode``.

    Examples::

        >>> transliterate('Ã¤lÃ¤mÃ¶lÃ¶')
        'alamolo'
        >>> transliterate('Ã†rÃ¸skÃ¸bing')
        'rskbing'

    ÚNFKDÚasciiÚignore)ÚunicodedataÚ	normalizeÚencodeÚdecode)r   Ú
normalizeds     r%   rb   rb   {  s:   € õ Ô& v¨vÑ6Ô6€JØ×Ò˜W hÑ/Ô/×6Ò6°wÑ?Ô?Ð?r'   c                 ó®   — t          j        dd| ¦  «        } t          j        dd| ¦  «        } |                      dd¦  «        } |                      ¦   «         S )aq  
    Make an underscored, lowercase form from the expression in the string.

    Example::

        >>> underscore("DeviceType")
        'device_type'

    As a rule of thumb you can think of :func:`underscore` as the inverse of
    :func:`camelize`, though there are cases where that does not hold::

        >>> camelize(underscore("IOError"))
        'IoError'

    z([A-Z]+)([A-Z][a-z])z\1_\2z([a-z\d])([A-Z])rB   rA   )r<   r=   rC   r0   rD   s    r%   rp   rp   �  sM   € õ  Œ6Ð)¨8°TÑ:Ô:€DÝŒ6Ð% x°Ñ6Ô6€DØ�<Š<˜˜SÑ!Ô!€DØ�:Š:‰<Œ<Ðr'   ÚpersonÚpeopleÚmanÚmenÚhumanÚhumansÚchildÚchildrenÚsexÚsexesÚmoveÚmovesÚcowÚkineÚzombieÚzombies)T)rB   )Ú__doc__r<   r|   Ú__version__r,   r/   rg   r+   r1   Úboolr>   rE   rJ   rY   r\   r^   re   rk   rn   rq   rw   rb   rp   © r'   r%   ú<module>r–      sØ  ðð	ð 	ð 
€	€	€	Ø Ð Ð Ð à€ðð ð €ð4"ð "ð "€	ðH	ð 	ð 	€ð2˜ð 2 cð 2¨dð 2ð 2ð 2ð 2ðj8ð 8�Sð 8°$ð 8À#ð 8ð 8ð 8ð 8ð6	"�Cð 	"˜Cð 	"ð 	"ð 	"ð 	"ð�3ð ˜3ð ð ð ð ð*!�Cð !˜Cð !ð !ð !ð !ð@2�sð 2˜sð 2ð 2ð 2ð 2ð0ð ˜ð ¨ð °sð ð ð ð ð0�Cð ˜Cð ð ð ð ð2�cð ˜cð ð ð ð ð8'�3ð '˜3ð 'ð 'ð 'ð 'ð"�3ð ˜3ð ð ð ð ð2@˜#ð @ #ð @ð @ð @ð @ð$�Sð ˜Sð ð ð ð ð, €
ˆ8�XÑ Ô Ð Ø 
€
ˆ5�%Ñ Ô Ð Ø 
€
ˆ7�HÑ Ô Ð Ø 
€
ˆ7�JÑ Ô Ð Ø 
€
ˆ5�'Ñ Ô Ð Ø 
€
ˆ6�7Ñ Ô Ð Ø 
€
ˆ5�&Ñ Ô Ð Ø 
€
ˆ8�YÑ Ô Ð Ð Ð r'   