o
    Ti                     @   s0   d dl mZ i Zd	ddZd	ddZdd ZdS )
    )wrapsNc                 K   s$   |t v rt | | fd|i|S |S )u  根据拼音风格把原始拼音转换为不同的格式

    :param pinyin: 原始有声调的单个拼音
    :type pinyin: unicode
    :param style: 拼音风格
    :param strict: 只获取声母或只获取韵母相关拼音风格的返回结果
                   是否严格遵照《汉语拼音方案》来处理声母和韵母，
                   详见 :ref:`strict`
    :type strict: bool
    :param default: 拼音风格对应的实现不存在时返回的默认值
    :param kwargs: 兼容后续可能会新增的关键字参数。当前包含如下关键字参数:
                   ``han``: 当前拼音对应的原始汉字。

    :return: 按照拼音风格进行处理过后的拼音字符串
    :rtype: unicode
    strict	_registry)pinyinstyler   defaultkwargs r
   K/home/ubuntu/.local/lib/python3.10/site-packages/pypinyin/style/__init__.pyconvert   s   r   c                    s$   |dur
|t  < dS  fdd}|S )u  注册一个拼音风格实现。
    自定义的函数应当使用 ``**kwargs`` 来兼容后续可能会新增的关键字参数，
    当前默认会传递如下参数：

    * ``pinyin``: 原始有声调的单个拼音
    * ``strict``: 是否开启 strict 模式
    * ``han``: 当前拼音对应的原始汉字

    ::

        @register('echo')
        def echo(pinyin, **kwargs):
            return pinyin

        # or
        register('echo', echo)
    Nc                    s     t < t  fdd}|S )Nc                    s    | fi |S Nr
   )r   r	   funcr
   r   wrapper7   s   z,register.<locals>.decorator.<locals>.wrapper)r   r   )r   r   r   r   r   	decorator4   s   zregister.<locals>.decoratorr   )r   r   r   r
   r   r   register   s
   r   c                  C   s(   ddl m} m}m}m}m}m}m} dS )u'   自动注册内置的拼音风格实现r   initialstonefinalsbopomofocyrillic	wadegilesothersN)pypinyin.styler   r   r   r   r   r   r   r   r
   r
   r   auto_discover?   s   (r   r   )	functoolsr   r   r   r   r   r
   r
   r
   r   <module>   s
   

!