ununiga 1.0.5 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba3a6e4a5a9023da9b44f1db856da4767da1b420
4
- data.tar.gz: 02e38f649944d332beff596de783cae5f91a5562
3
+ metadata.gz: 2a6cd6f64015b8f7953b7f137dde4cb518d83570
4
+ data.tar.gz: 3eecc09dad0872f94113a0c881e1e2433963824d
5
5
  SHA512:
6
- metadata.gz: 073e6a27c58282fd604b37e4db7cfcece428e28f741cd38958dfb48dfa6283ebf97abf3552095e51a6fa7552392e15343b34aee4e9432890a5d3d306a5be9abe
7
- data.tar.gz: 02a2d84b29788a89745417e28e100bd651122a810ea833957900228aaafca26b5d3e439ae9e183bda87a37334177a51f1a3fe71ac0dde97d8e147e05bf8d2952
6
+ metadata.gz: f62ec9fb9ececf09c436b3569ea5576d1deccb9bcc6ace422ec35110611b422abb1a2899a1c8881263163946013596d890e2834dff1d1e9033bd2b4fba56fde1
7
+ data.tar.gz: a9e280ed653d7fa8495c8f571209fea16c212846c53502a322cbeedf861b7e5b19c07edcf0fdac419dd3c22ff697db09edfb89a50cd13da6db954a3424da4255
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ununiga (1.0.4)
4
+ ununiga (1.0.5)
5
5
 
6
6
  GEM
7
7
  remote: http://www.rubygems.org/
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 keepcosmos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
@@ -17,7 +17,7 @@ module Ununiga
17
17
  #
18
18
  class JasoSplitter
19
19
  CHOSUNGS = %w(ㄱ ㄲ ㄴ ㄷ ㄸ ㄹ ㅁ ㅂ ㅃ ㅅ ㅆ ㅇ ㅈ ㅉ ㅊ ㅋ ㅌ ㅍ ㅎ).freeze
20
- JUNGSUNGS = %w(ㅏ ㅐ ㅑ ㅒ ㅓ ㅔ ㅕ ㅖ ㅗ ㅘ ㅙ ㅚ ㅜ ㅝ ㅞ ㅟ ㅠ ㅡ ㅢ ㅣ).freeze
20
+ JUNGSUNGS = %w(ㅏ ㅐ ㅑ ㅒ ㅓ ㅔ ㅕ ㅖ ㅗ ㅘ ㅙ ㅚ ㅜ ㅝ ㅞ ㅟ ㅠ ㅡ ㅢ ㅣ).freeze
21
21
  JONGSUNGS = %w(ㄱ ㄲ ㄳ ㄴ ㄵ ㄶ ㄷ ㄹ ㄺ ㄻ ㄼ ㄽ ㄾ ㄿ ㅀ ㅁ ㅂ ㅄ ㅅ ㅆ ㅇ ㅈ ㅊ ㅋ ㅌ ㅍ ㅎ).unshift(nil).freeze
22
22
  KR_RANGE = ('가'.unpack('U')[0]..'힣'.unpack('U')[0]).freeze
23
23
  KR_OFFSET = KR_RANGE.first.freeze
@@ -28,7 +28,7 @@ module Ununiga
28
28
  if index == 0
29
29
  matched
30
30
  else
31
- josa = JOSAS.find { |josa| josa_convension(josa).include? matched }
31
+ josa = JOSAS.find { |jo| josa_convension(jo).include? matched }
32
32
  splitter = JasoSplitter.new(korean_str[index - 1])
33
33
  josa[(splitter.jongsung ? 0 : 1)]
34
34
  end
@@ -1,7 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
  require 'ununiga/jaso_splitter'
3
3
 
4
- class JamoSplitterTest < Minitest::Unit::TestCase
4
+ class JamoSplitterTest < Minitest::Test
5
5
  def test_extract_chosung
