§
    ¡”jW&  ã                   óD  — d Z ddlZddlmZ ddlmZ dxZZdZi Z	 ej
        d¦  «        j        Z ej
        d¦  «        j        Zd	Zi Z	  ej        d
¦  «        Zn# e$ r  ee¦  «        j        dz  ZY nw xY w ee                     ¦   «         ¦  «        D ]EZej        dk    r8ej        dd…         Zeee<   e                     d¦  «        d         Zeevreee<   ŒFd„ eD ¦   «         Zd„ Z G d„ d¦  «        Z G d„ de ¦  «        Z! G d„ d¦  «        Z" G d„ d¦  «        Z#dS )zY

Pyphen
======

Pure Python module to hyphenate text, inspired by Ruby's Text::Hyphen.

é    N)Ú	resources)ÚPathz0.17.2)Ú	LANGUAGESÚPyphenÚlanguage_fallbackz\^{2}([0-9a-f]{2})z
(\d?)(\D?))ú%ú#ÚLEFTHYPHENMINÚRIGHTHYPHENMINÚCOMPOUNDLEFTHYPHENMINÚCOMPOUNDRIGHTHYPHENMINzpyphen.dictionariesÚdictionariesz.dicé   éüÿÿÿÚ_c                 ó8   — i | ]}|                      ¦   «         |“ŒS © )Úlower)Ú.0Únames     ú^/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/pyphen/__init__.pyú
<dictcomp>r   ,   s"   € Ð@Ð@Ð@¨d�t—z’z‘|”| TÐ@Ð@Ð@ó    c                 ó  — |                       dd¦  «                             ¦   «                              d¦  «        }|rCd                     |¦  «        } | t          v rt          |          S |                     ¦   «          |°AdS dS )a	  Get a fallback language available in our dictionaries.

    http://www.unicode.org/reports/tr35/#Locale_Inheritance

    We use the normal truncation inheritance. This function needs aliases
    including scripts for languages with multiple regions available.

    ú-r   N)Úreplacer   ÚsplitÚjoinÚLANGUAGES_LOWERCASEÚpop)ÚlanguageÚpartss     r   r   r   /   sŒ   € ð ×Ò˜S #Ñ&Ô&×,Ò,Ñ.Ô.×4Ò4°SÑ9Ô9€EØ
ð Ø—8’8˜E‘?”?ˆØÕ*Ð*Ð*Ý& xÔ0Ð0Ø�	Š	‰Œˆð	 ð ð ð ð ð r   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚAlternativeParserz¶Parser of nonstandard hyphen pattern alternative.

    The instance returns a special int with data about the current position in
    the pattern when called with an odd value.

    c                 ó   — |                      d¦  «        }|d         | _        t          |d         ¦  «        | _        t          |d         ¦  «        | _        |                     d¦  «        r| xj        dz  c_        d S d S )Nú,r   é   é   ú.)r   ÚchangeÚintÚindexÚcutÚ
startswith)ÚselfÚpatternÚalternatives      r   Ú__init__zAlternativeParser.__init__G   sy   € Ø!×'Ò'¨Ñ,Ô,ˆØ! !”nˆŒÝ˜ QœÑ(Ô(ˆŒ
Ý�{ 1”~Ñ&Ô&ˆŒØ×Ò˜cÑ"Ô"ð 	ØˆJŒJ˜!‰OˆJŒJˆJˆJð	ð 	r   c                 ó’   — | xj         dz  c_         t          |¦  «        }|dz  r"t          || j        | j         | j        f¦  «        S |S )Nr'   )r,   r+   ÚDataIntr*   r-   )r/   Úvalues     r   Ú__call__zAlternativeParser.__call__O   sJ   € Øˆ
Œ
�a‰ˆ
Œ
Ý�E‘
”
ˆØ�1‰9ð 	Ý˜5 4¤;°´
¸D¼HÐ"EÑFÔFÐFàˆLr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r2   r6   r   r   r   r$   r$   @   s<   € € € € € ðð ðð ð ðð ð ð ð r   r$   c                   ó   — e Zd ZdZdd„ZdS )r4   zE``int`` with some other data can be stuck to in a ``data`` attribute.Nc                 ó’   — t                                | |¦  «        }|r"t          |t          ¦  «        r|j        |_        n||_        |S )z…Create a new ``DataInt``.

        Call with ``reference=dataint_object`` to use the data from another
        ``DataInt``.

        )r+   Ú__new__Ú
