cbeta 2.2.11 → 2.2.12
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.rb +4 -2
- 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: 1ea5929b8d02c71bec290bba134779da82854ae4
|
4
|
+
data.tar.gz: a11e8158fba89f7e4ee7a62ee1c34f89aaa172da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9116664ca58c609da230d54313a8901127163fc67cd4a4c2803469e470205395cf73e75915c6cb18f8683cf8221542f720975f9f298709b40b84054b92d10346
|
7
|
+
data.tar.gz: fd6a0838e7c08e092bf9d9859272f6078bbccf827ac488eefc98ab24e50cdd36ca881bd19dc81b21d21013fcf3136f2cba1d0dabf07b10c31b8491270b23ef61
|
data/lib/cbeta.rb
CHANGED
@@ -8,7 +8,7 @@ require 'csv'
|
|
8
8
|
class CBETA
|
9
9
|
CANON = 'DA|GA|GB|[A-Z]'
|
10
10
|
DATA = File.join(File.dirname(__FILE__), 'data')
|
11
|
-
PUNCS = '.[]
|
11
|
+
PUNCS = '.[]。,、;?:「」『』《》<>〈〉〔〕[]【】〖〗'
|
12
12
|
|
13
13
|
# 由 行首資訊 取得 藏經 ID
|
14
14
|
# @param linehead[String] 行首資訊, 例如 "T01n0001_p0001a01" 或 "GA009n0008_p0003a01"
|
@@ -47,7 +47,9 @@ class CBETA
|
|
47
47
|
# @param fn[String] 檔名, 例如 "T01n0001" 或 "GA009n0008"
|
48
48
|
# @return [String] 典籍編號,例如 "T0001" 或 "GA0008"
|
49
49
|
def self.get_work_id_from_file_basename(fn)
|
50
|
-
fn.sub(/^(#{CANON})\d{2,3}n(.*)$/, '\1\2')
|
50
|
+
r = fn.sub(/^(#{CANON})\d{2,3}n(.*)$/, '\1\2')
|
51
|
+
r = 'T0220' if r.start_with? 'T0220'
|
52
|
+
r
|
51
53
|
end
|
52
54
|
|
53
55
|
# 由「藏經 ID」取得「排序用編號」,例如:傳入 "T" 回傳 "A";傳入 "X" 回傳 "B"
|
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: 2.2.
|
4
|
+
version: 2.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Chou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-26 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
|