initials.py 352 B

12345678910111213
  1. # -*- coding: utf-8 -*-
  2. """Style.INITIALS 风格"""
  3. from __future__ import unicode_literals
  4. from pypinyin.constants import Style
  5. from pypinyin.style import register
  6. from pypinyin.style._utils import get_initials
  7. @register(Style.INITIALS)
  8. def convert(pinyin, **kwargs):
  9. strict = kwargs.get('strict', True)
  10. return get_initials(pinyin, strict)