TextStatistics Class
Provides numerous statistics such as line, word, character counts, and readability scores for text.
public class TextStatistics : ITextStatistics
- Inheritance:
- object object
- Implements:
- ITextStatistics
Constructors
TextStatistics(string)
Initializes an instance of the class.
public TextStatistics(string text)
| Parameter | Type | Description |
|---|---|---|
| text | string | The text to examine and create statistics data. |
Properties
AverageLettersPerWord
The average number of letters per word.
AverageSyllablesPerWord
The average number of syllables per word.
AverageWordsPerSentence
The average number of words per sentence.
Characters
The number of characters in the text.
Consonants
The number of consonants in the text.
FleschKincaidGradeLevel
The Flesch-Kincaid grade level, which indicates the number of years of education required to understand the text.
public double FleschKincaidGradeLevel { get; }
Property Value
Remarks
A grade level of 7.1 indicates that an individual with about 7 years of education could understand the text.
FleschReadingEaseScore
The Flesch reading ease score in the range of 0 to 100, which indicates how readable the text is.
public double FleschReadingEaseScore { get; }
Property Value
Remarks
Scores of 90-100 are considered easily understandable by an average 5th grader. Scores of 60-70 are considered easily understandable by 8th and 9th grade students. Scores of 0-30 are best understood by college graduates.
Letters
The number of letters in the text.
Lines
The number of lines in the text.
NonWhitespaceCharacters
The number of non-whitespace characters in the text.
NonWhitespaceLines
The number of non-whitespace lines in the text.
Sentences
The number of sentences in the text.
Syllables
The number of syllables in the text.
Vowels
The number of vowels in the text.
WhitespaceCharacters
The number of whitespace characters in the text.
WhitespaceLines
The number of whitespace lines in the text.
Words
The number of words in the text.
Methods
CreateStatistic(string, string?, object?)
Creates an ITextStatistic with the specified key and value.
public static ITextStatistic CreateStatistic(string key, string? description, object? value)
| Parameter | Type | Description |
|---|---|---|
| key | string | The key of the statistic. |
| description | string | The description of the statistic, generally displayed in the user interface. |
| value | object | The value of the statistic. |
Returns
GetRawStatistics()
Returns the list of ITextStatistic objects that contain the statistic results.
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()