Class: Translator::Expander

Inherits:
Step
  • Object
show all
Defined in:
lib/natural-date/translator/expander.rb

Instance Attribute Summary

Attributes inherited from Step

#language_bundle

Instance Method Summary collapse

Instance Method Details

#map(tokens, reference_date) ⇒ Object



3
4
5
6
7
8
# File 'lib/natural-date/translator/expander.rb', line 3

def map tokens, reference_date
  tokens
  .each_with_index
  .map { |token, index| process_tokens(tokens, token, index) }
  .flatten(1)
end