Skip to content

Commit

Permalink
ready for v0.29.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Jan 14, 2018
1 parent eb9bd7d commit de71f1f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -49,3 +49,4 @@ venvPyInstaller/
output.dat
vocab.bin
vocab.large.bin
.mypy_cache/
7 changes: 7 additions & 0 deletions CHANGELOG.rst
@@ -1,6 +1,11 @@
Changelog
---------

0.29.0 (2018-01-14)
+++++++++++++++++++++

* **[New]** 可以通过环境变量 ``PYPINYIN_NO_DICT_COPY`` 禁用代码内对 dict 的 copy 操作,节省内存(via `#115`_ thanks `@daya0576`_ )。

0.28.0 (2017-12-08)
+++++++++++++++++++++

Expand Down Expand Up @@ -575,3 +580,5 @@ __ https://github.com/mozillazg/python-pinyin/issues/8
.. _#106: https://github.com/mozillazg/python-pinyin/issues/106
.. _@wdscxsj: https://github.com/wdscxsj
.. _#110: https://github.com/mozillazg/python-pinyin/pull/110
.. _#115: https://github.com/mozillazg/python-pinyin/pull/115
.. _@daya0576: https://github.com/daya0576
9 changes: 9 additions & 0 deletions README.rst
Expand Up @@ -88,6 +88,14 @@ FAQ
`#27 <https://github.com/mozillazg/python-pinyin/issues/27>`__,
`#44 <https://github.com/mozillazg/python-pinyin/issues/44>`__

如果觉得这个行为不是你想要的,就是想把 y 当成声母的话,可以指定 ``strict=False`` , 这个可能会符合你的预期。详见 `strict 参数的影响`_

更多 FAQ 详见文档中的 `FAQ`_ 部分。


.. _#13 : https://github.com/mozillazg/python-pinyin/issues/113
.. _strict 参数的影响: https://pypinyin.readthedocs.io/zh_CN/master/usage.html#strict


拼音数据
---------
Expand Down Expand Up @@ -117,3 +125,4 @@ __ https://github.com/mozillazg/rust-pinyin
.. _Russian translation: https://github.com/mozillazg/python-pinyin/blob/master/README_ru.rst
.. _pinyin-data: https://github.com/mozillazg/pinyin-data
.. _phrase-pinyin-data: https://github.com/mozillazg/phrase-pinyin-data
.. _FAQ: https://pypinyin.readthedocs.io/zh_CN/master/faq.html
16 changes: 14 additions & 2 deletions docs/faq.rst
Expand Up @@ -9,14 +9,20 @@ FAQ


如何禁用默认的“拼音库”copy 操作
++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++

设置环境变量 ``PYPINYIN_NO_DICT_COPY=true`` 即可.


副作用: 用户的自定义拼音库出现问题时, 无法回退到自带的拼音库.


如何减少内存占用
+++++++++++++++++++++

如果对拼音正确性不在意的话,可以按照上面所说的设置环境变量 ``PYPINYIN_NO_PHRASES`` 和 ``PYPINYIN_NO_DICT_COPY`` 详见 `#13`_



``INITIALS`` 声母风格下,以 ``y``, ``w``, ``yu`` 开头的汉字返回空字符串
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Expand All @@ -39,3 +45,9 @@ FAQ
y,w,ü (yu) 都不是声母,在某些特定韵母无声母时,才加上 y 或 w,而 ü 也有其特定规则。
如果你觉得这个给你带来了麻烦,那么也请小心一些无声母的汉字(如“啊”、“饿”、“按”、“昂”等)。
这时候你也许需要的是首字母风格(FIRST_LETTER)。 —— @hotoo

如果觉得这个行为不是你想要的,就是想把 y 当成声母的话,可以指定 ``strict=False`` , 这个可能会符合你的预期。详见 `strict 参数的影响`_


.. _#13 : https://github.com/mozillazg/python-pinyin/issues/113
.. _strict 参数的影响: https://pypinyin.readthedocs.io/zh_CN/master/usage.html#strict

0 comments on commit de71f1f

Please sign in to comment.