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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cbeta/gaiji.rb +0 -2
  3. data/lib/cbeta.rb +5 -2
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 684faece962f8c677e16b74769d30f35576f866a06f50f41f89d9dde7e7ed3c8
4
- data.tar.gz: c11301f4d7c1362d8e2ceb039640dfc4476d8d004c113b7e60ba8df32d76ae54
3
+ metadata.gz: 4e050985d613a2f7763743db83a73781d009e6da4367144a37f162f9716b9e85
4
+ data.tar.gz: 162206ea0675c43ec9cae5c856524a2c5d96be6d5efcf7c79bbc5f2a80ef7251
5
5
  SHA512:
6
- metadata.gz: 4317d299f3f1aab44e1481539c9d059502562db402d0175ef8f2fc9de2284be6c21bb60ba43ad76d4f97cfdc4608bef5f5fae5b9d1210791f8b3657d6b846517
7
- data.tar.gz: d627a0b6aee55a1363be19baa1c731f1c55de354b15aeb673590eb622b3718f865f239076a57ff470d5b4c583b7a89e839bb85654d435a9f52c444c6c2d98a03
6
+ metadata.gz: 21339f1a66dd596949486aa2892c02749ce02af7e5030d4fb0fb44ff09bc12b82be6fa22cf6c97c86fbe878c08adf59e7365bc31fbe80ff620c5885c60953294
7
+ data.tar.gz: 8f42e0ed0fec5745cefb54de171fc0d7f22de0db66c683083c9d0ec0de07949d0cc83be21da5ff0f6b5ca842271aa2bea576a1c0f0a063133e331fab6fafd03a
data/lib/cbeta/gaiji.rb CHANGED
@@ -4,8 +4,6 @@ require 'json'
4
4
  class CBETA::Gaiji
5
5
 
6
6
  # 載入 CBETA 缺字資料庫
7
- #
8
- # @param gaiji_base [String] 缺字資料路徑,可由此下載: https://github.com/cbeta-org/cbeta_gaiji
9
7
  def initialize
10
8
  folder = File.join(File.dirname(__FILE__), '../data')
11
9
  fn = File.join(folder, 'cbeta_gaiji.json')
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
- if m = linehead.match(/^(?<work>(?<vol>(?<canon>#{CANON})\d+)n\d+[a-zA-Z]?).*$/)
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.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-09-08 00:00:00.000000000 Z
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.19
60
+ rubygems_version: 3.4.21
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: CBETA Tools