retoor 284544880d fix: remove locale-specific formatting and increase stats buffer size
- Remove the apostrophe flag from sprintf format specifier in rmalloc_lld_format to avoid locale-dependent thousands separator, which caused unexpected commas in output
- Increase static buffer size in rmalloc_stats from 200 to 300 bytes to prevent potential buffer overflow when formatting memory statistics with larger values
2024-11-29 05:49:48 +00:00

Isspam

Fast as light evaluator for text files to summarize specific details about the text files.

Building

make build

Build with memory check (requires valgrind to be installed):

make valgrind

Running

Using files as parameter

./isspam ./spam/*.txt
./isspam ./not_spam/*.txt

Using stdin

Useful for automation.

cat ./spam/example_spam1.txt | ./isspam

Example output

File: ./not_spam/not_spam1.txt
Capitalized words: 1
Sentences: 5
Words: 52
Numbers: 0
Forbidden words: 0
Word count per sentence: 10

Memory usage: 29 KB, 479 (re)allocated, 327 unqiue free'd, 0 in use.

Valgrind status

Date: 2024-11-28

Memory usage: 1 MB, 6.460 (re)allocated, 4.222 unqiue free'd, 0 in use.
==131498== 
==131498== HEAP SUMMARY:
==131498==     in use at exit: 0 bytes in 0 blocks
==131498==   total heap usage: 6,486 allocs, 6,486 frees, 2,342,294 bytes allocated
==131498== 
==131498== All heap blocks were freed -- no leaks are possible
==131498== 
==131498== For lists of detected and suppressed errors, rerun with: -s
==131498== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
S
Description
For a site I was doing spam analysis, how to recognize it. I do this by checking how it is written. How much numbers are used. How many capitals. That's the first indication. I made it originally myself but a few people liked the project and wrote their versions in their preferred language. Very happy about that. We are bench marking it as challenge, the benchmark is doing analysis for 900 books in txt format. The fastest application wins. By now, every language has as wel won as lost. We keep iterating and making them faster. Thanks 12bitloat, BordedDev en JestDotty for contribution of their source.
Readme
486 MiB
Languages
Rust 73%
C++ 12.9%
C 6.8%
Swift 3.4%
Python 2.2%
Other 1.6%