6
6
  testgroup = { '가' => 'ㄱ',
7
7
  '낳' => 'ㄴ',
@@ -18,7 +18,9 @@ class JamoSplitterTest < Minitest::Unit::TestCase
18
18
  testgroup = { '가' => 'ㅏ',
19
19
  '내' => 'ㅐ',
20
20
  '찋' => 'ㅢ',
21
- '휷' => 'ㅠ'
21
+ '휷' => 'ㅠ',
22
+ '쿄' => 'ㅛ',
23
+ '왜' => 'ㅙ'
22
24
  }
23
25
  testgroup.each do |char, jungsung|
24
26
  splitter = Ununiga::JasoSplitter.new(char)
@@ -34,14 +36,19 @@ class JamoSplitterTest < Minitest::Unit::TestCase
34
36
  }
35
37
  testgroup.each do |char, jongsung|
36
38
  splitter = Ununiga::JasoSplitter.new(char)
37
- assert_equal jongsung, splitter.extract_jongsung
39
+ if jongsung
40
+ assert_equal jongsung, splitter.extract_jongsung
41
+ else
42
+ assert_nil splitter.extract_jongsung
43
+ end
38
44
  end
39
45
  end
40
46
 
41
47
  def test_split
42
48
  testgroup = { '신' => ['ㅅ', 'ㅣ', 'ㄴ'],
43
49
  '재' => ['ㅈ', 'ㅐ', nil],
44
- '현' => ['ㅎ', 'ㅕ', 'ㄴ']
50
+ '현' => ['ㅎ', 'ㅕ', 'ㄴ'],
51
+ '꾢' => ['ㄲ', 'ㅛ', 'ㄶ']
45
52
  }
46
53
  testgroup.each do |char, splitted|
47
54
  splitter = Ununiga::JasoSplitter.new(char)
@@ -1,7 +1,7 @@
1
1
  require 'minitest/autorun'
2
2
  require 'ununiga/josa_picker'
3
3
 
4
- class JosaPickerTest < Minitest::Unit::TestCase
4
+ class JosaPickerTest < Minitest::Test
5
5
  def test_takewell
6
6
  assert_equal '철수가 개발을 좋아합니다.', takewell('철수이(가) 개발을(를) 좋아합니다.')
7
7
 
@@ -2,7 +2,7 @@ require 'minitest/autorun'
2
2
  require 'i18n'
3
3
  require 'ununiga/i18n/josa_transformer'
4
4
 
5
- class JosaTransformerTest < Minitest::Unit::TestCase
5
+ class JosaTransformerTest < Minitest::Test
6
6
  def setup
7
7
  super
8
8
  I18n::Backend::Simple.send(:include, Ununiga::I18n::JosaTransformer)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ununiga'
3
- s.version = '1.0.5'
3
+ s.version = '1.1.0'
4
4
  s.date = '2016-01-25'
5
5
  s.summary = 'Support Jaso and Josa(Korean Language specific function)'
6
6
  s.description = '한글 자소 분리 및 적절한 조사를 찾아주어 번역해줍니다.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ununiga
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaehyun Shin
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: "한글 자소 분리 및 적절한 조사를 찾아주어 번역해줍니다."
41
+ description: 한글 자소 분리 및 적절한 조사를 찾아주어 번역해줍니다.
42
42
  email: keepcosmos@gmail.com
43
43
  executables: []
44
44
  extensions: []
@@ -48,6 +48,7 @@ files:
48
48
  - ".travis.yml"
49
49
  - Gemfile
50
50
  - Gemfile.lock
51
+ - LICENSE.txt
51
52
  - README.md
52
53
  - Rakefile
53
54
  - lib/ununiga.rb
@@ -80,9 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  version: '0'
81
82
  requirements: []
82
83
  rubyforge_project:
83
- rubygems_version: 2.6.4
84
+ rubygems_version: 2.6.11
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: Support Jaso and Josa(Korean Language specific function)
87
88
  test_files: []
88
- has_rdoc: