public void Add(Word word, Rhythm rhythm) { if (rhythm.IsEmpty) { m_words.Add(word); } else { var next = rhythm.IsStressed ? m_stressed : m_unstressed; next.Value.Add(word, rhythm.GetShifted()); } }
public IEnumerable <Word> GetSatisfied(Rhythm rhythm) { if (rhythm.IsEmpty) { return(m_words); } else { var nextNode = rhythm.IsStressed ? m_stressed : m_unstressed; return(nextNode.Value.GetSatisfied(rhythm.GetShifted()).Concat(m_words)); } }