Skip to main content

SpacemanX is a module used to create space (make room) between semi-width and full-width characters.

Project description

SpacemanX (失傳的空格)

很久以前,當人類仍然知道全形與半形字集的區別時,一個受過教育的打字者會注意把全型字符和半型字符之間加一個「空格」。後來,隨著文明的崩解與人類集體智力表現的衰退,這個古老的技能漸漸被遺忘了。

SpacemanX 脫胎自 Python2 時代的 Spaceman,在 Python3.6+ 的版本可以運作。它的功能就是確保「半型符號」和「全型符號」之間至少有一個空格。例如 用English寫2次 經過 SpacemanX 處理後,會成為 用 English 寫 2 次 (注意到 English 這個半型字串和前後的全型字符之間多了空格,且 2 這個半型字符也和前後的全型字符之間多了空格)。

主要功能:

  • 加空格!(不然你期待什麼?發射火箭嗎?)

功能:

  • 輸入字串 => 輸出字串
  • 輸入檔案 => 輸出檔案
  • 模式 (mode) 可選為 "modest"(預設值)"strong"
    • modest 模式 (預設值)
    import SpacemanX
    inputSTR = "這是一個(English)測試"
    resultSTR = SpacemanX.makeroom(inputSTR)
    print(resultSTR)
    # "這是一個 (English) 測試" 括號前後的半型字符不加空格。
    # 適合閱讀使用
    
    • strong 模式
    import SpacemanX
    inputSTR = "這是一個(English)測試"
    resultSTR = SpacemanX.makeroom(inputSTR, mode="strong")
    print(resultSTR)
    # "這是一個 ( English ) 測試" 括號前後也加上空格。
    # 適合 NLP 前處理使用
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SpacemanX-0.99.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

SpacemanX-0.99-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file SpacemanX-0.99.tar.gz.

File metadata

  • Download URL: SpacemanX-0.99.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.9

File hashes

Hashes for SpacemanX-0.99.tar.gz
Algorithm Hash digest
SHA256 a1de6c3125afbe634e3dd8a0c9c230b50da0fb119ee3ffa2d031973a02c737f8
MD5 483de893aa76004168b83de26bdf1a36
BLAKE2b-256 e1139ae9dfcb20c30ce6980729c7a76f56699da589ebc9d53ba28d5d98d7cd11

See more details on using hashes here.

File details

Details for the file SpacemanX-0.99-py3-none-any.whl.

File metadata

  • Download URL: SpacemanX-0.99-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.9

File hashes

Hashes for SpacemanX-0.99-py3-none-any.whl
Algorithm Hash digest
SHA256 def7aec25be8c13a3abca1ac87b5b2fa2b90dfea25f898da694f436abfcde120
MD5 050d9f1288a1a705421a540397c8e364
BLAKE2b-256 69184a030687b0b290a573b0b8bc7e31414e9992dc7ee8b4102e739a1021b17d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page