null+****@clear*****
null+****@clear*****
Thu Jul 26 01:42:00 JST 2012
SUZUKI Miho 2012-07-26 01:42:00 +0900 (Thu, 26 Jul 2012) New Revision: 35af5f95ab36602b2a6c8721d5b6ee3adc050fa1 https://github.com/logaling/logaling-command/commit/35af5f95ab36602b2a6c8721d5b6ee3adc050fa1 Merged 2ef1dde: Merge pull request #73 from logaling/add-itil-glossary Log: Add standard nomenclature to abbreviation Modified files: lib/logaling/external_glossaries/itil_japanese.rb Modified: lib/logaling/external_glossaries/itil_japanese.rb (+10 -3) =================================================================== --- lib/logaling/external_glossaries/itil_japanese.rb 2012-07-25 18:05:09 +0900 (9c9dead) +++ lib/logaling/external_glossaries/itil_japanese.rb 2012-07-26 01:42:00 +0900 (7c23fab) @@ -29,11 +29,18 @@ module Logaling # open local html file because web resources are PDF or MS Word file... file_path = File.join(File.dirname(__FILE__), "resources", "ITIL_2011_Japanese_Glossary_v1.0.html") doc = Nokogiri::HTML(File.open(file_path), nil, "utf-8") - indexes = [0,2] + abbreviation = false doc.css('table tr')[1..-1].each do |tr| p = tr.children[0].css('p').first - indexes = [0,6] and next if p['class'] == 'WLBody' - csv << indexes.map{|i| format_text(tr.children[i].text)} + abbreviation = true and next if p['class'] == 'WLBody' + + source_term = format_text(tr.children[0].text) + unless abbreviation + target_term = format_text(tr.children[2].text) + else + target_term = sprintf("%s %s", format_text(tr.children[4].text), format_text(tr.children[6].text)) + end + csv << [source_term, target_term] end end -------------- next part -------------- An HTML attachment was scrubbed... 다운로드