cbeta 3.0.0 → 3.0.2
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/gaiji.rb +0 -2
- data/lib/cbeta.rb +5 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4e050985d613a2f7763743db83a73781d009e6da4367144a37f162f9716b9e85
|
|
4
|
+
data.tar.gz: 162206ea0675c43ec9cae5c856524a2c5d96be6d5efcf7c79bbc5f2a80ef7251
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21339f1a66dd596949486aa2892c02749ce02af7e5030d4fb0fb44ff09bc12b82be6fa22cf6c97c86fbe878c08adf59e7365bc31fbe80ff620c5885c60953294
|
|
7
|
+
data.tar.gz: 8f42e0ed0fec5745cefb54de171fc0d7f22de0db66c683083c9d0ec0de07949d0cc83be21da5ff0f6b5ca842271aa2bea576a1c0f0a063133e331fab6fafd03a
|
data/lib/cbeta/gaiji.rb
CHANGED
data/lib/cbeta.rb
CHANGED
|
@@ -10,7 +10,7 @@ class CBETA
|
|
|
10
10
|
SORT_ORDER = %w(T X A K S F C D U P J L G M N ZS I ZW B GA GB Y LC TX CC)
|
|
11
11
|
VOL3 = %w[A CC C G GA GB L M P U]
|
|
12
12
|
DATA = File.join(File.dirname(__FILE__), 'data')
|
|
13
|
-
PUNCS = ',.()[] 。‧.,、;?!:︰/()「」『』《》<>〈〉〔〕[]【】〖〗〃…—─
|
|
13
|
+
PUNCS = ',.()[] 。‧.,、;?!:︰/()「」『』《》<>〈〉〔〕[]【】〖〗〃…—─ ~│┬▆△*+-='
|
|
14
14
|
|
|
15
15
|
# 由 行首資訊 取得 藏經 ID
|
|
16
16
|
# @param linehead[String] 行首資訊, 例如 "T01n0001_p0001a01" 或 "GA009n0008_p0003a01"
|
|
@@ -57,9 +57,12 @@ class CBETA
|
|
|
57
57
|
|
|
58
58
|
# 由 行首資訊 取得 XML檔相對路徑
|
|
59
59
|
# @param linehead[String] 行首資訊, 例如 "GA009n0008_p0003a01"
|
|
60
|
+
# ex: J36nB348_p0284c01
|
|
60
61
|
# @return [String] XML檔相對路徑,例如 "GA/GA009/GA009n0008.xml"
|
|
61
62
|
def self.linehead_to_xml_file_path(linehead)
|
|
62
|
-
|
|
63
|
+
# 經號: 四碼數字 + 英文字母 或如 嘉興藏 英文字母 + 三碼數字
|
|
64
|
+
w = '(?:\d+[a-zA-Z]?|[AB]\d{3})'
|
|
65
|
+
if m = linehead.match(/^(?<work>(?<vol>(?<canon>#{CANON})\d+)n#{w}).*$/)
|
|
63
66
|
File.join(m[:canon], m[:vol], m[:work]+'.xml')
|
|
64
67
|
else
|
|
65
68
|
nil
|
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: 3.0.
|
|
4
|
+
version: 3.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ray Chou
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-12-01 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
|
|
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
57
57
|
- !ruby/object:Gem::Version
|
|
58
58
|
version: '0'
|
|
59
59
|
requirements: []
|
|
60
|
-
rubygems_version: 3.4.
|
|
60
|
+
rubygems_version: 3.4.21
|
|
61
61
|
signing_key:
|
|
62
62
|
specification_version: 4
|
|
63
63
|
summary: CBETA Tools
|