Exemplo n.º 1
0
 private void ReplaceValue(int wordLenght, ISentenceElement element, string newElement)
 {
     if (element.SentenceElementType == SentenceElementTypes.Word && element.Value.Length == wordLenght)
     {
         element.Value = newElement;
     }
 }
Exemplo n.º 2
0
 public void ReplaceValue(int wordLenght, ISentenceElement element, string newValue)
 {
     if (element.SentenceElementType == SentenceElementType.Word && GetWordLength(element) == wordLenght)
     {
         element.Value = newValue;
     }
 }
Exemplo n.º 3
0
 public void ReplaceValue(int wordLenght, ISentenceElement element, string newValue)
 {
     if (element.SentenceElementType == SentenceElementType.Word && GetWordLength(element) == wordLenght)
     {
         element.Value = newValue;
     }
 }
Exemplo n.º 4
0
 public void AddSentenceElement(ISentenceElement element)
 {
     SentenceList.Add(element);
     if (element is Word)
     {
         CountWords++;
     }
 }
Exemplo n.º 5
0
 public bool IsQuestionMark(ISentenceElement element)
 {
     if (element.SentenceElementType == SentenceElementType.PunctuationMark)
     {
         if (element.Value.Equals("?"))
         {
             return true;
         }
         else return false;
     }
     else return false;
 }
Exemplo n.º 6
0
 public bool FirstLetterIsConsonant(ISentenceElement element)
 {
     string pattern = @"[aeiou]";
     if (element.SentenceElementType == SentenceElementType.Word)
     {
         if (!string.IsNullOrEmpty(element.Value) && !(Regex.Matches(element.Value[0].ToString(), pattern).Count > 0))
         {
             return true;
         }
         else return false;
     }
     else return false;
 }
Exemplo n.º 7
0
 public bool IsQuestionMark(ISentenceElement element)
 {
     if (element.SentenceElementType == SentenceElementType.PunctuationMark)
     {
         if (element.Value.Equals("?"))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 8
0
        public bool FirstLetterIsConsonant(ISentenceElement element)
        {
            string pattern = @"[aeiou]";

            if (element.SentenceElementType == SentenceElementType.Word)
            {
                if (!string.IsNullOrEmpty(element.Value) && !(Regex.Matches(element.Value[0].ToString(), pattern).Count > 0))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 9
0
 public void AddElementToEnd(ISentenceElement element)
 {
     _sententenceElements.Add(element);
 }
Exemplo n.º 10
0
 public Sentence(ISentenceElement sentence)
 {
     SentenceElements.Add(sentence);
 }
Exemplo n.º 11
0
 public void AddElementToEnd(ISentenceElement element)
 {
     _sententenceElements.Add(element);
 }
Exemplo n.º 12
0
 public int GetWordLength(ISentenceElement element)
 {
     return(element.Value.Length);
 }
Exemplo n.º 13
0
 public int GetWordLength(ISentenceElement element)
 {
     return element.Value.Length;
 }