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))); }
public void CanStripLyricMarkerWhenSummarizing() { var text = $"#{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}\n#{RandomValueGenerator.AlphaNumericTextWithSpaces(10, 20)}"; var newText = TextManipulations.Summarize(text); Assert.IsFalse(newText.Contains('#')); }
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)); }
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))); }
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))); }