isinstancer4   Údata)Úclsr5   r?   Ú	referenceÚobjs        r   r=   zDataInt.__new__Z   sG   € õ �kŠk˜#˜uÑ%Ô%ˆØð 	� I­wÑ7Ô7ð 	Ø ”~ˆCŒHˆHàˆCŒHØˆ
r   )NN)r7   r8   r9   r:   r=   r   r   r   r4   r4   X   s.   € € € € € ØOÐOðð ð ð ð ð r   r4   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚHyphDictzHyphenation patterns.c                 óæ  ‡
— i | _         |                     d¦  «        5 }|                     ¦   «                              ¦   «         }ddd¦  «         n# 1 swxY w Y   |                     ¦   «         dk    rd}|                     |¦  «                             d¦  «        dd…         D �]}|                     ¦   «         }|r|                     t          ¦  «        rŒ4t          d„ |¦  «        }d|v r.d	|v r*|                     dd¦  «        \  }}t          ||¦  «        Š
nt          Š
t          ˆ
fd
„t          |¦  «        D ¦   «         Ž \  }}t          |¦  «        dk    rŒ·dt!          |¦  «        }	}||         s|dz  }||         ¯||	dz
           s|	dz  }	||	dz
           ¯||||	…         f| j         d                     |¦  «        <   �Œ!i | _        t          d„ | j         D ¦   «         ¦  «        | _        dS )zhRead a ``hyph_*.dic`` and parse its patterns.

        :param path: Path of hyph_*.dic to read

        ÚrbNzmicrosoft-cp1251Úcp1251ú
r'   c                 ób   — t          t          |                      d¦  «        d¦  «        ¦  «        S )Nr'   é   )Úchrr+   Úgroup)Úmatchs    r   ú<lambda>z#HyphDict.__init__.<locals>.<lambda>�   s"   € �c¥# e§k¢k°!¡n¤n°bÑ"9Ô"9Ñ:Ô:€ r   ú/ú=c                 ó4   •— g | ]\  }}| ‰|pd ¦  «        f‘ŒS )Ú0r   )r   ÚiÚstringÚfactorys      €r   ú
<listcomp>z%HyphDict.__init__.<locals>.<listcomp>Š   sC   ø€ ð !Mð !Mð !MÙ09°°6�˜˜   cÑ*Ô*Ð+ð!Mð !Mð !Mr   r   Ú c              3   ó4   K  — | ]}t          |¦  «        V — Œd S )N)Úlen)r   Úkeys     r   ú	<genexpr>z$HyphDict.__init__.<locals>.<genexpr>›   s(   è è € Ð<Ð< s�#˜c™(œ(Ð<Ð<Ð<Ð<Ð<Ð<r   )ÚpatternsÚopenÚreadlineÚdecoder   Ú	read_textr   Ústripr.   ÚignoredÚ	parse_hexr$   r+   ÚzipÚparseÚmaxrY   r   ÚcacheÚmaxlen)r/   ÚpathÚfdÚencodingr0   r1   ÚtagsÚvaluesÚstartÚendrU   s             @r   r2   zHyphDict.__init__l   sl  ø€ ð ˆŒð �YŠY�t‰_Œ_ð 	. Ø—{’{‘}”}×+Ò+Ñ-Ô-ˆHð	.ð 	.ð 	.ñ 	.ô 	.ð 	.ð 	.ð 	.ð 	.ð 	.ð 	.øøøð 	.ð 	.ð 	.ð 	.à�>Š>ÑÔÐ1Ò1Ð1ØˆHà—~’~ hÑ/Ô/×5Ò5°dÑ;Ô;¸A¸B¸BÔ?ð 	Dñ 	DˆGØ—m’m‘o”oˆGØð ˜g×0Ò0µÑ9Ô9ð Øõ  Ø:Ð:¸GñEô EˆGð �gˆ~ˆ~ #¨ . .Ø'.§}¢}°S¸!Ñ'<Ô'<Ñ$�˜Ý+¨G°[ÑAÔA��å�åð !Mð !Mð !Mð !MÝ=BÀ7¹^¼^ð!Mñ !Mô !Mð N‰LˆD�&õ �6‰{Œ{˜aÒÐØð �C ™KœK�3ˆEØ˜U”mð Ø˜‘
�ð ˜U”mð à˜S 1™W”oð Ø�q‘�ð ˜S 1™W”oð ð ,1°&¸¸s¸Ô2CÐ+CˆDŒM˜"Ÿ'š' $™-œ-Ñ(Ñ(àˆŒ
ÝÐ<Ð<¨d¬mÐ<Ñ<Ô<Ñ<Ô<ˆŒˆˆs   ž'AÁAÁAc           	      ó„  — |                      ¦   «         }| j                             |¦  «        }|�€d|› d�}dgt          |¦  «        dz   z  }t	          t          |¦  «        dz
  ¦  «        D ]¯}t          || j        z   t          |¦  «        ¦  «        dz   }t	          |dz   |¦  «        D ]q}| j                             |||…         ¦  «        }|sŒ'|\  }	}
