itaiji 0.0.1 → 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 +4 -4
- data/.rspec +2 -0
- data/.travis +6 -0
- data/Gemfile.lock +14 -1
- data/MIT-LICENSE +20 -0
- data/README.md +6 -8
- data/Rakefile +6 -0
- data/itaiji.gemspec +9 -3
- data/lib/itaiji/converter.rb +2 -2
- data/spec/lib/itaiji/converter_spec.rb +24 -0
- data/spec/spec_helper.rb +2 -0
- metadata +55 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33bb4ee414faf8d6a3b3bdac7db1c78e3b937fdb
|
4
|
+
data.tar.gz: c99b81dc3afb44f6b1f428c1ee6201737fdc6bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae7106bf39d22ce64f84380593810df4ec9b85f2216918ee36abe8eb65cbcf96fcfd7a6211255082dd976d882f028d44ab2618934f123242fd7b867861a77fb1
|
7
|
+
data.tar.gz: 907c813ddd91aa7ec5299ab04ec6f87376a644f4db5941d3f1000311a1a3e9fd9a85b5e75356f5f726fd92bce8d8f127dff940efa16d016ea1445d5dafb0473b
|
data/.rspec
ADDED
data/.travis
ADDED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
itaiji (0.0
|
4
|
+
itaiji (0.1.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
diff-lcs (1.2.5)
|
10
|
+
rake (10.3.2)
|
11
|
+
rspec (2.14.1)
|
12
|
+
rspec-core (~> 2.14.0)
|
13
|
+
rspec-expectations (~> 2.14.0)
|
14
|
+
rspec-mocks (~> 2.14.0)
|
15
|
+
rspec-core (2.14.8)
|
16
|
+
rspec-expectations (2.14.5)
|
17
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
18
|
+
rspec-mocks (2.14.6)
|
9
19
|
|
10
20
|
PLATFORMS
|
11
21
|
ruby
|
12
22
|
|
13
23
|
DEPENDENCIES
|
24
|
+
bundler
|
14
25
|
itaiji!
|
26
|
+
rake
|
27
|
+
rspec
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 Masahiro Saito
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,14 +1,12 @@
|
|
1
|
-
itaiji
|
2
|
-
|
1
|
+
# itaiji
|
2
|
+
|
3
|
+
[](https://travis-ci.org/camelmasa/itaiji)
|
3
4
|
|
4
|
-
Convert japanese itaiji(異体字) to seijitai(正字体) or reverse also.
|
5
5
|
|
6
|
+
Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.
|
6
7
|
Instration
|
7
8
|
----------
|
8
9
|
|
9
|
-
|
10
|
-
## Installation
|
11
|
-
|
12
10
|
Add this line to your application's Gemfile:
|
13
11
|
|
14
12
|
gem 'itaiji'
|
@@ -26,9 +24,9 @@ Usage
|
|
26
24
|
|
27
25
|
```
|
28
26
|
converter = Itaiji::Converter.new
|
29
|
-
converter.
|
27
|
+
converter.convert_seijitai('髙橋') # => '高橋'
|
30
28
|
|
31
|
-
converter.
|
29
|
+
converter.convert_itaiji('高橋') # => '髙橋'
|
32
30
|
```
|
33
31
|
|
34
32
|
Source
|
data/Rakefile
ADDED
data/itaiji.gemspec
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "itaiji"
|
3
|
-
spec.version = "0.0
|
3
|
+
spec.version = "0.1.0"
|
4
4
|
spec.authors = ["Masahiro Saito"]
|
5
5
|
spec.email = ["camelmasa@gmail.com"]
|
6
|
-
spec.summary = %q{itaiji}
|
7
|
-
spec.description = %q{itaiji}
|
6
|
+
spec.summary = %q{Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.}
|
7
|
+
spec.description = %q{Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.}
|
8
8
|
spec.homepage = "https://github.com/camelmasa/itaiji"
|
9
9
|
spec.license = "MIT"
|
10
|
+
|
10
11
|
spec.files = `git ls-files`.split($/)
|
12
|
+
spec.test_files = spec.files.grep(%r{^(spec)/})
|
11
13
|
spec.require_paths = ["lib"]
|
14
|
+
|
15
|
+
spec.add_development_dependency 'bundler'
|
16
|
+
spec.add_development_dependency 'rake'
|
17
|
+
spec.add_development_dependency 'rspec'
|
12
18
|
end
|
data/lib/itaiji/converter.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#encoding: utf-8
|
2
2
|
module Itaiji
|
3
3
|
class Converter
|
4
|
-
def
|
4
|
+
def convert_seijitai(string)
|
5
5
|
itaiji_list.each do |itaiji_set|
|
6
6
|
|
7
7
|
seijitai = itaiji_set.keys.first
|
@@ -12,7 +12,7 @@ module Itaiji
|
|
12
12
|
string
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def convert_itaiji(string)
|
16
16
|
itaiji_list.each do |itaiji_set|
|
17
17
|
|
18
18
|
seijitai = itaiji_set.keys.first
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Itaiji::Converter do
|
5
|
+
|
6
|
+
let(:itaiji_text) { '齊藤正澔' }
|
7
|
+
let(:seijitai_text) { '斉藤正浩' }
|
8
|
+
let(:converter) { Itaiji::Converter.new }
|
9
|
+
|
10
|
+
describe '#convert_seijitai' do
|
11
|
+
it 'convert name from itaiji to seijitai' do
|
12
|
+
expect {
|
13
|
+
converter.convert_seijitai(itaiji_text)
|
14
|
+
}.to change{ itaiji_text }.to seijitai_text
|
15
|
+
end
|
16
|
+
end
|
17
|
+
describe '#convert_itaiji' do
|
18
|
+
it 'convert name from seijitai to itaiji' do
|
19
|
+
expect {
|
20
|
+
converter.convert_itaiji(seijitai_text)
|
21
|
+
}.to change{ seijitai_text }.to itaiji_text
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itaiji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Saito
|
@@ -9,20 +9,68 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-06-30 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
|
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: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '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: Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.
|
14
56
|
email:
|
15
57
|
- camelmasa@gmail.com
|
16
58
|
executables: []
|
17
59
|
extensions: []
|
18
60
|
extra_rdoc_files: []
|
19
61
|
files:
|
62
|
+
- ".rspec"
|
63
|
+
- ".travis"
|
20
64
|
- Gemfile
|
21
65
|
- Gemfile.lock
|
66
|
+
- MIT-LICENSE
|
22
67
|
- README.md
|
68
|
+
- Rakefile
|
23
69
|
- itaiji.gemspec
|
24
70
|
- lib/itaiji.rb
|
25
71
|
- lib/itaiji/converter.rb
|
72
|
+
- spec/lib/itaiji/converter_spec.rb
|
73
|
+
- spec/spec_helper.rb
|
26
74
|
homepage: https://github.com/camelmasa/itaiji
|
27
75
|
licenses:
|
28
76
|
- MIT
|
@@ -46,5 +94,7 @@ rubyforge_project:
|
|
46
94
|
rubygems_version: 2.2.2
|
47
95
|
signing_key:
|
48
96
|
specification_version: 4
|
49
|
-
summary: itaiji
|
50
|
-
test_files:
|
97
|
+
summary: Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.
|
98
|
+
test_files:
|
99
|
+
- spec/lib/itaiji/converter_spec.rb
|
100
|
+
- spec/spec_helper.rb
|