Module: PROIEL::Valency::Obliqueness

Defined in:
lib/proiel/valency/obliqueness.rb

Class Method Summary collapse

Class Method Details

.sort_arguments(arguments) ⇒ Object

Sorts arguments by obliqueness



10
11
12
# File 'lib/proiel/valency/obliqueness.rb', line 10

def self.sort_arguments(arguments)
  arguments.sort_by { |argument| obliqueness_of_argument(argument) }
end

.sort_frames(frames) ⇒ Object

Sorts frames by obliqueness



3
4
5
6
7
# File 'lib/proiel/valency/obliqueness.rb', line 3

def self.sort_frames(frames)
  # Sort frames by obliqueness, then by inspecting them so that we get
  # a stable, reproducible order.
  frames.sort_by { |frame| [obliqueness_of_arguments(frame[:arguments]).sort, frame.inspect] }
end