Example #1
0
        /// <summary>
        ///   Boolean to show whether the input string matches the specified number of syllables for this line
        /// </summary>
        /// <param name="candidateText"> The <see cref="string" /> to analyze </param>
        /// <returns> True if the candidate string matches the syllable count, otherwise false </returns>
        public bool CanRead(string candidateText)
        {
            var tokens = new WordTokenizer(candidateText).GetTokens();

            var syllableCount = tokens.Sum(token => new SyllableAnalyzer(token).GetCount());
            return syllableCount == Syllables;
        }
Example #2
0
        /// <summary>
        ///   Boolean to show whether the input string matches the specified number of syllables for this line
        /// </summary>
        /// <param name="candidateText"> The <see cref="string" /> to analyze </param>
        /// <returns> True if the candidate string matches the syllable count, otherwise false </returns>
        public bool CanRead(string candidateText)
        {
            var tokens = new WordTokenizer(candidateText).GetTokens();

            var syllableCount = tokens.Sum(token => new SyllableAnalyzer(token).GetCount());

            return(syllableCount == Syllables);
        }