public void SplitEmptyString()
        {
            var t = new TaggedText("");
            var result = t.SplitByClicks();

            Assert.IsNotNull(result, "Returned a null list.");
            Assert.IsFalse(result.Any(), "List contained results.");
        }
        public void TestToString()
        {
            var expected = SentenceWithTags;
            
            var t = new TaggedText(SentenceWithTags);
            var actual = t.ToString();

            Assert.AreEqual(expected, actual, "Didn't produce the original sentence.");
        }
        public void RemoveTagsFromText()
        {
            const string expected = "This has some tags in it.";

            var t = new TaggedText(SentenceWithTags);
            var actual = t.ToPrettyString();

            Assert.AreEqual(expected, actual, "Didn't remove tags properly.");
        }
        public void LeaveStringIntactWhenNoSplit()
        {
            const string sentence = "This has no clicks to split by.";

            var t = new TaggedText(sentence);
            var split = t.SplitByClicks();

            Assert.IsTrue(split.Count == 1, "Split when there wasn't a click.");
            Assert.IsTrue(split[0].Equals("This has no clicks to split by."), "Didn't leave original string intact.");
        }
 private static List<string> ConvertSectionsToCaptions(IEnumerable<string> separatedNotes)
 {
     List<String> captionCollection = new List<string>();
     foreach (string text in separatedNotes)
     {
         TaggedText section = new TaggedText(text);
         String currentCaption = section.ToPrettyString();
         captionCollection.Add(currentCaption);
     }
     return captionCollection;
 }
        public void SplitStringsByClick()
        {
            const string sentence = "This is separated by a click.[afterclick]This is the next part.";

            var t = new TaggedText(sentence);

            var split = t.SplitByClicks();
            Assert.IsTrue(split.Count == 2, "Split into incorrect amount of strings.");
            Assert.IsTrue(split[0].Equals("This is separated by a click."), "First split incorrect.");
            Assert.IsTrue(split[1].Equals("This is the next part."), "Second split incorrect.");
        }
        public static void SaveStringToWaveFiles(string notesText, string folderPath, string fileNameFormat)
        {
            var taggedNotes = new TaggedText(notesText);
            List<String> stringsToSave = taggedNotes.SplitByClicks();
            //MD5 md5 = MD5.Create();

            for (int i = 0; i < stringsToSave.Count; i++)
            {
                String textToSave = stringsToSave[i];
                String baseFileName = String.Format(fileNameFormat, i + 1);
                
                // The first item will autoplay; everything else is triggered by a click.
                String fileName = i > 0 ? baseFileName + " (OnClick)" : baseFileName;

                String filePath = folderPath + "\\" + fileName + ".wav";

                SaveStringToWaveFile(textToSave, filePath);
            }
        }
 private static IEnumerable<string> SplitNotesByClicks(string rawNotes)
 {
     TaggedText taggedNotes = new TaggedText(rawNotes);
     List<String> splitByClicks = taggedNotes.SplitByClicks();
     return splitByClicks;
 }
        private void RefreshScriptList(PowerPointSlide slide)
        {
            var relativeSlideId = GetRelativeSlideIndex(slide.ID);

            var taggedNotes = new TaggedText(slide.NotesPageText.Trim());
            var prettyNotes = taggedNotes.ToPrettyString();
            var splitScript = (new TaggedText(prettyNotes)).SplitByClicks();

            while (relativeSlideId >= _scriptList.Count)
            {
                _scriptList.Add(new List<string>());
            }

            _scriptList[relativeSlideId] = splitScript;
        }
 private static PromptBuilder GetPromptForText(string textToConvert)
 {
     var taggedText = new TaggedText(textToConvert);
     PromptBuilder builder = taggedText.ToPromptBuilder(DefaultVoiceName);
     return builder;
 }