Microsoft.ProjectOxford.Emotion.Contract.Scores.ToRankedList C# (CSharp) Method

ToRankedList() public method

Create a sorted key-value pair of emotions and the corresponding scores, sorted from highest score on down. To make the ordering stable, the score is the primary key, and the name is the secondary key.
public ToRankedList ( ) : float>>.IEnumerable
return float>>.IEnumerable
        public IEnumerable<KeyValuePair<string, float>> ToRankedList()
        {
            return new Dictionary<string, float>()
            {
                { "Anger", Anger },
                { "Contempt", Contempt },
                { "Disgust", Disgust },
                { "Fear", Fear },
                { "Happiness", Happiness },
                { "Neutral", Neutral },
                { "Sadness", Sadness },
                { "Surprise", Surprise }
            }
            .OrderByDescending(kv => kv.Value)
            .ThenBy(kv => kv.Key)
            .ToList();
        }