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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2da6b8607edac4508b64eab96895e6865f62fd11
4
- data.tar.gz: 0d9983bad68a4440b6beb72f87b37bffc9c95d17
3
+ metadata.gz: 56a17abcf86e59784d0d7eed1484ef2e734d8f48
4
+ data.tar.gz: ae7f64f17f7b095de5d42326484b2fe663cc42d5
5
5
  SHA512:
6
- metadata.gz: b568098da999c8c79ed7bbbe4c724a0ea278bd81041355da2d242c673a514779aac61694a57144405b26b41825249580d884bb2f86a69c63e21115834ce0fc4e
7
- data.tar.gz: eb0c7c2b8fcf9398ac4195ff5e8d571db61a737664c11214320f8e2f10947433afef70b9e5629a870b06425262e794d32ad29424a6b2a5355b451fbadb18eba2
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/capollux/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.
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://rubygems.org/gems/braille"
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'
@@ -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
@@ -1,4 +1,4 @@
1
- #encoding: utf-8
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.has_key?(@word)
13
- GROUPS[@word]
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
@@ -1,3 +1,3 @@
1
1
  module Braille
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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: 2017-11-05 00:00:00.000000000 Z
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://rubygems.org/gems/braille
81
+ homepage: https://github.com/zzulu/braille
82
82
  licenses:
83
83
  - MIT
84
84
  metadata: