Beispiel #1
0
        public bool HasSubject()
        {
            if (!this.Args.HasAtLeast(1))
            {
                return(false);
            }

            var arg = this.Args.Args[0];

            if (Preposition.IsPreposition(arg))
            {
                return(false);
            }

            if (Adjective.IsAdjective(arg))
            {
                return(GetSubjectOfAdjectiveAt(0) != null);
            }

            return(true);
        }
Beispiel #2
0
        public int GetPrepositionPosition(string preposition)
        {
            if (!HasPreposition(preposition))
            {
                throw new ArgumentException($"The argument list does not contain the preposition: \"{preposition}\"");
            }

            var order = 1;

            foreach (var arg in this.Args.Args)
            {
                if (arg.ToLower() == preposition.ToLower())
                {
                    break;
                }
                else if (Preposition.IsPreposition(arg))
                {
                    ++order;
                }
            }

            return(order);
        }
Beispiel #3
0
 public int TotalPrepositions()
 {
     return(this.Args.Args
            .Where(a => Preposition.IsPreposition(a))
            .Count());
 }
Beispiel #4
0
 public bool HasAnyPreposition()
 {
     return(this.Args.Args.Any(a => Preposition.IsPreposition(a)));
 }