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
# 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
end

Instance Method Details

#extractObject



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

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

    build_extracted_term(ts)
  end
end