Skip to content

Copyright detection regression after implementing gibberish detection #4676

Open

Description

@JonoYang

Certain copyrights are not detected anymore as the gibberish detector identifies it as gibberish:

https://github.com/aboutcode-org/scancode-toolkit/blob/2402-detect-gibberish-copyright/tests/cluecode/data/copyrights/scilab-Scilab#L67

  • an instance of Scilab (c) INRIA-ENPC. was not detected
  • c) INRIA-ENPC. is identified as gibberish

https://github.com/aboutcode-org/scancode-toolkit/blob/2402-detect-gibberish-copyright/tests/cluecode/data/copyrights/misco4/linux-copyrights/Documentation/networking/arcnet-hardware.txt#L32

  • this did not detect Copyright Waterloo Microsystems Inc. 1985
  • @Copyright is identified as gibberish

https://github.com/aboutcode-org/scancode-toolkit/blob/2402-detect-gibberish-copyright/tests/cluecode/data/authors/trailing_date#L3C19-L3C59

  • Alexander Kanavin <alex.kanavin@gmail.com> was not detected
  • * : commit 3debe362faa62e5b381b880e3ba23aee07c85f6e Author: is detected as gibberish

Originally posted by @JonoYang in #4610 (comment)

Activity

  1. Jayant-kernel commented on Jan 13, 2026

    @Jayant-kernel

    "Hi @JonoYang, I would like to work on this issue.
    I can investigate why these copyright strings are being flagged as gibberish and try to fix the detection logic."

  2. added 10 commits that reference this issue on Jan 13, 2026
  3. VaaishnaviS commented on Jan 14, 2026

    @VaaishnaviS

    Hi @JonoYang,
    I have investigated the detection logic and found that the normalize() function is stripping legal symbols (like © and (c) ), which causes the Markov chain to flag these strings as gibberish.

    I have developed a fix that introduces a whitelist of legal indicators to be checked before normalization. I am opening a Pull Request for this now.

  4. added 4 commits that reference this issue on Jan 14, 2026
    f339f4c
    f599464
    3792fcd
    91e23c4
  5. Jayant-kernel commented on Jan 15, 2026

    @Jayant-kernel

    Hi @JonoYang, I've implemented a fix for this issue in PR #4678.
    Summary of changes:

    • Added length threshold (≤4 chars) to prevent short legitimate strings from being flagged as gibberish
    • Implemented conditional threshold logic to handle overlapping probabilities during training
    • All tests passing locally (gibberish tests + copyright detection tests)
      The fix resolves the test_gibberish_basic failure where strings like "yay!" were incorrectly flagged as gibberish.
      Ready for review!
  6. added a commit that references this issue on Jan 16, 2026
    0549381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions