diff --git a/src/SIL.Machine/Corpora/PlaceMarkersUsfmUpdateBlockHandler.cs b/src/SIL.Machine/Corpora/PlaceMarkersUsfmUpdateBlockHandler.cs index f6f272a8..83682c4f 100644 --- a/src/SIL.Machine/Corpora/PlaceMarkersUsfmUpdateBlockHandler.cs +++ b/src/SIL.Machine/Corpora/PlaceMarkersUsfmUpdateBlockHandler.cs @@ -364,7 +364,7 @@ int NumAlignCrossings(int sourceIndex, int targetIndex) int[] hypotheses = new int[] { 0, 1, 2 }; int bestHypothesis = -1; - int bestNumCrossings = 200 ^ 2; + int bestNumCrossings = 40_000; // A large number var checkedHypotheses = new HashSet(); foreach (int hypothesis in hypotheses) { @@ -380,7 +380,7 @@ int NumAlignCrossings(int sourceIndex, int targetIndex) { // If aligning with a source token that precedes the marker, // the target token predicted to be closest to the marker is the last aligned token rather than the first - targetHypothesis = alignedTargetTokens[hypothesis < 0 ? -1 : 0]; + targetHypothesis = alignedTargetTokens[hypothesis < 0 ? alignedTargetTokens.Count - 1 : 0]; } else {