aozoragen 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,7 +27,7 @@ module Aozoragen
27
27
 
28
28
  def each_chapter
29
29
  @entity.each_chapter do |c|
30
- c[:text] = c[:text].normalize_char.han2zen
30
+ c[:text] = c[:text].normalize_char.han2zen.for_tategaki
31
31
  yield c
32
32
  end
33
33
  end
@@ -12,15 +12,15 @@ class String
12
12
  # Half width of Alphabet and Digit to Full width.
13
13
  #
14
14
  def han2zen
15
- self.tr( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
16
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' )
15
+ self.tr( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,',
16
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,' )
17
17
  end
18
18
 
19
19
  ##
20
20
  # replace characters fitting to vertical lyout
21
21
  #
22
22
  def for_tategaki
23
- self.tr( '<>‐', '〈〉─' ).han2zen
23
+ self.tr( '<>−', '∧∨‐' ).han2zen
24
24
  end
25
25
 
26
26
  ##
@@ -37,8 +37,8 @@ class String
37
37
  #
38
38
  def normalize_char
39
39
  self.tr(
40
- "\u5699\u9830\u525d\u7626\u6451\u5653\u7e6b\uFF0D/",
41
- '噛頬剥痩掴嘘繋─'
40
+ "\u301d\u301f\u5699\u9830\u525d\u7626\u6451\u5653\u7e6b\uFF0D\u6414",
41
+ "〃”噛頬剥痩掴嘘繋─掻"
42
42
  )
43
43
  end
44
44
  end
@@ -53,12 +53,15 @@ module Aozoragen
53
53
  #
54
54
  def detag( elem )
55
55
  # ruby tags
56
- (elem / 'ruby rp').each do |rp|
57
- case rp.text
58
- when ''
59
- rp.inner_html = '《'
60
- when ''
61
- rp.inner_html = ''
56
+ (elem / 'ruby').each do |ruby|
57
+ ruby.inner_html = '|' + ruby.inner_html
58
+ (ruby / 'rp').each do |rp|
59
+ case rp.text
60
+ when ''
61
+ rp.inner_html = ''
62
+ when ')'
63
+ rp.inner_html = '》'
64
+ end
62
65
  end
63
66
  end
64
67
 
@@ -1,3 +1,3 @@
1
1
  module Aozoragen
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aozoragen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-01 00:00:00.000000000 Z
12
+ date: 2012-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &72035520 !ruby/object:Gem::Requirement
16
+ requirement: &82912070 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *72035520
24
+ version_requirements: *82912070
25
25
  description: Scraping some Ebook web site and generating AOZORA format text files.
26
26
  email:
27
27
  - t@tdtds.jp