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