Exemplo n.º 1
0
 public DocumentSummaryProfile()
 {
     // Creates map to document summary
     // Doesn't need a reciprocal mapping, this is a one-way mapping
     this.CreateMap <data.Document, DocumentSummary>()
     .ForMember(m => m.SummaryText, o => o.MapFrom(src => TextManipulations.Summarize(src.Text)));
 }
Exemplo n.º 2
0
        public void CanStripLyricMarkerWhenSummarizing()
        {
            var text    = $"#{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}\n#{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}";
            var newText = TextManipulations.Summarize(text);

            Assert.IsFalse(newText.Contains('#'));
        }
Exemplo n.º 3
0
        public void CanStripSectionsWhenSummarizing()
        {
            var section = $"[{RandomValueGenerator.AlphaNumericText(10, 20)}]";
            var text    = $"{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}\n{section}";
            var newText = TextManipulations.Summarize(text);

            Assert.IsFalse(newText.Contains(section));
        }
Exemplo n.º 4
0
        public void CanStripAnnotationsWhenSummarizing()
        {
            var annotation = $"!{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}";
            var text       = $"{annotation}\n{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}";
            var newText    = TextManipulations.Summarize(text);

            Assert.IsFalse(newText.Contains('!'));
            Assert.IsFalse(newText.Contains(annotation.Substring(1)));
        }
Exemplo n.º 5
0
        public void CanStripChordsWhenSummarizing()
        {
            var chords  = $"@{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}";
            var text    = $"{chords}\n{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}";
            var newText = TextManipulations.Summarize(text);

            Assert.IsFalse(newText.Contains('@'));
            Assert.IsFalse(newText.Contains(chords.Substring(1)));
        }