text: public WeightedPhraseInfo(ICollection<WeightedPhraseInfo> toMerge){IEnumerator<Toffs>[] allToffs = new IEnumerator<Toffs>[toMerge.Count];try{using (IEnumerator<WeightedPhraseInfo> toMergeItr = toMerge.GetEnumerator()){if (!toMergeItr.MoveNext()){throw new ArgumentException("toMerge must contain at least one WeightedPhraseInfo.");}WeightedPhraseInfo first = toMergeItr.Current;termsInfos = new List<TermInfo>();seqnum = first.seqnum;boost = first.boost;allToffs[0] = first.termsOffsets.GetEnumerator();int index = 1;while (toMergeItr.MoveNext()){WeightedPhraseInfo info = toMergeItr.Current;boost += info.boost;termsInfos.AddRange(info.termsInfos);allToffs[index++] = info.termsOffsets.GetEnumerator();}using (MergedIterator<Toffs> itr = new MergedIterator<Toffs>(false, allToffs)){termsOffsets = new List<Toffs>();if (!itr.MoveNext()){return;}Toffs work = itr.Current;while (itr.MoveNext()){Toffs current = itr.Current;if (current.StartOffset <= work.EndOffset){work.EndOffset = Math.Max(work.EndOffset, current.EndOffset);}else{termsOffsets.Add(work);work = current;}}termsOffsets.Add(work);}}}finally{foreach (var allToff in allToffs){allToff.Dispose();}}}