t          ||	z   ||	z   t          |
¦  «        z   ¦  «        }t          t          |
||         ¦  «        ||<   ŒrŒ°d„ t          |¦  «        D ¦   «         x| j        |<   }|S )aþ  Get a list of positions where the word can be hyphenated.

        :param word: unicode string of the word to hyphenate

        E.g. for the dutch word 'lettergrepen' this method returns ``[3, 6,
        9]``.

        Each position is a ``DataInt`` with a data attribute.

        If the data attribute is not ``None``, it contains a tuple with
        information about nonstandard hyphenation at that point: ``(change,
        index, cut)``.

        change
          a string like ``'ff=f'``, that describes how hyphenation should
          take place.

        index
          where to substitute the change, counting from the current point

        cut
          how many characters to remove while substituting the nonstandard
          hyphenation

        Nr)   r   r'   c                 óF   — g | ]\  }}|d z  ¯
t          |dz
  |¬¦  «        ‘ŒS )r(   r'   )rA   )r4   )r   rS   rA   s      r   rV   z&HyphDict.positions.<locals>.<listcomp>Ç   sM   € ð )Lð )Lð )Lá �A�y¸YÈ¹]ð)LÝ˜˜A™¨Ð3Ñ3Ô3ð)Lð )Lð )Lr   )r   rg   ÚgetrY   ÚrangeÚminrh   r\   ÚsliceÚmaprf   Ú	enumerate)r/   ÚwordÚpointsÚpointed_wordÚ
referencesrS   ÚstopÚjr0   Úoffsetrm   Úslice_s               r   Ú	positionszHyphDict.positions�   so  € ð4 �zŠz‰|Œ|ˆØ”—’ Ñ%Ô%ˆØ‰>Ø&˜t˜;˜;˜;ˆLØ˜¥ LÑ 1Ô 1°AÑ 5Ñ6ˆJå�3˜|Ñ,Ô,¨qÑ0Ñ1Ô1ð Nð N�Ý˜1˜tœ{™?­C°Ñ,=Ô,=Ñ>Ô>ÀÑB�Ý˜q 1™u dÑ+Ô+ð Nð N�AØ"œm×/Ò/°¸Q¸q¸SÔ0AÑBÔB�GØ"ð !Ø Ø%,‘N�F˜FÝ" 1 v¡:¨q°6©z½CÀ¹K¼KÑ/GÑHÔH�FÝ),­S°&¸*ÀVÔ:LÑ)MÔ)M�J˜vÑ&Ð&ðNð)Lð )Lå$-¨jÑ$9Ô$9ð)Lñ )Lô )Lð LˆDŒJ�tÑ˜vð ˆr   N)r7   r8   r9   r:   r2   r€   r   r   r   rD   rD   i   s9   € € € € € ØÐð/=ð /=ð /=ðb-ð -ð -ð -ð -r   rD   c                   ó:   — e Zd ZdZdd„Zd„ Zd„ Zdd	„Zdd
„ZeZ	dS )r   zEHyphenation class, with methods to hyphenate strings in various ways.Nr(   Tc                 óâ   — ||c| _         | _        |rt          |¦  «        nt          t	          |¦  «                 }|r	|t
          vrt          |¦  «        t
          |<   t
          |         | _        dS )a°  Create an hyphenation instance for given lang or filename.

        :param filename: filename or Path of hyph_*.dic to read
        :param lang: lang of the included dict to use if no filename is given
        :param left: minimum number of characters of the first syllabe
        :param right: minimum number of characters of the last syllabe
        :param cache: if ``True``, use cached copy of the hyphenation patterns

        N)ÚleftÚrightr   r   r   ÚhdcacherD   Úhd)r/   ÚfilenameÚlangrƒ   r„   rg   ri   s          r   r2   zPyphen.__init__Ð   sf   € ð !% eÐˆŒ	�4”:Ø!)ÐQ�t�H‰~Œ~ˆ~­yÕ9JÈ4Ñ9PÔ9PÔ/QˆØð 	+˜¥GÐ+Ð+Ý$ T™NœN�G�D‰MÝ˜$”-ˆŒˆˆr   c                 ó‚   ‡ ‡— t          |¦  «        ‰ j        z
  Šˆˆ fd„‰ j                             |¦  «        D ¦   «         S )zñGet a list of positions where the word can be hyphenated.

        :param word: unicode string of the word to hyphenate

        See also ``HyphDict.positions``. The points that are too far to the
        left or right are removed.

        c                 ó>   •— g | ]}‰j         |cxk    r‰k    ¯n n|‘ŒS r   )rƒ   )r   rS   r„   r/   s     €€r   rV   z$Pyphen.positions.<locals>.<listcomp>ê   s<   ø€ ÐNÐNÐN�a°d´iÀ1Ð6MÐ6MÒ6MÐ6MÈÒ6MÐ6MÐ6MÐ6MÐ6M�Ð6MÐ6MÐ6Mr   )rY   r„   r†   r€   )r/   rx   r„   s   ` @r   r€   zPyphen.positionsà   sE   øø€ õ �D‘	”	˜DœJÑ&ˆØNÐNÐNÐNÐN˜4œ7×,Ò,¨TÑ2Ô2ÐNÑNÔNÐNr   c              #   ón  K  — t          |                      |¦  «        ¦  «        D ]�}|j        rp|j        \  }}}||z  }|                     ¦   «         r|                     ¦   «         }|                     d¦  «        \  }}|d|…         |z   ||||z   d…         z   fV — Œy|d|…         ||d…         fV — Œ�dS )z†Iterate over all hyphenation possibilities, the longest first.

        :param word: unicode string of the word to hyphenate

        rP   N)Úreversedr€   r?   ÚisupperÚupperr   )r/   rx   Úpositionr*   r,   r-   Úc1Úc2s           r   ÚiteratezPyphen.iterateì   sà   è è € õ ! §¢°Ñ!5Ô!5Ñ6Ô6ð 
	7ð 
	7ˆHØŒ}ð 	7à%-¤]Ñ"�˜˜sØ˜Ñ!�Ø—<’<‘>”>ð ,Ø#Ÿ\š\™^œ^�FØŸš cÑ*Ô*‘��BØ˜6˜E˜6”l RÑ'¨¨d°5¸3±;°<°<Ô.@Ñ)@Ð@Ð@Ð@Ð@Ð@à˜9˜H˜9”o t¨H¨I¨I¤Ð6Ð6Ð6Ð6Ð6ð
	7ð 
	7r   r   c                 ó˜   — |t          |¦  «        z  }|                      |¦  «        D ]!\  }}t          |¦  «        |k    r	||z   |fc S Œ"dS )a´  Get the longest possible first part and the last part of a word.

        :param word: unicode string of the word to hyphenate
        :param width: maximum length of the first part
        :param hyphen: unicode string used as hyphen character

        The first part has the hyphen already attached.

        Returns ``None`` if there is no hyphenation point before ``width``, or
        if the word could not be hyphenated.

        N)rY   r’   )r/   rx   ÚwidthÚhyphenÚw1Úw2s         r   ÚwrapzPyphen.wrapþ   sg   € ð 	•�V‘”ÑˆØ—l’l 4Ñ(Ô(ð 	'ð 	'‰FˆB�Ý�2‰wŒw˜%ÒÐØ˜F‘{ B�Ð&Ð&Ð&ð  ð	'ð 	'r   c                 ó|  — t          |¦  «        }t          |                      |¦  «        ¦  «        D ]v}|j        rW|j        \  }}}||z  }|                     ¦   «         r|                     ¦   «         }|                     d|¦  «        ||||z   …<   Œ`|                     ||¦  «         Œwd                     |¦  «        S )a£  Get the word as a string with all the possible hyphens inserted.

        :param word: unicode string of the word to hyphenate
        :param hyphen: unicode string used as hyphen character

        E.g. for the dutch word ``'lettergrepen'``, this method returns the
        unicode string ``'let-ter-gre-pen'``. The hyphen string to use can be
        given as the second parameter, that defaults to ``'-'``.

        rP   rW   )	ÚlistrŒ   r€   r?   r�   rŽ   r   Úinsertr   )r/   rx   r•   Úlettersr�   r*   r,   r-   s           r   ÚinsertedzPyphen.inserted  s¾   € õ �t‘*”*ˆÝ  §¢°Ñ!5Ô!5Ñ6Ô6ð 		1ð 		1ˆHØŒ}ð 1à%-¤]Ñ"�˜˜sØ˜Ñ!�Ø—<’<‘>”>ð ,Ø#Ÿ\š\™^œ^�FØ-3¯^ª^¸CÀÑ-HÔ-H�˜˜e c™kÐ)Ñ*Ð*à—’˜x¨Ñ0Ô0Ð0Ð0à�wŠw�wÑÔÐr   )NNr(   r(   T)r   )
