Class: RMMSeg::MMRule

Inherits:
Object
  • Object
show all
Defined in:
lib/rmmseg/mm_rule.rb

Overview

Maximum matching rule, select the chunks with the maximum length.

Instance Method Summary collapse

Instance Method Details

#filter(chunks) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/rmmseg/mm_rule.rb', line 7

def filter(chunks)
  chunks.sort { |a, b|
    b.total_length <=> a.total_length
  }.similar_elements { |a, b|
    a.total_length == b.total_length
  }
end