Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bugtender/rangu
🔍Paranoid text spacing in Ruby.
https://github.com/bugtender/rangu
Last synced: 2 months ago
JSON representation
🔍Paranoid text spacing in Ruby.
- Host: GitHub
- URL: https://github.com/bugtender/rangu
- Owner: bugtender
- License: mit
- Created: 2019-01-21T03:30:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T10:01:49.000Z (almost 6 years ago)
- Last Synced: 2024-04-25T21:04:10.672Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 20.5 KB
- Stars: 14
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Rangu
[![Build Status](https://travis-ci.org/bugtender/rangu.svg?branch=master)](https://travis-ci.org/bugtender/rangu)
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).
This is the Ruby copy version from [Vinta](https://github.com/vinta)'s [pangu.py](https://github.com/vinta/pangu.py).
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rangu'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install rangu
## Usage
```ruby
require "rangu"Rangu.spacing("當你凝視著bug,bug也凝視著你")
=> "當你凝視著 bug,bug 也凝視著你"Rangu.spacing("path/to/file.txt")
=> "與 PM 戰鬥的人,應當小心自己不要成為 PM"
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/bugtender/rangu. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the Rangu project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bugtender/rangu/blob/master/CODE_OF_CONDUCT.md).