gyou 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +29 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/gyou.gemspec +31 -0
- data/lib/gyou.rb +19 -0
- data/lib/gyou/version.rb +3 -0
- metadata +96 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 367ab06557f153f8294e2c1dc4442e1077e2b548
|
|
4
|
+
data.tar.gz: 22e66396cefd99fc2a28ce332a10720314c28f8c
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5ac41ac51b9bba8eab9fee29dc78dec57623af6fbfb982d49001526a016015cdba9135ddb7db6e3459ed44d2f4612001dd992b4b3b99c240591d32a8e13bac32
|
|
7
|
+
data.tar.gz: 3526ba55620e401e0677c9a9318ad9ac7bdb1abcae990f0fb7914db4b53cd779a1b51b7b3dc5b5a9641e58bda5eecd4232aa89cfd00406d31aab3849f6d29a98
|
data/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.yardoc
|
|
3
|
+
/Gemfile.lock
|
|
4
|
+
/_yardoc/
|
|
5
|
+
/coverage/
|
|
6
|
+
/doc/
|
|
7
|
+
/pkg/
|
|
8
|
+
/spec/reports/
|
|
9
|
+
/tmp/
|
|
10
|
+
.bundle/
|
|
11
|
+
vendor/bundle/
|
|
12
|
+
|
|
13
|
+
# tmp files from editors
|
|
14
|
+
*~
|
|
15
|
+
*.bak
|
|
16
|
+
.DS_Store
|
|
17
|
+
.buildpath
|
|
18
|
+
.project
|
|
19
|
+
.settings
|
|
20
|
+
*.tmproj
|
|
21
|
+
build
|
|
22
|
+
.idea
|
|
23
|
+
nbproject/
|
|
24
|
+
|
|
25
|
+
# hidden files created by Windows
|
|
26
|
+
Thumbs.db
|
|
27
|
+
desktop.ini
|
|
28
|
+
|
|
29
|
+
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Gyou
|
|
2
|
+
|
|
3
|
+
ひらがなの文字が何行かを取得します。
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Add this line to your application's Gemfile:
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
gem 'gyou'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
And then execute:
|
|
15
|
+
|
|
16
|
+
$ bundle
|
|
17
|
+
|
|
18
|
+
Or install it yourself as:
|
|
19
|
+
|
|
20
|
+
$ gem install gyou
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
gyou_sample = Gyou.get("し")
|
|
26
|
+
# gyou_sample = "さ"
|
|
27
|
+
gyou_sample = Gyou.get("すずき")
|
|
28
|
+
# gyou_sample = "さ"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Development
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Contributing
|
|
35
|
+
|
|
36
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "gyou"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/gyou.gemspec
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'gyou/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "gyou"
|
|
8
|
+
spec.version = Gyou::VERSION
|
|
9
|
+
spec.authors = ["Kohei Onodera"]
|
|
10
|
+
spec.email = ["onodera212@gmail.com"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{get hiragana-gyou from japanese string.}
|
|
13
|
+
spec.homepage = "https://github.com/onody/gyou"
|
|
14
|
+
|
|
15
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
|
16
|
+
# delete this section to allow pushing this gem to any host.
|
|
17
|
+
if spec.respond_to?(:metadata)
|
|
18
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
|
19
|
+
else
|
|
20
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
24
|
+
spec.bindir = "exe"
|
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
26
|
+
spec.require_paths = ["lib"]
|
|
27
|
+
|
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
30
|
+
spec.add_development_dependency "rspec"
|
|
31
|
+
end
|
data/lib/gyou.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require "gyou/version"
|
|
2
|
+
|
|
3
|
+
module Gyou
|
|
4
|
+
|
|
5
|
+
DICTIONARY = {
|
|
6
|
+
'あ' => 'あ', 'い' => 'あ', 'う' => 'あ', 'え' => 'あ', 'お' => 'あ', 'ぁ' => 'あ', 'ぃ' => 'あ', 'ぅ' => 'あ', 'ぇ' => 'あ', 'ぉ' => 'あ', 'か' => 'か', 'き' => 'か', 'く' => 'か', 'け' => 'か', 'こ' => 'か', 'さ' => 'さ', 'し' => 'さ', 'す' => 'さ', 'せ' => 'さ', 'そ' => 'さ', 'た' => 'た', 'ち' => 'た', 'つ' => 'た', 'て' => 'た', 'と' => 'た', 'な' => 'な', 'に' => 'な', 'ぬ' => 'な', 'ね' => 'な', 'の' => 'な', 'は' => 'は', 'ひ' => 'は', 'ふ' => 'は', 'へ' => 'は', 'ほ' => 'は', 'ま' => 'ま', 'み' => 'ま', 'む' => 'ま', 'め' => 'ま', 'も' => 'ま', 'や' => 'や', 'ゃ' => 'や', 'ゆ' => 'や', 'ゅ' => 'や', 'よ' => 'や', 'ょ' => 'や', 'わ' => 'わ', 'を' => 'わ', 'ん' => 'わ'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
def self.get text
|
|
10
|
+
raise "not string" unless text.instance_of? String
|
|
11
|
+
raise "empty" if text.empty?
|
|
12
|
+
|
|
13
|
+
first_character = text[0..0]
|
|
14
|
+
|
|
15
|
+
raise "not hiragana" unless first_character.match(/^[ぁ-ん]/)
|
|
16
|
+
|
|
17
|
+
DICTIONARY[first_character]
|
|
18
|
+
end
|
|
19
|
+
end
|
data/lib/gyou/version.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gyou
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Kohei Onodera
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.10'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.10'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
description:
|
|
56
|
+
email:
|
|
57
|
+
- onodera212@gmail.com
|
|
58
|
+
executables: []
|
|
59
|
+
extensions: []
|
|
60
|
+
extra_rdoc_files: []
|
|
61
|
+
files:
|
|
62
|
+
- ".gitignore"
|
|
63
|
+
- ".rspec"
|
|
64
|
+
- ".travis.yml"
|
|
65
|
+
- Gemfile
|
|
66
|
+
- README.md
|
|
67
|
+
- Rakefile
|
|
68
|
+
- bin/console
|
|
69
|
+
- bin/setup
|
|
70
|
+
- gyou.gemspec
|
|
71
|
+
- lib/gyou.rb
|
|
72
|
+
- lib/gyou/version.rb
|
|
73
|
+
homepage: https://github.com/onody/gyou
|
|
74
|
+
licenses: []
|
|
75
|
+
metadata: {}
|
|
76
|
+
post_install_message:
|
|
77
|
+
rdoc_options: []
|
|
78
|
+
require_paths:
|
|
79
|
+
- lib
|
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
|
+
requirements:
|
|
82
|
+
- - ">="
|
|
83
|
+
- !ruby/object:Gem::Version
|
|
84
|
+
version: '0'
|
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
requirements: []
|
|
91
|
+
rubyforge_project:
|
|
92
|
+
rubygems_version: 2.5.0
|
|
93
|
+
signing_key:
|
|
94
|
+
specification_version: 4
|
|
95
|
+
summary: get hiragana-gyou from japanese string.
|
|
96
|
+
test_files: []
|