This commit is contained in:
parent
499de6df04
commit
94e5d7bfa5
32
README.md
32
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
|
||||
|
2
isspam.c
2
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);
|
||||
|
Loading…
Reference in New Issue
Block a user