r7   r8   r9   r:   r2   r€   r’   r˜   r�   r6   r   r   r   r   r   Í   sx   € € € € € ØOÐOð ð  ð  ð  ð 
Oð 
Oð 
Oð7ð 7ð 7ð$'ð 'ð 'ð 'ð$ ð  ð  ð  ð2 €H€H€Hr   r   )$r:   ÚreÚ	importlibr   Úpathlibr   ÚVERSIONÚ__version__Ú__all__r…   ÚcompileÚsubrc   Úfindallre   rb   r   Úfilesr   Ú	TypeErrorÚ__file__ÚparentÚsortedÚiterdirri   Úsuffixr   r   Ú
short_namer   r   r$   r+   r4   rD   r   r   r   r   ú<module>r¯      s2  ððð ð 
€	€	€	Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð  €ˆ+à
6€ð €ð ˆBŒJÐ,Ñ-Ô-Ô1€	ØˆŒ
�=Ñ!Ô!Ô)€ð7€ð
 €	ð:Ø"�9”?Ð#8Ñ9Ô9€L€LøØð :ð :ð :Ø�4˜‘>”>Ô(¨>Ñ9€L€L€Lð:øøøð ˆF�<×'Ò'Ñ)Ô)Ñ*Ô*ð )ð )€DØ„{�fÒÐØŒy˜˜2˜ŒˆØˆ	�$‰Ø—Z’Z ‘_”_ QÔ'ˆ
Ø˜YÐ&Ð&Ø$(ˆI�jÑ!øà@Ð@°iÐ@Ñ@Ô@Ð ðð ð ð"ð ð ð ð ñ ô ð ð0ð ð ð ð ˆcñ ô ð ð"að að að að añ aô að aðH\ð \ð \ð \ð \ñ \ô \ð \ð \ð \s   Á
A ÁA6Á5A6