Example #1
0
 public WordOccurenceFactory(ILogger <WordOccurenceFactory> log, IContextWordsHandler wordsHandlers, IRawTextExtractor extractor, IInquirerManager inquirerManager)
 {
     this.wordsHandlers   = wordsHandlers ?? throw new ArgumentNullException(nameof(wordsHandlers));
     this.extractor       = extractor ?? throw new ArgumentNullException(nameof(extractor));
     this.inquirerManager = inquirerManager ?? throw new ArgumentNullException(nameof(inquirerManager));
     this.log             = log ?? throw new ArgumentNullException(nameof(log));
 }
Example #2
0
 public ParsedReviewManager(IContextWordsHandler manager, IWordFactory wordsFactory, INRCDictionary nrcDictionary, Document document)
 {
     this.manager       = manager ?? throw new ArgumentNullException(nameof(manager));
     this.document      = document ?? throw new ArgumentNullException(nameof(document));
     this.nrcDictionary = nrcDictionary ?? throw new ArgumentNullException(nameof(nrcDictionary));
     this.wordsFactory  = wordsFactory ?? throw new ArgumentNullException(nameof(wordsFactory));
 }
 public static bool IsKnown(this IContextWordsHandler instance, IWordItem word)
 {
     return(instance.IsQuestion(word) ||
            instance.IsFeature(word) ||
            instance.IsInvertAdverb(word) ||
            instance.IsSentiment(word) ||
            instance.MeasureQuantifier(word) > 0);
 }
        public static SentimentValue MeasureSentiment(this IContextWordsHandler instance, IWordItem word)
        {
            if (instance.Context.DisableFeatureSentiment &&
                word.IsFeature)
            {
                return(null);
            }

            return(instance.CheckSentiment(word));
        }
Example #5
0
        public static Phrase Create(IContextWordsHandler wordsHandlers, BasePOSType pos)
        {
            if (wordsHandlers == null)
            {
                throw new System.ArgumentNullException(nameof(wordsHandlers));
            }

            var item = new Phrase(pos);

            item.Relationship = new WordItemRelationships(wordsHandlers, item);
            return(item);
        }
Example #6
0
 public WordItemRelationships(IContextWordsHandler handler, IWordItem parent)
 {
     this.handler = handler;
     Owner        = parent ?? throw new ArgumentNullException(nameof(parent));
     Reset();
 }
        public static bool IsSentiment(this IContextWordsHandler instance, IWordItem word)
        {
            SentimentValue sentiment = instance.MeasureSentiment(word);

            return(sentiment != null);
        }