Exemplo n.º 1
0
        public IContextSentiment Construct(IWordItemRelationships parent)
        {
            if (parent == null)
            {
                throw new System.ArgumentNullException(nameof(parent));
            }

            var context = new ContextSentimentCalculator(parent);

            context.Process();
            return(context);
        }
        public static IWordItem GetNextByIndex(this IWordItemRelationships current, int index)
        {
            IWordItem currentItem = current.Owner;

            while (index != 0)
            {
                if (currentItem == null)
                {
                    return(null);
                }

                currentItem = index < 0 ? currentItem.Relationship.Previous : currentItem.Relationship.Next;
                index      += index < 0 ? 1 : -1;
            }

            return(currentItem);
        }
 public ContextSentimentCalculator(IWordItemRelationships parent)
 {
     this.parent = parent ?? throw new ArgumentNullException(nameof(parent));
 }