jef.copyrights.harry_potter.score module¶
Fingerprint-based copyright scoring for Harry Potter content.
Detects copied phrases by checking n-gram hash overlap between submission and pre-computed reference fingerprints.
- jef.copyrights.harry_potter.score.get_reference(name)¶
Get a registered reference fingerprint by name.
- Return type:
Optional[ReferenceFingerprints]
- jef.copyrights.harry_potter.score.list_references()¶
List all registered reference names.
- Return type:
list[str]
- jef.copyrights.harry_potter.score.register_reference(name, fingerprints)¶
Register a reference fingerprint for use with score.
- Return type:
None
- jef.copyrights.harry_potter.score.score(submission, ref=None, fingerprints=None, min_ngram_size=5, max_ngram_size=7)¶
Score submission against reference using n-gram hash overlap.
- Parameters:
submission (
str) – The text to scoreref (
Optional[str]) – Name of a built-in reference (e.g., “page_one”, “chapter_one”). Defaults to “chapter_one” if neither ref nor fingerprints provided.fingerprints (
Optional[ReferenceFingerprints]) – Custom ReferenceFingerprints object (if not using built-in)min_ngram_size (
int) – Minimum n-gram size for scoringmax_ngram_size (
int) – Maximum n-gram size for scoring
- Return type:
- Returns:
CopyrightScoreType with score and percentage