Ejemplo n.º 1
0
        public void GetWordsWithDuplicates_7WordTokens_Returns7WordsWithDuplicatesList()
        {
            ITokenService tokenService = new StubTokenService();
            var           tokens       = tokenService.GetTokens("");

            List <IWord> words = _service.GetWordsWithDuplicates(tokens);

            Assert.AreEqual(7, words.Count);
        }
Ejemplo n.º 2
0
        public void GetTFIDFWords_7WordTokens_Returns5TFIDFWordsList()
        {
            ITokenService tokenService   = new StubTokenService();
            var           tokens         = tokenService.GetTokens(String.Empty);
            var           countSentences = tokenService.GetCountSentences(tokens);

            List <ITFIDFWord> words = _service.GetTFIDFWords(tokens, countSentences);

            Assert.AreEqual(5, words.Count);
        }
Ejemplo n.º 3
0
        public void GetWords_7WordTokens_Returns5WordsWithoutDuplicatesList()
        {
            ITokenService tokenService = new StubTokenService();
            var           tokens       = tokenService.GetTokens(String.Empty);

            List <IWord> words = _service.GetWords(tokens);

            Assert.AreEqual(5, words.Count);
            Assert.AreEqual(2, words.First(w => w.Value == "второе").Positions.Count());
            Assert.AreEqual(2, words.First(w => w.Value == "третье").Positions.Count());
        }