コード例 #1
0
ファイル: TextStatistics.cs プロジェクト: BenSeawalker/Labs
        //////
        // END PROPERTIES
        //////////////////////////////////////////////////////////////////////

        public TextStatistics(string text)
        {
            Text           = text;
            WordCount      = TextCounter.CountWords(text);
            CharacterCount = TextCounter.CountCharacters(text);
            //InstancesOfThe = TextCounter.CountMatchingWords(text, "the");
            AverageWordLength = TextCounter.GetAverageWordLength(text);
        }
コード例 #2
0
ファイル: TextStatistics.cs プロジェクト: BenSeawalker/Labs
 public int InstancesOf(string matching)
 {
     return(TextCounter.CountMatchingWords(Text, matching));
 }