braille 0.0.2 → 0.0.3
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/README.md +1 -1
- data/braille.gemspec +1 -1
- data/lib/braille/ko/char.rb +7 -0
- data/lib/braille/ko/word.rb +4 -4
- data/lib/braille/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 56a17abcf86e59784d0d7eed1484ef2e734d8f48
|
|
4
|
+
data.tar.gz: ae7f64f17f7b095de5d42326484b2fe663cc42d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aae58d598701883ca4ce96d89d8059800269343d91cadda82e4bea731ae1df48e443a10a4f67b0eb6eced674bdc37183d556f46cf528f8b677d1cb5c191fd844
|
|
7
|
+
data.tar.gz: 780bea2c69df84145568dde4e430e8e153d60de8539ae79acfc9b5a6b601c4b57e784c1684a8eff1718fa57f4774a387feb7b4233562b6a2268ec51c59c6d7ce
|
data/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Braille::Ko.translate('저는 줄루입니다') #=> '⠨⠎⠉⠵ ⠨⠯⠐⠍
|
|
|
36
36
|
|
|
37
37
|
## Contributing
|
|
38
38
|
|
|
39
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
39
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/zzulu/braille. 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.
|
|
40
40
|
|
|
41
41
|
## License
|
|
42
42
|
|
data/braille.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ["capollux10@gmail.com"]
|
|
11
11
|
|
|
12
12
|
spec.summary = "Braille Translator"
|
|
13
|
-
spec.homepage = "https://
|
|
13
|
+
spec.homepage = "https://github.com/zzulu/braille"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
|
|
16
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
data/lib/braille/ko/char.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
#encoding: UTF-8
|
|
1
2
|
module Braille
|
|
2
3
|
module Ko
|
|
3
4
|
class Char < String
|
|
5
|
+
|
|
4
6
|
def number?
|
|
5
7
|
self.scan(/^\d+$/).any?
|
|
6
8
|
end
|
|
@@ -8,6 +10,11 @@ module Braille
|
|
|
8
10
|
def char?
|
|
9
11
|
self.scan(/^\D+$/).any?
|
|
10
12
|
end
|
|
13
|
+
|
|
14
|
+
def punctuation?
|
|
15
|
+
self.scan(/[.,!?]/).any?
|
|
16
|
+
end
|
|
17
|
+
|
|
11
18
|
end
|
|
12
19
|
end
|
|
13
20
|
end
|
data/lib/braille/ko/word.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#encoding:
|
|
1
|
+
#encoding: UTF-8
|
|
2
2
|
module Braille
|
|
3
3
|
module Ko
|
|
4
4
|
class Word
|
|
@@ -9,12 +9,12 @@ module Braille
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def translate
|
|
12
|
-
if GROUPS.
|
|
13
|
-
|
|
12
|
+
if group_arr = GROUPS.detect{|k, v| @word.start_with?(k)} # return Array. ex) ["그래서", "⠁⠎"]
|
|
13
|
+
syllables = @word.delete(group_arr.shift).scan(/[가-힣]/)
|
|
14
14
|
else
|
|
15
15
|
syllables = @word.scan(/[가-힣]/)
|
|
16
|
-
syllables.map {|s| Jaso.new(s).translate }.join('')
|
|
17
16
|
end
|
|
17
|
+
syllables.map{|s| Jaso.new(s).translate }.unshift(*group_arr).join('')
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
end
|
data/lib/braille/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: braille
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Junwoo Hwang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -78,7 +78,7 @@ files:
|
|
|
78
78
|
- lib/braille/ko/jaso.rb
|
|
79
79
|
- lib/braille/ko/word.rb
|
|
80
80
|
- lib/braille/version.rb
|
|
81
|
-
homepage: https://
|
|
81
|
+
homepage: https://github.com/zzulu/braille
|
|
82
82
|
licenses:
|
|
83
83
|
- MIT
|
|
84
84
|
metadata:
|