예제 #1
0
        public void ProperNounsSuffixedWithSNeedAnAposBeforeTheSCorrect()
        {
            var p = new Paragraph("Susan owns a hat. It is Susan's hat.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .ToList();

            Assert.AreEqual(0, c.Count);
        }
예제 #2
0
        public void ContractionsNeedAnApostropheCorrect()
        {
            var p = new Paragraph("Barry doesn't own a car. The car isn't Barry's.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .ToList();

            Assert.AreEqual(0, c.Count);
        }
예제 #3
0
        public void RegularNounsDoNotNeedAnApostropheCorrect()
        {
            var p = new Paragraph("Look at those airplanes over there.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .ToList();

            Assert.AreEqual(0, c.Count);
        }
예제 #4
0
        public void ProperNounsPrecededByIsNeedAnAposBeforeTheSCorrect()
        {
            var p = new Paragraph("Barry owns a car. The car is Barry's.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .ToList();

            Assert.AreEqual(0, c.Count);
        }
예제 #5
0
        public void ProperNounsPrecededByIsNeedAnAposBeforeTheSIncorrect()
        {
            var p = new Paragraph("Barry owns a car. The car is Barrys.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .Single();

            Assert.AreEqual(CorrectionType.OwnershipByAProperNoun, c.Type);
            Assert.AreEqual("The car is Barrys", c.Sentence);
            Assert.AreEqual("Barrys", c.Word);
        }
예제 #6
0
        public void ProperNounsSuffixedWithSNeedAnAposBeforeTheSIncorrect()
        {
            var p = new Paragraph("Susan owns a hat. It is Susans hat.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .Single();

            Assert.AreEqual(CorrectionType.OwnershipByAProperNoun, c.Type);
            Assert.AreEqual("It is Susans hat", c.Sentence);
            Assert.AreEqual("Susans", c.Word);
        }
예제 #7
0
        public void RegularNounsDoNotNeedAnApostropheIncorrect()
        {
            var p = new Paragraph("Look at those airplane's over there.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .Single();

            Assert.AreEqual(CorrectionType.IncorrectNounApostrophe, c.Type);
            Assert.AreEqual("Look at those airplane's over there", c.Sentence);
            Assert.AreEqual("airplane's", c.Word);
        }
예제 #8
0
        public void ContractionsNeedAnApostropheIncorrect()
        {
            var p = new Paragraph("Barry doesnt own a car. The car isnt Barry's.");
            var c = CorrectionFactory.CreateCorrectionFinder()
                    .Find(p)
                    .ToList();

            var doesntCorrection = c[0];

            Assert.AreEqual(CorrectionType.MissingContractionApostrophe, doesntCorrection.Type);
            Assert.AreEqual("Barry doesnt own a car", doesntCorrection.Sentence);
            Assert.AreEqual("doesnt", doesntCorrection.Word);

            var isntCorrection = c[1];

            Assert.AreEqual(CorrectionType.MissingContractionApostrophe, isntCorrection.Type);
            Assert.AreEqual("The car isnt Barry's", isntCorrection.Sentence);
            Assert.AreEqual("isnt", isntCorrection.Word);
        }