diff --git a/src/SIL.Machine/Corpora/ParallelTextCorpus.cs b/src/SIL.Machine/Corpora/ParallelTextCorpus.cs index 89e8d6c1..53d07257 100644 --- a/src/SIL.Machine/Corpora/ParallelTextCorpus.cs +++ b/src/SIL.Machine/Corpora/ParallelTextCorpus.cs @@ -17,7 +17,7 @@ public ParallelTextCorpus( TargetCorpus = targetCorpus; AlignmentCorpus = alignmentCorpus ?? new DictionaryAlignmentCorpus(); RowRefComparer = rowRefComparer ?? new NParallelTextCorpus.DefaultRowRefComparer(); - NParallelTextCorpus = new NParallelTextCorpus(new List { SourceCorpus, TargetCorpus }); + _nParallelTextCorpus = new NParallelTextCorpus(new List { SourceCorpus, TargetCorpus }); } public override bool IsSourceTokenized => SourceCorpus.IsTokenized; @@ -31,15 +31,15 @@ public ParallelTextCorpus( public IAlignmentCorpus AlignmentCorpus { get; } public IComparer RowRefComparer { get; } - public NParallelTextCorpus NParallelTextCorpus { get; } + private readonly NParallelTextCorpus _nParallelTextCorpus; public override IEnumerable GetRows(IEnumerable textIds) { using (IEnumerator alignmentEnumerator = AlignmentCorpus.GetEnumerator()) { - NParallelTextCorpus.AllRows = new bool[] { AllSourceRows, AllTargetRows }; + _nParallelTextCorpus.AllRows = new bool[] { AllSourceRows, AllTargetRows }; bool isScripture = SourceCorpus.IsScripture() && TargetCorpus.IsScripture(); - foreach (var nRow in NParallelTextCorpus.GetRows(textIds)) + foreach (var nRow in _nParallelTextCorpus.GetRows(textIds)) { int compareAlignmentCorpus = -1; if (AlignmentCorpus != null && nRow.NSegments.All(s => s.Count > 0))