コード例 #1
0
        public void RemoveLySuffixes_EndingInInglyAndAtProceedsThat_ReplacesSuffixWithE()
        {
            const string word    = "luxuriated";
            var          stemmer = new SnowballPorterStemmer();

            // Act
            var actual = stemmer.Step1BRemoveLySuffixes(word, stemmer.GetRegion1(word));

            // Assert
            Assert.AreEqual("luxuriate", actual);
        }
コード例 #2
0
        public void RemoveLySuffixes_EndingInIngAndDoubledLetterProceedsThat_RemovesDoubledLetter()
        {
            const string word    = "hopping";
            var          stemmer = new SnowballPorterStemmer();

            // Act
            var actual = stemmer.Step1BRemoveLySuffixes(word, stemmer.GetRegion1(word));

            // Assert
            Assert.AreEqual("hop", actual);
        }
コード例 #3
0
        public void RemoveLySuffixes_EndingInEedlyAndInR1_ReplacesSuffixWithEe()
        {
            const string word    = "inbreedly";
            var          stemmer = new SnowballPorterStemmer();

            // Act
            var actual = stemmer.Step1BRemoveLySuffixes(word, stemmer.GetRegion1(word));

            // Assert
            Assert.AreEqual("inbree", actual);
        }
コード例 #4
0
        public void RemoveLySuffixes_EndingInEdAndDoesNotContainVowel_LeavesWord()
        {
            const string word    = "fred";
            var          stemmer = new SnowballPorterStemmer();

            // Act
            var actual = stemmer.Step1BRemoveLySuffixes(word, stemmer.GetRegion1(word));

            // Assert
            Assert.AreEqual("fred", actual);
        }
コード例 #5
0
        public void RemoveLySuffixes_EndingInIngAndIsShortWord_ReplacesSuffixWithE()
        {
            const string word    = "hoping";
            var          stemmer = new SnowballPorterStemmer();

            // Act
            var actual = stemmer.Step1BRemoveLySuffixes(word, stemmer.GetRegion1(word));

            // Assert
            Assert.AreEqual("hope", actual);
        }
コード例 #6
0
ファイル: RegionTests.cs プロジェクト: sarashakil1/IPTApis
        public void GetRegion1_WithWordContainingRegion1AndRegion2_ProvidesCorrectRangeForRegion1()
        {
            // Arrange
            const string word    = "beautiful";
            var          stemmer = new SnowballPorterStemmer();

            // Act
            var actual = stemmer.GetRegion1(word);

            // Assert
            Assert.AreEqual(5, actual);
        }
コード例 #7
0
ファイル: RegionTests.cs プロジェクト: sarashakil1/IPTApis
        public void GetRegion1_WithWordContainingNeitherRegion_ProvidesRangeWithLength0()
        {
            // Arrange
            const string word    = "beau";
            var          stemmer = new SnowballPorterStemmer();

            // Act
            var actual = stemmer.GetRegion1(word);

            // Assert
            Assert.AreEqual(0, actual - word.Length);
        }