Method: CBETA.linehead_to_xml_file_path
- Defined in:
- lib/cbeta.rb
.linehead_to_xml_file_path(linehead) ⇒ String
由 行首資訊 取得 XML檔相對路徑
30 31 32 33 34 35 36 |
# File 'lib/cbeta.rb', line 30 def self.linehead_to_xml_file_path(linehead) if m = linehead.match(/^(?<work>(?<vol>(?<canon>#{CANON})\d+)n\d+[a-zA-Z]?).*$/) File.join(m[:canon], m[:vol], m[:work]+'.xml') else nil end end |