diff --git a/src/SIL.Machine/Corpora/CorporaExtensions.cs b/src/SIL.Machine/Corpora/CorporaExtensions.cs index 33186799..f5e1b4b1 100644 --- a/src/SIL.Machine/Corpora/CorporaExtensions.cs +++ b/src/SIL.Machine/Corpora/CorporaExtensions.cs @@ -544,20 +544,12 @@ public static ITextCorpus ChooseRandom( int seed ) { - return new MergedTextCorpus( - new NParallelTextCorpus(corpora) { AllRows = allRows.ToArray() }, - MergeRule.Random, - seed - ); + return new MergedTextCorpus(corpora, allRows.ToArray(), MergeRule.Random, seed); } public static ITextCorpus ChooseFirst(this IEnumerable corpora, IEnumerable allRows) { - return new MergedTextCorpus( - new NParallelTextCorpus(corpora) { AllRows = allRows.ToArray() }, - MergeRule.First, - 0 - ); + return new MergedTextCorpus(corpora, allRows.ToArray(), MergeRule.First, 0); } #endregion diff --git a/src/SIL.Machine/Corpora/MergedTextCorpus.cs b/src/SIL.Machine/Corpora/MergedTextCorpus.cs index 890f7e10..1bcbf822 100644 --- a/src/SIL.Machine/Corpora/MergedTextCorpus.cs +++ b/src/SIL.Machine/Corpora/MergedTextCorpus.cs @@ -13,9 +13,14 @@ public class MergedTextCorpus : TextCorpusBase private readonly Random _random; - public MergedTextCorpus(NParallelTextCorpus nParallelTextCorpus, MergeRule mergeRule, int seed) + public MergedTextCorpus( + IEnumerable corpora, + IEnumerable allRows, + MergeRule mergeRule, + int seed + ) { - _corpus = nParallelTextCorpus; + _corpus = new NParallelTextCorpus(corpora) { AllRows = allRows.ToList() }; _mergeRule = mergeRule; _random = new Random(seed); }