feat(#731): delegate title matching to core SimilarityEngine#74
Merged
Conversation
Migrates data-machine-events to use the unified SimilarityEngine from core (Extra-Chill/data-machine#731) instead of maintaining its own duplicate title normalization and fuzzy matching. Changed: - EventIdentifierGenerator: extractCoreTitle(), titlesMatch(), normalize_dashes(), normalize_text() replaced with thin wrappers delegating to SimilarityEngine. Venue matching stays (domain-specific). - DuplicateDetectionAbilities: removed data-machine-events/titles-match ability (superseded by core datamachine/titles-match). Added event strategy registration on datamachine_duplicate_strategies filter so core check-duplicate ability can find event duplicates. - EventIdentifierGeneratorTest: fixed test_rightmost_delimiter_used (was testing nonexistent behavior), added venue matching tests and SimilarityEngine delegation verification test. Requires: data-machine >= 0.39.0 (SimilarityEngine + DuplicateCheckAbility)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
data-machine-eventsto use the unifiedSimilarityEnginefrom core (data-machine#731, data-machine#732) instead of maintaining its own duplicate title normalization and fuzzy matching.extractCoreTitle(),titlesMatch(),normalize_dashes(),normalize_text()all delegate toSimilarityEngine. Venue matching stays (domain-specific, not in core).data-machine-events/titles-matchability (superseded by core'sdatamachine/titles-match). Added event strategy registration ondatamachine_duplicate_strategiesfilter.EventIdentifierGenerator, which now delegates).What Changed
inc/Utilities/EventIdentifierGenerator.phpSimilarityEnginefor title ops; venue matching staysinc/Abilities/DuplicateDetectionAbilities.phpdatamachine_duplicate_strategiesfilter registrationtests/Unit/EventIdentifierGeneratorTest.phpStrategy Registration
The events plugin now registers on core's
datamachine_duplicate_strategiesfilter:When core's
datamachine/check-duplicateis called for theeventpost type withcontext.venueandcontext.startDate, this strategy fires first — using venue + date + fuzzy title matching.Code Removed
normalize_dashes()— was identical copy of core's implementationnormalize_text()— replaced bySimilarityEngine::normalizeBasic()extractCoreTitle()body — replaced bySimilarityEngine::normalizeTitle()titlesMatch()body — replaced bySimilarityEngine::titlesMatch()data-machine-events/titles-matchability — superseded bydatamachine/titles-matchTest Fix
test_rightmost_delimiter_usedwas renamed totest_earliest_delimiter_used— the old test asserted behavior inconsistent with the actual leftmost-wins algorithm (the test would have failed if CI were running). New test correctly asserts that': 'at position 8 wins over' - 'at position 20.Dependency
Requires
data-machine >= 0.39.0(SimilarityEngine + DuplicateCheckAbility from PR #732).Relates to Extra-Chill/data-machine#731