cbeta 1.1.8 → 1.1.10
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/lib/cbeta/p5a_to_simple_html.rb +4 -1
- data/lib/cbeta/p5a_to_text.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d086755a94ed85a31027336e8536c46657d6ba0b
|
4
|
+
data.tar.gz: 9ecaa54557e756d6dda7bb906013d67e5e816845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b43503f5eddd461851b184a9be2fee712ab345e115baf1ef6418e456ab9afa563296b4e566811ada8059a7e12d48a56c2dbb82b377091d6f6754e434518edfbf
|
7
|
+
data.tar.gz: 14807e47b6f17f4e40be7dc54b4a88ac948f0dea9eb97b7b6f9e2f83c7bdcc63f72c5d856ca40b17c7702de0aa3829c5b3b15325f2567622dcb49b92f084c656
|
@@ -139,7 +139,8 @@ class CBETA::P5aToSimpleHTML
|
|
139
139
|
end
|
140
140
|
|
141
141
|
def handle_lb(e)
|
142
|
-
|
142
|
+
@lb = e['n']
|
143
|
+
r = "<a id='lb#{@lb}'/>"
|
143
144
|
unless @next_line_buf.empty?
|
144
145
|
r += @next_line_buf + "\n"
|
145
146
|
@next_line_buf = ''
|
@@ -161,6 +162,7 @@ class CBETA::P5aToSimpleHTML
|
|
161
162
|
if e['unit'] == 'juan'
|
162
163
|
@juan = e['n'].to_i
|
163
164
|
r += "<juan #{@juan}>"
|
165
|
+
r += "<a id='lb#{@lb}'/>" unless @lb.nil?
|
164
166
|
end
|
165
167
|
r
|
166
168
|
end
|
@@ -228,6 +230,7 @@ class CBETA::P5aToSimpleHTML
|
|
228
230
|
@next_line_buf = ''
|
229
231
|
@open_divs = []
|
230
232
|
@sutra_no = File.basename(xml_fn, ".xml")
|
233
|
+
@lb = nil
|
231
234
|
|
232
235
|
text = parse_xml(xml_fn)
|
233
236
|
|
data/lib/cbeta/p5a_to_text.rb
CHANGED
@@ -41,6 +41,11 @@ class CBETA::P5aToText
|
|
41
41
|
|
42
42
|
# 將 CBETA XML P5a 轉為 Text
|
43
43
|
#
|
44
|
+
# @example for convert all:
|
45
|
+
#
|
46
|
+
# x2h = CBETA::P5aToText.new('/PATH/TO/CBETA/XML/P5a', '/OUTPUT/FOLDER')
|
47
|
+
# x2h.convert
|
48
|
+
#
|
44
49
|
# @example for convert 大正藏第一冊:
|
45
50
|
#
|
46
51
|
# x2h = CBETA::P5aToText.new('/PATH/TO/CBETA/XML/P5a', '/OUTPUT/FOLDER')
|
@@ -369,7 +374,7 @@ class CBETA::P5aToText
|
|
369
374
|
puts "convert sutra #{xml_fn}"
|
370
375
|
@dila_note = 0
|
371
376
|
@div_count = 0
|
372
|
-
@editions = Set.new ["【CBETA】"]
|
377
|
+
@editions = Set.new [@orig, "【CBETA】"] # 至少有底本跟CBETA兩種版本
|
373
378
|
@in_l = false
|
374
379
|
@juan = 0
|
375
380
|
@lg_row_open = false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbeta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Chou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby gem for use Chinese Buddhist Text resources made by CBETA (http://www.cbeta.org).
|
14
14
|
email: zhoubx@gmail.com
|