Пример #1
0
        private IProcessable ProcessElement(Adverb adv, ISentenceGraph graph)
        {
            // Let each noun process the adverb
            foreach (var noun in this.Nouns)
            {
                noun.Process(adv, graph);
            }

            return(this);
        }
        /// <summary>
        /// Changes scale if adverb is change scale modifier
        /// </summary>
        /// <param name="adv">Adverb</param>
        /// <returns>True if scale was changed</returns>
        private bool ChangeScale(Adverb adv)
        {
            if (ScaleModifiers.Contains(adv.Lemma))
            {
                this.Scale = this.Scale > 1 ? this.Scale * ScaleChange : this.Scale / ScaleChange;
                return(true);
            }

            return(false);
        }
Пример #3
0
        private IProcessable ProcessElement(Adverb adv, ISentenceGraph graph)
        {
            // check if it is part of this verb
            if (this.DependencyHelper.IsCompound(adv.DependencyType))
            {
                this.PhrasePart = adv;
            }
            else if (adv.Id > this.Id)
            {
                this.ExtensionsAfter.Add(adv);
            }
            else
            {
                this.ExtensionsBefore.Add(adv);
            }

            return(this);
        }
        protected sealed override IProcessable ProcessElement(Adverb adv, ISentenceGraph graph)
        {
            // Go through all adverbs and find modifier ones
            adv.ExtendingAdverbs.SelectMany(advs => advs.ExtendingAdverbs).Select(ad =>
            {
                if (this.ChangeScale(ad))
                {
                    this.Extensions.Add(ad);
                }

                return(ad);
            }).ToList();

            if (this.ChangeScale(adv))
            {
                this.Extensions.Add(adv);
            }

            return(this);
        }
Пример #5
0
 private IProcessable ProcessElement(Adverb adv, ISentenceGraph graph)
 {
     this.ExtendingAdverbs.Add(adv);
     return(this);
 }
Пример #6
0
 protected virtual IProcessable ProcessElement(Adverb adv, ISentenceGraph graph)
 {
     this.Extensions.Add(adv);
     return(this);
 }