Ejemplo n.º 1
0
        private void AddPhonemes(int currentIndex)
        {
            currentResults = Pronunciation.GetLettersPronunciation(currentIndex);

            for (int i = 0; i < currentResults.Count; i++)
            {
                if (currentResults[i] == string.Empty) //AdjacentEvaluation() can return an empty string sometimes.
                {
                    currentResults.RemoveAt(i);

                    if (i == currentResults.Count)
                    {
                        break;
                    }
                }

                if (currentResults[i] != SPACE)
                {
                    AddToTimeline(currentResults[i]);

                    if (syllableMeasure >= SyllableSize - 1)
                    {
                        IncrementSyllables();
                    }

                    else
                    {
                        previousWasSpace = false;
                        syllableMeasure++;
                    }
                }

                else
                {
                    if (previousWasSpace == false) //prevents syllables and actual whitespace from combining.
                    {
                        IncrementSyllables();
                    }

                    else
                    {
                        previousWasSpace = false;
                    }
                }
            }

            if (OutputManager.IsDebugging)
            {
                if (Pronunciation.PreviousProcessUsedDictionary)
                {
                    PossibleDebugOutput.AddDictionaryWord(Pronunciation.WordIsolator.Current, currentResults);
                }

                else
                {
                    PossibleDebugOutput.AddRuleBasedWord(Pronunciation.WordIsolator.Current, currentResults);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialises a new sentence.
        /// </summary>
        /// <param name="inputSentence"></param>
        public void FactoryReset(Sentence inputSentence)
        {
            IsBusy     = false;
            HasAnOrder = true;

            sentence = inputSentence;

            previousWasSpace      = false;
            syllableMeasure       = 0;
            intonationArrayChosen = null;

            currentResults.Clear();

            Pronunciation.FactoryReset(inputSentence);
            timelinesField.Clear();
            PossibleDebugOutput.Clear();
        }