diff --git a/package.json b/package.json index ca02234..0c8eb60 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "publisher": "SiddharthaPrasad", "icon": "images/icon.png", "license": "MIT", - "version": "0.5.4", + "version": "0.5.5", "repository": { "type": "git", "url": "https://github.com/sidprasad/pick-regex" diff --git a/src/pickController.ts b/src/pickController.ts index 6e8a546..b75254a 100644 --- a/src/pickController.ts +++ b/src/pickController.ts @@ -682,15 +682,12 @@ export class PickController { for (const record of this.wordHistory) { if (record.classification === WordClassification.ACCEPT) { for (const candidate of this.candidates) { - if (candidate.eliminated) { - continue; - } if (this.analyzer.verifyMatch(record.word, candidate.pattern)) { candidate.positiveVotes++; } else { // Candidate fails to match an accepted word - negative vote candidate.negativeVotes++; - if (candidate.negativeVotes >= candidate.eliminationThreshold) { + if (!candidate.eliminated && candidate.negativeVotes >= candidate.eliminationThreshold) { candidate.eliminated = true; logger.info( `[Replay] Eliminated candidate "${candidate.pattern}" after ${candidate.negativeVotes} negative votes (threshold ${candidate.eliminationThreshold}) - failed to match accepted word "${record.word}".` @@ -700,18 +697,16 @@ export class PickController { } } else if (record.classification === WordClassification.REJECT) { for (const candidate of this.candidates) { - if (candidate.eliminated) { - continue; - } if (this.analyzer.verifyMatch(record.word, candidate.pattern)) { candidate.negativeVotes++; - if (candidate.negativeVotes >= candidate.eliminationThreshold) { + if (!candidate.eliminated && candidate.negativeVotes >= candidate.eliminationThreshold) { candidate.eliminated = true; logger.info( `[Replay] Eliminated candidate "${candidate.pattern}" after ${candidate.negativeVotes} negative votes (threshold ${candidate.eliminationThreshold}) - incorrectly matched rejected word "${record.word}".` ); } } + // If doesn't match: no vote (correctly rejecting is neutral/expected) } } }