You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
You must request the API with a HTTP header x-api-key: TiEeVInyGza4ta0kougRH4MBBfdGe2Q91TjrbQLm. Yeah, you are free to use the API key for accessing the service. Although it has a quota of 100000 requests per month.
Development
pangu.space is built on AWS Lambda and Amazon API Gateway. I use Apex to manage and deploy Lambda functions.
# deploy all functions
$ apex deploy
# view logs
$ apex logs -f
# invoke a functiondirectly
$ apex invoke spacing_text --logs{ "statusCode": 400, "headers": null, "body":"{\"message\": \"No text was provided in HTTP query string\"}"}
# invoke a functionwith an API Gateway event
$ cat fixtures/spacing_text_event.json{ "queryStringParameters": {"t": "與PM戰鬥的人,應當小心自己不要成為PM"}}
$ apex invoke spacing_text --logs < fixtures/spacing_text_event.json{ "statusCode": 200, "headers": {"content-type": "text/plain; charset=utf-8"}, "body": "與 PM 戰鬥的人,應當小心自己不要成為 PM"}