pangu
1 English
2 Mandarin
3 Reference
spacing
spacing-file
7.7

pangu

 (require pangu) package: pangu

1 English

Paranoid text spacing for Racket.

Add spaces around CJK characters to make them less cramped.

This is a port of the pangu family of libraries. Specifically, the regexps and the test suite are all directly ported from vinta/pangu.py.

2 Mandarin

@vinta的盤古之白移植到Racket上。

基本上是Python版的直譯。

3 Reference

procedure

(spacing text)  string?

  text : string?
Returns a new string with pangu spacing applied.

Examples:
> (spacing "為什麼小明有問題都不Google?因為他有Bing")

"為什麼小明有問題都不 Google?因為他有 Bing"

> (spacing "當你凝視著bug,bug也凝視著你")

"當你凝視著 bug,bug 也凝視著你"

procedure

(spacing-file path)  string?

  path : path-string?
Apply pangu spacing to the file’s contents, and return it as a string.