sharp.utils
Converts an array with scores to a ranking.
If higher rank values are better, set direction to 1 instead.