Skip to main content

Pangu2

Split From English and Chinese.

Installation

$ pip install -U pangu2

Usage

In Python

import pangu2

new_text = pangu2.spacing_text('當你凝視著bug,bug也凝視著你')
# new_text = '當你凝視著 bug,bug 也凝視著你'

nwe_content = pangu2.spacing_file('path/to/file.txt')
# nwe_content = '與 PM 戰鬥的人,應當小心自己不要成為 PM'

In CLI

$ pangu2 "請使用uname -m指令來檢查你的Linux作業系統是32位元或是[敏感词已被屏蔽]位元"
請使用 uname -m 指令來檢查你的 Linux 作業系統是 32 位元或是 [敏感词已被屏蔽] 位元

$ python -m pangu2 "為什麼小明有問題都不Google?因為他有Bing"
為什麼小明有問題都不 Google?因為他有 Bing

$ echo "未來的某一天,Gmail配備的AI可能會得出一個結論:想要消滅垃圾郵件最好的辦法就是消滅人類" >> path/to/file.txt
$ pangu2 -f path/to/file.txt >> pangu_file.txt
$ cat pangu_file.txt
未來的某一天,Gmail 配備的 AI 可能會得出一個結論:想要消滅垃圾郵件最好的辦法就是消滅人類

$ echo "心裡想的是Microservice,手裡做的是Distributed Monolith" | pangu2
心裡想的是 Microservice,手裡做的是 Distributed Monolith

$ echo "你從什麼時候開始產生了我沒使用Monkey Patch的錯覺?" | python -m pangu2
你從什麼時候開始產生了我沒使用 Monkey Patch 的錯覺?

History

5.0 (2019-08-02)

  • Remove Letter & Number and Paren Split

4.0.6.1 (2019-02-09)

  • Implement Paranoid Text Spacing algorithm v4

  • Support Python 3.7

  • Drop Python 2.7 support

3.3.0.1 (2018-01-20)

  • Support Python 3.6

  • Add a method: pangu.spacing_file()

  • Add a command-line tool: pangu

3.0.0 (2016-01-24)

  • Support Python 3.5

  • Refactoring

  • Rename text_spacing() to spacing_text()

2.5.6.3 (2015-05-18)

  • Add an alias to spacing(): text_spacing()

  • Fix unicode issue in Python 2.x

2.5.6.2 (2015-05-17)

  • Fix setup.py

2.5.6 (2015-05-17)

  • Synchronize version number with pangu.js

  • Improve Paranoid Text Spacing algorithm

1.0.0 (2014-02-12)

  • Hello World

Metadata

Release files for pangu2 5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pangu2 5.0
File Size Uploaded Provenance Actions
pangu2-5.0.tar.gz 6.0 kB Without provenance Details for pangu2-5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pangu2 5.0
File Interpreter ABI Platform Actions
pangu2-5.0-py3.7.egg Legacy Egg format - - Details for pangu2-5.0-py3.7.egg

Total release size: 14.4 kB

Release files / pangu2-5.0.tar.gz

Download URL pangu2-5.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
84f73bb3d07d2e0338814e4b908e01fcdce8fcf7102b07a94ebffa724c0cab92
BLAKE2b-256 checksum
How to use checksums
004cf05718052ca54f4118c5f8f30ecbc3229e323be251f47f668ace15b39bc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release files / pangu2-5.0-py3.7.egg

Download URL pangu2-5.0-py3.7.egg
Size 8.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
b8698a2b2eb72c12ddf8e8b9133ae5f5c6da30a7cba0ee46f2a42d79167c4f40
BLAKE2b-256 checksum
How to use checksums
b18842fbc9f4d78e073663ef9b33f0dd333412c1900ad96233cff3f0e58e664a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for pangu2 5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

5.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page