Class: Glossarist::Sts::TermExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/glossarist/sts/term_extractor.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml_path) ⇒ TermExtractor

Returns a new instance of TermExtractor.



6
7
8
9
10
11
# File 'lib/glossarist/sts/term_extractor.rb', line 6

def initialize(xml_path)
  raw = File.read(xml_path)
  @standard = ::Sts::IsoSts::Standard.from_xml(raw)
  @source_ref = extract_source_ref
  @std_prefix = extract_std_prefix(@source_ref)
end

Instance Method Details

#extractObject



13
14
15
16
17
18
19
20
# File 'lib/glossarist/sts/term_extractor.rb', line 13

def extract
  term_secs = collect_term_secs
  term_secs.filter_map do |ts|
    next unless ts.term_entry

    build_extracted_term(ts)
  end
end