Class: DidYouMean::ParseDimensions
- Inherits:
-
Object
- Object
- DidYouMean::ParseDimensions
- Defined in:
- lib/did_you_mean/tree_spell_checker.rb
Overview
parses the elements in each dimension
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(dictionary, separator) ⇒ ParseDimensions
constructor
A new instance of ParseDimensions.
Constructor Details
#initialize(dictionary, separator) ⇒ ParseDimensions
Returns a new instance of ParseDimensions.
79 80 81 82 |
# File 'lib/did_you_mean/tree_spell_checker.rb', line 79 def initialize(dictionary, separator) @dictionary = dictionary @separator = separator end |
Instance Method Details
#call ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/did_you_mean/tree_spell_checker.rb', line 84 def call leafless = remove_leaves dimensions = find_elements leafless dimensions.map do |elements| elements.to_set.to_a end end |