/// <summary>
 /// Get intermediate phrase of the word.
 /// </summary>
 /// <param name="word">Script word.</param>
 /// <returns>Intermediate phrase of the script word.</returns>
 public ScriptProsodicWord GetProsodicWord(ScriptWord word)
 {
     ScriptIntermediatePhrase intermediatePhrase = GetIntermediatePhrase(word);
     ScriptProsodicWord prosodicWord = intermediatePhrase.GetProsodicWord(word);
     Helper.ThrowIfNull(prosodicWord);
     return prosodicWord;
 }
        /// <summary>
        /// Get intermediate phrase of the word.
        /// </summary>
        /// <param name="word">Script word.</param>
        /// <returns>Intermediate phrase of the script word.</returns>
        public ScriptIntermediatePhrase GetIntermediatePhrase(ScriptWord word)
        {
            ScriptIntermediatePhrase intermediatePhrase = null;
            foreach (ScriptIntermediatePhrase phrase in IntermediatePhrases)
            {
                ScriptProsodicWord prosodicWord = phrase.GetProsodicWord(word);
                if (prosodicWord != null)
                {
                    intermediatePhrase = phrase;
                    break;
                }
            }

            return intermediatePhrase;
        }
        /// <summary>
        /// Get prosodic word contains this word.
        /// </summary>
        /// <param name="scriptWord">Script word.</param>
        /// <returns>Prosodic word contained this word.</returns>
        public ScriptProsodicWord GetProsodicWord(ScriptWord scriptWord)
        {
            Helper.ThrowIfNull(ProsodicWords);
            Helper.ThrowIfNull(scriptWord);
            ScriptProsodicWord foundProsodicWord = null;
            foreach (ScriptProsodicWord prosodicWord in ProsodicWords)
            {
                if (prosodicWord.Words.Contains(scriptWord))
                {
                    foundProsodicWord = prosodicWord;
                    break;
                }
            }

            return foundProsodicWord;
        }