Microsoft.ProjectOxford.Emotion.Contract.Scores.ToRankedList C# (CSharp) 메소드

ToRankedList() 공개 메소드

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
리턴 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();
        }