You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
348 B
14 lines
348 B
"""Style.INITIALS 风格"""
|
|
from typing import Any
|
|
from typing import Text
|
|
|
|
from pypinyin.constants import Style
|
|
from pypinyin.style import register
|
|
from pypinyin.style._utils import get_initials
|
|
|
|
|
|
@register(Style.INITIALS)
|
|
def convert(pinyin: Text, **kwargs: Any) -> Text:
|
|
strict = kwargs.get('strict')
|
|
return get_initials(pinyin, strict)
|