From 7185d273d6e5ecd12c5b08aa1ac5831fb6ded6ea Mon Sep 17 00:00:00 2001 From: Peter Chapman Date: Mon, 7 Sep 2026 15:02:46 +1200 Subject: [PATCH] Fix bug with marker location prediction --- src/SIL.Machine/Corpora/PlaceMarkersUsfmUpdateBlockHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SIL.Machine/Corpora/PlaceMarkersUsfmUpdateBlockHandler.cs b/src/SIL.Machine/Corpora/PlaceMarkersUsfmUpdateBlockHandler.cs index f6f272a84..83682c4fa 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 {