コード例 #1
0
        public ExtendedWords(ILexiconConfiguration path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            resourcesPath = Path.Combine(path.LexiconPath, "Repair");
            ReadIdioms();
            ReadSlang();
        }
コード例 #2
0
        public SentenceRepairHandler(ILexiconConfiguration path, IWordsDictionary dictionary)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            cleanup = new EmojyCleanup();
            cleanup.NormalizeText = false;
            resourcesPath         = Path.Combine(path.LexiconPath, "Repair");
            this.dictionary       = dictionary ?? throw new ArgumentNullException(nameof(dictionary));
            Load();
        }
コード例 #3
0
        public OpenNLPTextSplitter(ILogger <OpenNLPTextSplitter> log,
                                   ILexiconConfiguration configuration,
                                   ICachedDocumentsSource cache,
                                   ISentenceTokenizerFactory tokenizerFactory,
                                   ISentenceRepairHandler repairHandler)
            : base(log, cache)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            this.log           = log ?? throw new ArgumentNullException(nameof(log));
            this.repairHandler = repairHandler ?? throw new ArgumentNullException(nameof(repairHandler));
            log.LogDebug("Creating with resource path: {0}", configuration.ResourcePath);
            tokenizer        = TreebankWordTokenizer.Tokenizer;
            sentenceSplitter = tokenizerFactory.Create(true, false);
            LoadModels(configuration.ResourcePath);
        }
コード例 #4
0
 public WordsHandler(ILexiconConfiguration config, IExtendedWords extended)
 {
     this.config   = config ?? throw new ArgumentNullException(nameof(config));
     this.extended = extended ?? throw new ArgumentNullException(nameof(extended));
     sentimentData = new SentimentDataHolder();
 }