Class: CSKitStrongs::Splitters::HebrewLexiconSplitter
- Inherits:
-
Object
- Object
- CSKitStrongs::Splitters::HebrewLexiconSplitter
- Includes:
- Utilities, Enumerable
- Defined in:
- lib/cskit-strongs/splitters/hebrew_lexicon_splitter.rb
Instance Attribute Summary collapse
-
#input_file ⇒ Object
readonly
Returns the value of attribute input_file.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(input_file) ⇒ HebrewLexiconSplitter
constructor
A new instance of HebrewLexiconSplitter.
Methods included from Utilities
Constructor Details
#initialize(input_file) ⇒ HebrewLexiconSplitter
Returns a new instance of HebrewLexiconSplitter.
13 14 15 |
# File 'lib/cskit-strongs/splitters/hebrew_lexicon_splitter.rb', line 13 def initialize(input_file) @input_file = input_file end |
Instance Attribute Details
#input_file ⇒ Object (readonly)
Returns the value of attribute input_file.
11 12 13 |
# File 'lib/cskit-strongs/splitters/hebrew_lexicon_splitter.rb', line 11 def input_file @input_file end |
Instance Method Details
#each ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/cskit-strongs/splitters/hebrew_lexicon_splitter.rb', line 17 def each doc = parse_file(input_file) results = (doc / :entry).each do |entry| attrs = pronunciation_for(entry). merge(lang_attrs_for(entry)). merge(definition_for(entry)) number = strip_zeroes(entry.attributes["id"].value.downcase) attrs.merge!(:strongs_number => number) yield number, attrs end end |