Skip to content

Commit ad2dcf7

Browse files
authored
Fix LT-22241: User Disapproved analyses should be included (#335)
1 parent 0c801a4 commit ad2dcf7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/SIL.LCModel/DomainServices/AnalysisGuessServices.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,12 @@ public bool UpdatingOccurrence(IAnalysis oldAnalysis, IAnalysis newAnalysis)
234234
return result;
235235
}
236236

237-
bool IsNotDisapproved(IWfiAnalysis wa)
237+
bool IncludeAnalysis(IWfiAnalysis wa)
238238
{
239+
// Exclude human-disapproved analyses unless we are in Parsing Dev mode.
239240
ICmAgentEvaluation cae = null;
241+
if (PrioritizeParser)
242+
return true;
240243
foreach (var ae in wa.EvaluationsRC)
241244
if (((ICmAgent)ae.Owner).Human)
242245
cae = ae;
@@ -512,7 +515,7 @@ private IDictionary<IAnalysis, Dictionary<IAnalysis, PriorityCount>> GetAnalysis
512515
// Include analyses that may not have been selected.
513516
foreach (IWfiAnalysis analysis in wordform.AnalysesOC)
514517
{
515-
if (IsNotDisapproved(analysis))
518+
if (IncludeAnalysis(analysis))
516519
{
517520
// Human takes priority over parser which takes priority over computer.
518521
// Approved takes priority over disapproved.
@@ -538,7 +541,7 @@ private Dictionary<IAnalysis, Dictionary<IAnalysis, PriorityCount>> GetGlossCoun
538541
{
539542
var counts = new Dictionary<IAnalysis, Dictionary<IAnalysis, PriorityCount>>();
540543
var segs = new HashSet<ISegment>();
541-
if (!IsNotDisapproved(analysis))
544+
if (!IncludeAnalysis(analysis))
542545
return counts;
543546
foreach (ISegment seg in analysis.Wordform.OccurrencesInTexts)
544547
{

0 commit comments

Comments
 (0)