From 94e5d7bfa5d8444a4d3eb9772bf52ce0e60344ed Mon Sep 17 00:00:00 2001 From: retoor Date: Fri, 29 Nov 2024 07:54:49 +0100 Subject: [PATCH] Update readme. --- README.md | 34 ++++++++++++++++++++++++---------- isspam | Bin 33280 -> 33280 bytes isspam.c | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 17ac97f..348f662 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,29 @@ 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. +File: ./spam/example_spam3.txt +Capitalized words: 39 +Sentences: 20 +Words: 420 +Numbers: 1 +Forbidden words: 15 +<0:recovery> +<1:techie> +<2:https> +<3:digital> +<4:hack> +<5://> +<6:com> +<7:@> +<8:crypto> +<9:bitcoin> +<10:whatsapp> +<11:cryptocurrency> +<12:stolen> +<13:contact> +<14:understanding> +Word count per sentence: 21 +Memory usage: 1 MB, 6.460 (re)allocated, 4.222 unqiue free'd, 0 in use. ``` ## Valgrind status Date: 2024-11-28 @@ -45,4 +59,4 @@ Memory usage: 1 MB, 6.460 (re)allocated, 4.222 unqiue free'd, 0 in use. ==131498== ==131498== For lists of detected and suppressed errors, rerun with: -s ==131498== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -``` \ No newline at end of file +``` diff --git a/isspam b/isspam index a4e5d89e3fde6f5aab83ebd55a6f2b0ee8567c72..8c32a25ecc2f0fc23797d8975995fcd6454586ff 100755 GIT binary patch delta 901 zcmZXSZAep57{|}q99^?E6&L%EXtuJT7gvgRn;ULydai5)Q6F?!8JPK@EGa0{Hn@%$ zb7Y;qsDwygf`nc!L=>2qSs4bs*c*|hhIc}kLTP24o_kj`=ze)F_xJq&&;L2+hFUeD zR?Sror+POb_3=s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Fl$+4%Z3el;K2+MN4>mionI^$@A zSC5Ud&$qfBf0F6~JB!A1H?Vd$Tj6G{9(IR^HF;R0hh=Xph0_0zE9Nd_B~z{|owNd`18O diff --git a/isspam.c b/isspam.c index 96f42d0..95b3aac 100644 --- a/isspam.c +++ b/isspam.c @@ -321,7 +321,7 @@ void analyze(FILE *f) { stra(all, sbuf); free(sbuf); strd(all); - ulonglong word_count_per_sentence = words->count / sentences->count; + ulonglong word_count_per_sentence = words->count / (sentences->count ? sentences->count : 1); printf("Word count per sentence: %llu\n", word_count_per_sentence); slf(capitalized_words);