public static IEnumerable<PhraseSequence> AggregateWords(this IEnumerable<PhraseSequence> phrases) { HashSet<PhraseSequenceElement> phraseSequenceSet = new HashSet<PhraseSequenceElement>(new PhraseElementComparerator()); foreach (var p in phrases) { phraseSequenceSet.AddValidWords(p); } return phraseSequenceSet.Select(w => new PhraseSequence(w)); }