https://github.com/emsk/romajify
Japanese romanization library for Ruby.
https://github.com/emsk/romajify
cli gem japanese romaji ruby
Last synced: about 2 months ago
JSON representation
Japanese romanization library for Ruby.
- Host: GitHub
- URL: https://github.com/emsk/romajify
- Owner: emsk
- License: mit
- Created: 2016-02-01T14:45:06.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2021-06-17T13:23:41.000Z (almost 4 years ago)
- Last Synced: 2025-03-24T12:39:18.316Z (2 months ago)
- Topics: cli, gem, japanese, romaji, ruby
- Language: Ruby
- Size: 146 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Romajify
[](https://badge.fury.io/rb/romajify)
[](https://github.com/emsk/romajify/actions/workflows/build.yml)
[](https://travis-ci.org/emsk/romajify)
[](https://ci.appveyor.com/project/emsk/romajify)
[](https://dev.azure.com/emsk/romajify/_build/latest?definitionId=2&branchName=main)
[](https://codecov.io/gh/emsk/romajify)
[](https://codeclimate.com/github/emsk/romajify)
[](http://inch-ci.org/github/emsk/romajify)
[](LICENSE.txt)Japanese romanization library for Ruby.
http://qiita.com/emsk/items/3e24628c220c825da709 (Japanese)
## Prerequisite
You have to install Ruby 2.0.0 or higher.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'romajify'
```And then execute:
```sh
$ bundle
```Or install it yourself as:
```sh
$ gem install romajify
```## Usage
#### Command Line Interface
```sh
$ romajify hepburn すし
```#### Ruby Source Code
```ruby
require 'romajify/converter'
puts Romajify::Converter.hepburn('すし')
```## Supported Romaji
#### Hepburn Romaji
Modified Hepburn:
```sh
$ romajify hepburn しんばし
shinbashi
```Traditional Hepburn:
```sh
$ romajify hepburn --traditional しんばし
shimbashi
```#### Nihon-shiki Romaji
```sh
$ romajify nihon まちづくり
matidukuri
```#### Kunrei-shiki Romaji
```sh
$ romajify kunrei まちづくり
matizukuri
```## Command Options
| Option | Description | Default |
| :----- | :---------- | :------ |
| `-u/--upcase` | Whether to return upper case. | `false` - Lower case |
| `-t/--traditional` | Whether to convert to traditional hepburn. This is the option only for `hepburn` command. | `false` - Modified hepburn |## Documentation
http://www.rubydoc.info/gems/romajify
## Supported Ruby Versions
Ruby 2.0.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0
## Contributing
1. Fork it ( https://github.com/emsk/romajify/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Related
* [mruby-romajify](https://github.com/emsk/mruby-romajify) - An mruby implementation of the romajify
* [go-romajify](https://github.com/emsk/go-romajify) - Pure Go implementation of the romajify
* [romajic](https://github.com/emsk/romajic) - Automatic romaji spelling checker for programmer## License
[MIT](LICENSE.txt)