Exemple #1
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 NRCRecord FindRecord(this INRCDictionary dictionary, IWordItem word)
        {
            NRCRecord nrcRecord = null;

            foreach (var text in word.GetPossibleText())
            {
                nrcRecord = dictionary.FindRecord(text);
                if (nrcRecord != null)
                {
                    break;
                }
            }

            if (nrcRecord == null)
            {
                return(null);
            }

            nrcRecord = (NRCRecord)nrcRecord.Clone();
            if (word.Relationship?.Inverted != null)
            {
                nrcRecord.Invert();
            }

            return(nrcRecord);
        }
Exemple #3
0
 public StyleFactory(IPOSTagger tagger, INRCDictionary nrcDictionary, IFrequencyListManager frequency, IInquirerManager inquirer)
 {
     this.nrcDictionary = nrcDictionary ?? throw new ArgumentNullException(nameof(nrcDictionary));
     this.frequency     = frequency ?? throw new ArgumentNullException(nameof(frequency));
     this.inquirer      = inquirer ?? throw new ArgumentNullException(nameof(inquirer));
     this.tagger        = tagger ?? throw new ArgumentNullException(nameof(tagger));
 }
        public static SentimentVector Extract(this INRCDictionary dictionary, IEnumerable <IWordItem> words)
        {
            if (dictionary is null)
            {
                throw new ArgumentNullException(nameof(dictionary));
            }

            if (words is null)
            {
                throw new ArgumentNullException(nameof(words));
            }

            var vector = new SentimentVector();

            dictionary.ExtractToVector(vector, words);
            return(vector);
        }
        internal ParsedReview(INRCDictionary dictionary, Document document)
        {
            if (document is null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            if (document.DocumentTime.HasValue &&
                document.DocumentTime.Value.Ticks > 0)
            {
                Date = document.DocumentTime.Value;
            }

            Document = document;
            text     = document.Text;
            Vector   = new ExtractReviewTextVector(dictionary, this);
        }
        public static SentimentVector Extract(this INRCDictionary dictionary, IEnumerable <WordEx> words)
        {
            if (dictionary is null)
            {
                throw new ArgumentNullException(nameof(dictionary));
            }

            if (words is null)
            {
                throw new ArgumentNullException(nameof(words));
            }

            var vector = new SentimentVector();

            foreach (var word in words)
            {
                vector.ExtractData(dictionary.FindRecord(word));
            }

            return(vector);
        }
        public static void ExtractToVector(this INRCDictionary dictionary, SentimentVector vector, IEnumerable <IWordItem> words)
        {
            if (dictionary is null)
            {
                throw new ArgumentNullException(nameof(dictionary));
            }

            if (vector is null)
            {
                throw new ArgumentNullException(nameof(vector));
            }

            if (words is null)
            {
                throw new ArgumentNullException(nameof(words));
            }

            foreach (var word in words)
            {
                vector.ExtractData(dictionary.FindRecord(word));
            }
        }
Exemple #8
0
 public SimplePipelinePersistency(INRCDictionary dictionary, IJsonStreamingWriterFactory resultsWriterFactory)
 {
     this.dictionary           = dictionary;
     this.resultsWriterFactory = resultsWriterFactory;
 }
Exemple #9
0
 public DocumentVectorSource(IStyleFactory styleFactory, INRCDictionary dictionary, AnomalyVectorType anomalyVectorType)
 {
     this.styleFactory      = styleFactory ?? throw new ArgumentNullException(nameof(styleFactory));
     this.dictionary        = dictionary ?? throw new ArgumentNullException(nameof(dictionary));
     this.anomalyVectorType = anomalyVectorType;
 }
 public ClientContext(IProcessingPipeline pipeline, SessionContext context, IAspectSerializer aspectSerializer, INRCDictionary nrcDictionary)
 {
     Pipeline         = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
     Context          = context ?? throw new ArgumentNullException(nameof(context));
     AspectSerializer = aspectSerializer ?? throw new ArgumentNullException(nameof(aspectSerializer));
     NrcDictionary    = nrcDictionary ?? throw new ArgumentNullException(nameof(nrcDictionary));
 }
Exemple #11
0
 public DocumentFromReviewFactory(INRCDictionary nrcDictionary)
 {
     this.nrcDictionary = nrcDictionary ?? throw new ArgumentNullException(nameof(nrcDictionary));
 }
 public ExtractReviewTextVector(INRCDictionary dictionary, IParsedReview review)
 {
     this.review     = review ?? throw new ArgumentNullException(nameof(review));
     this.dictionary = dictionary ?? throw new ArgumentNullException(nameof(dictionary));
 }