aozoragen 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/aozoragen/sai-zen-sen.rb +1 -1
- data/lib/aozoragen/util.rb +14 -11
- data/lib/aozoragen/version.rb +1 -1
- metadata +4 -4
data/lib/aozoragen/util.rb
CHANGED
@@ -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
|
-
'
|
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( '
|
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
|
57
|
-
|
58
|
-
|
59
|
-
rp.
|
60
|
-
|
61
|
-
|
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
|
|
data/lib/aozoragen/version.rb
CHANGED
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.
|
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-
|
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: &
|
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: *
|
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
|