cbeta 2.2.12 → 2.2.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ea5929b8d02c71bec290bba134779da82854ae4
4
- data.tar.gz: a11e8158fba89f7e4ee7a62ee1c34f89aaa172da
3
+ metadata.gz: f85cf331ea14599e3332cb7566f8506738bea357
4
+ data.tar.gz: 70cbf2b1c927bac7eeda058ff7bce55658518afb
5
5
  SHA512:
6
- metadata.gz: 9116664ca58c609da230d54313a8901127163fc67cd4a4c2803469e470205395cf73e75915c6cb18f8683cf8221542f720975f9f298709b40b84054b92d10346
7
- data.tar.gz: fd6a0838e7c08e092bf9d9859272f6078bbccf827ac488eefc98ab24e50cdd36ca881bd19dc81b21d21013fcf3136f2cba1d0dabf07b10c31b8491270b23ef61
6
+ metadata.gz: 3ed793af4833af6b5f65b0d1b385e62a4dae5afd8539fe12d82c47ade2efe1c90f980e67c6b98d685fbc40fbfd391ea96f75d8bdf2272c746dc8d7270870446b
7
+ data.tar.gz: b65fb01716e9b2d009b18c655685c3f700c5241e7f1afb9e4548736c96f3726943d610d6e5ceab6693c84978dd66fd2593ac4a6a24bd615eecf1f809e1a46eec
@@ -6,7 +6,8 @@
6
6
  require 'csv'
7
7
 
8
8
  class CBETA
9
- CANON = 'DA|GA|GB|[A-Z]'
9
+ CANON = 'DA|GA|GB|ZS|ZW|[A-Z]'
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)
10
11
  DATA = File.join(File.dirname(__FILE__), 'data')
11
12
  PUNCS = '.[]。,、;?:「」『』《》<>〈〉〔〕[]【】〖〗'
12
13
 
