Update readme.
All checks were successful
isspam build / build (push) Successful in 33s

This commit is contained in:
retoor 2024-11-29 07:54:49 +01:00
parent 499de6df04
commit 94e5d7bfa5
3 changed files with 25 additions and 11 deletions

View File

@ -22,15 +22,29 @@ cat ./spam/example_spam1.txt | ./isspam
``` ```
## Example output ## Example output
``` ```
File: ./not_spam/not_spam1.txt File: ./spam/example_spam3.txt
Capitalized words: 1 Capitalized words: 39
Sentences: 5 Sentences: 20
Words: 52 Words: 420
Numbers: 0 Numbers: 1
Forbidden words: 0 Forbidden words: 15
Word count per sentence: 10 <0:recovery>
<1:techie>
Memory usage: 29 KB, 479 (re)allocated, 327 unqiue free'd, 0 in use. <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 ## Valgrind status
Date: 2024-11-28 Date: 2024-11-28

BIN
isspam

Binary file not shown.

View File

@ -321,7 +321,7 @@ void analyze(FILE *f) {
stra(all, sbuf); stra(all, sbuf);
free(sbuf); free(sbuf);
strd(all); 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); printf("Word count per sentence: %llu\n", word_count_per_sentence);
slf(capitalized_words); slf(capitalized_words);