Class: Translator::ExpressionSplitter

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

Instance Attribute Summary

Attributes inherited from Step

#language_bundle

Instance Method Summary collapse

Instance Method Details

#map(tokens) ⇒ Object



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

def map tokens
  tokens
    .lines
    .map { |l| l.strip }
    .join(';')
    .gsub(';', ' ; ')
    .split(language_bundle.separator_regexp)
end