Show HN: Surprisal – a language identifier in ~250 lines of C. No ML,no training
By iushh · 2026-10-13 · 1 points · 0 comments
https://github.com/ahhyoushh/zip-surprisal
I made a text/language identifier today, in a single C file, with no ML. It classifies a text by checking which reference text a hand-rolled greedy LZ77 compressor finds least surprising. Each class is just a file of reference data. For a query, it sums the bits the compres…
Open the full discussion on BetterNews