Class: Suma::TermExtractor

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

Constant Summary collapse

REDUNDANT_NOTE_REGEX =
%r{
  ^An?                   # Starts with "A" or "An"
  \s.*?\sis\sa\stype\sof # Text followed by "is a type of"
  (\sa|\san)?            # Optional " a" or " an"
  \s\{\{[^\}]*\}\}       # Text in double curly braces
  \s*?\.?$               # Optional whitespace and period at the end
}x

Instance Method Summary collapse

Constructor Details

#initialize(schema_manifest_file, output_path, language_code: "eng") ⇒ TermExtractor

Returns a new instance of TermExtractor.



19
20
21
22
23
# File 'lib/suma/term_extractor.rb', line 19

def initialize(schema_manifest_file, output_path, language_code: "eng")
  @schema_manifest_file = File.expand_path(schema_manifest_file)
  @output_path = output_path
  @language_code = language_code
end

Instance Method Details

#callObject



25
26
27
28
29
# File 'lib/suma/term_extractor.rb', line 25

def call
  get_exp_files.map do |exp_file|
    extract(exp_file)
  end
end