Method: CBETA.linehead_to_xml_file_path
- Defined in:
- lib/cbeta.rb
.linehead_to_xml_file_path(linehead) ⇒ String
由 行首資訊 取得 XML檔相對路徑
60 61 62 63 64 65 66 |
# File 'lib/cbeta.rb', line 60 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 |