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
```
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

BIN
isspam

Binary file not shown.

View File

@ -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);