|
using System;
using System.Collections.Generic;
namespace Gma.CodeCloud.Controls.TextAnalyses.Processing
{
public struct Word : IWord
{
public string Text { get; private set; }
public int Occurrences { get; private set; }
public Word(KeyValuePair<string, int> textOccurrencesPair)
: this(textOccurrencesPair.Key, textOccurrencesPair.Value)
{
}
public Word(string text, int occurrences)
: this()
{
Text = text;
Occurrences = occurrences;
}
public int CompareTo(IWord other)
{
return this.Occurrences - other.Occurrences;
}
public string GetCaption()
{
return string.Format("{0} - occurrences", Occurrences);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.