/// <summary> /// Analyzes the content of a text /// </summary> /// <param name="statistic">statistics object to fill with the results</param> public override void AnalyzeContent(Statistic statistic) { string[] paragraphs = { ".\n" }; statistic.ParagraphsCount = statistic.Client.Text.Split(paragraphs, StringSplitOptions.RemoveEmptyEntries).ToList().Count; if (NextAnalyzer != null) { NextAnalyzer.AnalyzeContent(statistic); } }
/// <summary> /// Analyzes the content of a text /// </summary> /// <param name="statistic">statistics object to fill with the results</param> public override void AnalyzeContent(Statistic statistic) { string res = new String(statistic.Client.Text.Replace("n", "").Replace("N", "").Distinct().ToArray()); statistic.CharCountExcludingN = res.Length; if (NextAnalyzer != null) { NextAnalyzer.AnalyzeContent(statistic); } }
/// <summary> /// Analyzes the content of a text /// </summary> /// <param name="statistic">statistics object to fill with the results</param> public override void AnalyzeContent(Statistic statistic) { string[] chars = { " ", ",", ".", "\n" }; List <string> splittedChars = statistic.Client.Text.Split(chars, StringSplitOptions.RemoveEmptyEntries).ToList(); statistic.WordsEndingWithLowerN = splittedChars.Where(elem => elem.EndsWith("n")).Count(); if (NextAnalyzer != null) { NextAnalyzer.AnalyzeContent(statistic); } }
/// <summary> /// Analyzes the content of a text /// </summary> /// <param name="statistic">statistics object to fill with the results</param> public override void AnalyzeContent(Statistic statistic) { string[] phrases = { ". ", ".\n" }; List <string> splittedChars = statistic.Client.Text.Split(phrases, StringSplitOptions.RemoveEmptyEntries).ToList(); string[] words = { " ", "\n" }; statistic.PhraseMoreThanFifteen = splittedChars.Where(elem => elem.Split(words, StringSplitOptions.RemoveEmptyEntries).Count() > 15).Count(); if (NextAnalyzer != null) { NextAnalyzer.AnalyzeContent(statistic); } }