@@ -17,6 +18,13 @@ class CBETA
17
18
  linehead.sub(/^(#{CANON}).*$/, '\1')
18
19
  end
19
20
 
21
+ # 由 典籍編號 取得 藏經 ID
22
+ # @param work[String] 典籍編號, 例如 "T0001" 或 "ZW0001"
23
+ # @return [String] 藏經 ID,例如 "T" 或 "ZW"
24
+ def self.get_canon_id_from_work_id(work)
25
+ work.sub(/^(#{CANON}).*$/, '\1')
26
+ end
27
+
20
28
  # 由 冊號 取得 藏經 ID
21
29
  # @param vol[String] 冊號, 例如 "T01" 或 "GA009"
22
30
  # @return [String] 藏經 ID,例如 "T" 或 "GA"
@@ -57,8 +65,7 @@ class CBETA
57
65
  # @return [String] 排序用編號
58
66
  def self.get_sort_order_from_canon_id(canon)
59
67
  # CBETA 提供,惠敏法師最後決定的全文檢索順序表, 2016-06-03
60
- table = %w(T X A K S F C D U P J L G M N H I W B GA GB)
61
- i = table.index(canon)
68
+ i = SORT_ORDER.index(canon)
62
69
  abort "unknown canon id: #{canon}" if i.nil?
63
70
 
64
71
  (i + 'A'.ord).chr
@@ -533,6 +533,10 @@ class CBETA::P5aToHTML
533
533
  @next_line_buf = ''
534
534
  @open_divs = []
535
535
  @sutra_no = File.basename(xml_fn, ".xml")
536
+
537
+ if @sutra_no.match(/^(T05|T06|T07)n0220/)
538
+ @sutra_no = "#{$1}n0220"
539
+ end
536
540
 
537
541
  text = parse_xml(xml_fn)
538
542
 
@@ -752,11 +756,12 @@ class CBETA::P5aToHTML
752
756
  end
753
757
 
754
758
  def write_juan(juan_no, body)
755
- if @sutra_no.match(/^(T05|T06|T07)n0220/)
756
- fn = "#{$1}n0220_%03d.htm" % juan_no
757
- else
758
- fn = "#{@sutra_no}_%03d.htm" % juan_no
759
- end
759
+ #if @sutra_no.match(/^(T05|T06|T07)n0220/)
760
+ # fn = "#{$1}n0220_%03d.htm" % juan_no
761
+ #else
762
+ # fn = "#{@sutra_no}_%03d.htm" % juan_no
763
+ #end
764
+ fn = "#{@sutra_no}_%03d.htm" % juan_no
760
765
 
761
766
  html = <<eos
762
767
  <html>
@@ -123,8 +123,9 @@ class CBETA::P5aToHTMLForEveryEdition
123
123
 
124
124
  def convert_vol(vol)
125
125
  puts "convert volumn: #{vol}"
126
-
127
- @orig = @cbeta.get_canon_symbol(vol[0])
126
+
127
+ canon = CBETA.get_canon_from_vol(vol)
128
+ @orig = @cbeta.get_canon_symbol(canon)
128
129
  abort "未處理底本" if @orig.nil?
129
130
  @orig_short = @orig.sub(/^【(.*)】$/, '\1')
130
131
 
@@ -7,7 +7,6 @@ F,房山石經,Fangshan shijing,,【房山】,中國佛教圖書文物館,北京
7
7
  G,佛教大藏經,Fojiao Canon,,【佛教】,佛教書局,台北: 佛教書局,1978
8
8
  GA,中國佛寺史志彙刊,Zhongguo Fosi Shizhi Huikan,志彙,【志彙】,杜潔祥,台北:宗青圖書出版公司, 1980-1994
9
9
  GB,中國佛寺志叢刊,Zhongguo fosizhi congkan,志叢,【志叢】,白化文、張智,揚州:廣陵書社,2006
10
- H,正史佛教資料類編,Passages concerning Buddhism from the Official Histories,正史,【正史】,杜斗城,蘭州: 甘肅文化出版社,2006
11
10
  I,北朝佛教石刻拓片百品,Selections of Buddhist Stone Rubbings from the Northern Dynasties,佛拓,【佛拓】,顏娟英,台北: 中央研究院歷史語言研究所,2008
12
11
  J,嘉興大藏經-新文豐版,Jiaxing Canon - Xinwenfeng Edition,嘉興藏,【嘉興】,,徑山藏版版藏 / 台北: 新文豐,1987
13
12
  K,高麗大藏經,Tripiṭaka Koreana,高麗藏,【麗】,,高麗大藏經完刊推進委員會 原刊 / 台北: 新文豐,1982
@@ -20,6 +19,7 @@ R,卍續藏經-新文豐版,Manji Zokuzōkyō - Xinwenfeng Edition,卍續藏,,,
20
19
  S,宋藏遺珍-新文豐版,Songzang yizhen - Xinwenfeng Edition,,【宋遺】,範成,台北: 新文豐,1978
21
20
  T,大正新脩大藏經,Taishō Tripiṭaka,大正藏,【大】,大正新修大藏經刊行會,東京: 大藏出版株式會社,1988
22
21
  U,洪武南藏,Southern Hongwu Edition of the Canon,初刻南藏,【洪武】,,成都: 四川省佛教協會,1999
23
- W,藏外佛教文獻,Buddhist Texts not contained in the Tripiṭaka,藏外,【藏外】,方廣錩,北京: 宗教文化出版社,1995-2003
24
22
  X,卍新纂大日本續藏經,Manji Shinsan Dainihon Zokuzōkyō,新纂卍續藏,【卍續】,河村照孝,東京: 株式會社國書刊行會,1975-1989
25
- Z,卍大日本續藏經,Manji Dainihon Zokuzōkyō,,,,京都: 藏經書院,1905-1912
23
+ Z,卍大日本續藏經,Manji Dainihon Zokuzōkyō,,,,京都: 藏經書院,1905-1912
24
+ ZS,正史佛教資料類編,Passages concerning Buddhism from the Official Histories,正史,【正史】,杜斗城,蘭州: 甘肅文化出版社,2006
25
+ ZW,藏外佛教文獻,Buddhist Texts not contained in the Tripiṭaka,藏外,【藏外】,方廣錩,北京: 宗教文化出版社,1995-2003
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.12
4
+ version: 2.2.18
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-26 00:00:00.000000000 Z
11
+ date: 2016-11-11 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
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  version: '0'
56
56
  requirements: []
57
57
  rubyforge_project:
58
- rubygems_version: 2.5.1
58
+ rubygems_version: 2.6.8
59
59
  signing_key:
60
60
  specification_version: 4
61
61
  summary: CBETA Tools