Class: CBETA::BMToText

Inherits:
Object
  • Object
show all
Defined in:
lib/cbeta/bm_to_text.rb

Overview

將 CBETA Basic Markup 格式檔 轉為 純文字(含行首資訊)

CBETA Basic Markup 格式可由此取得: github.com/mahawu/BM_u8

Example:

bm2t = CBETA::BMToText.new('/temp/cbeta-bm', '/temp/cbeta-text1')
bm2t.convert('T01')  # 執行大正藏第一冊

Instance Method Summary collapse

Constructor Details

#initialize(bm_root, out_root) ⇒ BMToText



15
16
17
18
# File 'lib/cbeta/bm_to_text.rb', line 15

def initialize(bm_root, out_root)
  @bm_root = bm_root
  @out_root = out_root
end

Instance Method Details

#convert(vol) ⇒ Object



21
22
23
24
# File 'lib/cbeta/bm_to_text.rb', line 21

def convert(vol)
  @corpus = vol[0]
  handle_vol(vol)
end