示例#1
0
        private RatingAdjustment(IParsedReview review, IMachineSentiment model)
            : base(review)
        {
            if (review is null)
            {
                throw new ArgumentNullException(nameof(review));
            }

            Model = model ?? throw new ArgumentNullException(nameof(model));
        }
示例#2
0
        public static IRatingAdjustment Create(IParsedReview review, IMachineSentiment model = null)
        {
            if (model == null || model is NullMachineSentiment)
            {
                return(new NullRatingAdjustment(review));
            }

            var adjustment = new RatingAdjustment(review, model);

            adjustment.CalculateRating();
            return(adjustment);
        }