Exemplo n.º 1
0
        public void Extract(string text, bool clean, bool normalize, int total, string result)
        {
            var instance = new EmojyCleanup();

            instance.Remove        = clean;
            instance.NormalizeText = normalize;
            var extract = instance.Extract(text);

            Assert.AreEqual(total, extract.Emojis.Count());
            Assert.AreEqual(result, extract.Cleaned);
        }
        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();
        }