Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinta/pangu.py
Paranoid text spacing in Python
https://github.com/vinta/pangu.py
pangu python text text-spacing
Last synced: about 2 months ago
JSON representation
Paranoid text spacing in Python
- Host: GitHub
- URL: https://github.com/vinta/pangu.py
- Owner: vinta
- License: mit
- Created: 2014-02-11T18:42:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T17:57:13.000Z (over 1 year ago)
- Last Synced: 2024-07-20T03:41:37.650Z (2 months ago)
- Topics: pangu, python, text, text-spacing
- Language: Python
- Homepage: https://pypi.org/project/pangu/
- Size: 71.3 KB
- Stars: 248
- Watchers: 9
- Forks: 26
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
pangu.py
========.. image:: https://img.shields.io/pypi/v/pangu.svg?style=flat-square
:target: https://pypi.org/project/pangu/.. image:: https://img.shields.io/pypi/pyversions/pangu.svg?style=flat-square
:target: https://pypi.org/project/pangu/.. image:: https://img.shields.io/badge/made%20with-%e2%9d%a4-ff69b4.svg?style=flat-square
:target: https://vinta.ws/code/Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).
- `pangu.go `_ (Go)
- `pangu.java `_ (Java)
- `pangu.js `_ (JavaScript)
- `pangu.py `_ (Python)
- `pangu.space `_ (Web API)Installation
============.. code-block:: bash
$ pip install -U pangu
Usage
=====In Python
---------.. code-block:: py
import pangu
new_text = pangu.spacing_text('當你凝視著bug,bug也凝視著你')
# new_text = '當你凝視著 bug,bug 也凝視著你'nwe_content = pangu.spacing_file('path/to/file.txt')
# nwe_content = '與 PM 戰鬥的人,應當小心自己不要成為 PM'In CLI
------.. code-block:: bash
$ pangu "請使用uname -m指令來檢查你的Linux作業系統是32位元或是[敏感词已被屏蔽]位元"
請使用 uname -m 指令來檢查你的 Linux 作業系統是 32 位元或是 [敏感词已被屏蔽] 位元$ python -m pangu "為什麼小明有問題都不Google?因為他有Bing"
為什麼小明有問題都不 Google?因為他有 Bing$ echo "未來的某一天,Gmail配備的AI可能會得出一個結論:想要消滅垃圾郵件最好的辦法就是消滅人類" >> path/to/file.txt
$ pangu -f path/to/file.txt >> pangu_file.txt
$ cat pangu_file.txt
未來的某一天,Gmail 配備的 AI 可能會得出一個結論:想要消滅垃圾郵件最好的辦法就是消滅人類$ echo "心裡想的是Microservice,手裡做的是Distributed Monolith" | pangu
心裡想的是 Microservice,手裡做的是 Distributed Monolith$ echo "你從什麼時候開始產生了我沒使用Monkey Patch的錯覺?" | python -m pangu
你從什麼時候開始產生了我沒使用 Monkey Patch 的錯覺?