feat(page-cluster): add URL-path and stylesheet blocking-key derivation#902
Merged
Conversation
Add derivePathGroupKey and deriveStylesheetGroupKey, two independent "blocking key" functions (record-linkage sense) that turn a page's URL path segments and loaded-stylesheet list into coarse partition keys. These feed a future classifier's homogeneous-group discovery step, ahead of the expensive structural comparison tokenize()/jaccardSimilarity() already provide. Export HASH_LENGTH from hash-content.ts so deriveStylesheetGroupKey reuses the same hash truncation length instead of picking its own. Add "hrefs" to the cspell word list, used across the new files' JSDoc and tests.
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
derivePathGroupKeyandderiveStylesheetGroupKey: two independent "blocking key" functions (record-linkage sense — see Fellegi-Sunter, canopy clustering, DNF blocking scheme) that turn a page's URL path segments and its loaded-stylesheet URL list into coarse partition keys.tokenize()/jaccardSimilarity()/arrayEditDistance()already provide (PR feat(page-cluster): add Jaccard similarity and array edit distance primitives #900, feat(page-cluster): add frequency-based template/content token split #901). Combining the two keys into an actual grouping decision is intentionally out of scope here — literature on blocking recommends keeping independent blocking predicates separate (OR-combined) rather than merging them into one composite key.HASH_LENGTHfromhash-content.tssoderiveStylesheetGroupKeyreuses the same hash truncation length instead of introducing a second one.Test plan
yarn buildyarn lintyarn test(1164 tests passing)/code-review xhigh(trailing-slash path segments, delimiter-collision in stylesheet hashing, bare-string type-safety hole)