From ef1a7a54b4ec05f01b7649d71b20cdb9967071e1 Mon Sep 17 00:00:00 2001 From: retoor Date: Fri, 29 Nov 2024 06:45:06 +0100 Subject: [PATCH] Update --- .gitignore | 1 + isspam | Bin 28952 -> 33280 bytes isspam.c | 64 +++++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 56 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 9053540..27b1df6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .history .vscode +publish diff --git a/isspam b/isspam index bfde85cfd1303de65916db1f2f98846d30fecfb5..645427cdcab8ef46b4d2a3c05c5033edf0a27dd0 100755 GIT binary patch delta 11649 zcmZu%30PFu*}iw+8YIeqGO{Rw2#U)fsKf>6ZDaIulH&8*-pc2JI6XWPV*f<%- zU{8~ptu;&go2^A@tVygA7c^EIVod9jC~BgYV3ep))WrGU@0@di%-{Pw%y-WFt>-)Y zE>!K#d*LN0GlPaO2u7Y&HU&~B3R~@F# zVlS&_dNqs_On*9)r18vTFIfuJne02u#_*564!bXE*;5C)KRftuQ#$nAFt*{%6*U_I zzSL5?31MZHph2=4D#H!(!|QGAw;hw6wPS@`QqeEfK9zWiA6_r<;ePm+63_I*PfJ|) z!!HQjsTBG#45={94{wrqksp3V;tT!oYZ5Q_!*57@1;?F=VkYXYWUTR12#~$A-VYC! zc$FU>Ch^UFc$CDqw8!CJiI z`r&_+cw8$!TsV41GLl*u0^cd|6hC~=xSDI7N;)|Esfyywy_e^{p?hZsIlL8hp$@P8 z64nBTH{&`;<7ybP#wvB%PZLnmJzaHgTH+u@Nv+jg`-1jZ02)@G&!>ByZUJi^SfcJe zpt}zm;k}{czH0Qi=kpm)-iL}e?K13gMcwJ%n_6pp4jy2|gaPdafR+S_OkSFh~L_7pO=BG)6*KekL;& zlj4D;OYAhqmQSkFwiLi?V;9)rEw^y90lbkJA2`s!%y|5~i**p{ac0;$Z;Zyyb+tX@ zO}k0Vpcf!xklAUrE*el;YT-Y!kH##SN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R;qiruo#h6woh!ZA_Jym#iYpnGEKG1il9Z2( z1$|ZRfzKB>`e|KBj_l7)mQ1p2v9aLNNtP3tY(eSoeT!)DB86Kxtz;Qq0dh|kR2J@A zQ_L|MA(VEp;CDGU0P0tvVHN;d`wvd+nJ;5#P&ru3Gr9Gw>QM`N{ zWlDPmULoRCW1y1ssVOhoWK34@z5-71Uh5IFb}rvniiqSE1`2oYkXv$h_60&gM_3B% z(g-fIhZ8A;$xjF5CJJr@zOyJ@NPvBVsFC4^y2?Eb0Ye5SHHyw9yl;{{v zX(@XdT)W^#jO6GG!du1;J{?e81FkPTmC`vEYp9WSm|9`H{A+<96!^{<4!k4qPYpZ4 z(%T-vI&FA(PiRTBC?aj-MC!?={xZNGhDs^WdNG~@k%WWNaNrcfxYD9Y%33GA8%}oQB>hdWvOg#$jG@%s{#qmFKA}toU4{jkSUB+mqw1ORc zHbAZt*Rl3E2` zErx)YaZ)>Q8Zs5dylQi$v|_`?U}hgI@l_I$k0fv8T-LlKK%T;O;n%@@pQFB|{CfHg zdJ}SFtH{IF2gI#i``j*>WiK1T9Lq-59$L0ruKnHfVRG$X%X`VS$5+%^YV9kVyIB4l z!xpSc>|rj8`dGGk6_$DnyR<6N_y7Gr8ymQKm~U(rcip5bS@G&I`0uvOt0&_B;m#Sq z!M~jdx1YdoA=`}KsqCEb8*Hci6UOgmcount; i++) { printf("<%u:%s>\n", i, lst->strings[i]); @@ -244,7 +263,6 @@ sl *get_forbidden_words(char *content) { slf(words); return found; } - void analyze(FILE *f) { char *data = fread_till_eof(f); @@ -259,6 +277,8 @@ void analyze(FILE *f) { sl *capitalized_words = get_capitalized_words(data); uint capitalized_words_count = capitalized_words->count; printf("Capitalized words: %u\n", capitalized_words_count); + if(show_capitalized) + sld(capitalized_words); sbuf = slds(capitalized_words); stra(all, sbuf); free(sbuf); @@ -267,7 +287,8 @@ void analyze(FILE *f) { // All sentences printf("Sentences: %u\n", sentences->count); - // sld(sentences); + if(show_sentences) + sld(sentences); sbuf = slds(sentences); stra(all, sbuf); free(sbuf); @@ -276,7 +297,8 @@ void analyze(FILE *f) { // All words printf("Words: %u\n", words->count); - // sld(words); + if(show_words) + sld(words); sbuf = slds(words); stra(all, sbuf); free(sbuf); @@ -284,7 +306,8 @@ void analyze(FILE *f) { // Numbers sl *numbers = get_numbers(data); printf("Numbers: %u\n", numbers->count); - // sld(numbers); + if(show_numbers) + sld(numbers); sbuf = slds(numbers); stra(all, sbuf); free(sbuf); @@ -292,11 +315,11 @@ void analyze(FILE *f) { // Forbidden words sl *fw = get_forbidden_words(data); printf("Forbidden words: %u\n", fw->count); - // sld(fw); + if(show_forbidden_words) + sld(fw); sbuf = slds(fw); stra(all, sbuf); free(sbuf); - strd(all); uint word_count_per_sentence = words->count / sentences->count; printf("Word count per sentence: %u\n", word_count_per_sentence); @@ -317,17 +340,40 @@ void analyze_file(char *path) { } int main(int argc, char *argv[]) { - + if (argc > 1) { for (int i = 1; i < argc; i++) { + if(!strcmp(argv[1],"--hide-capitalized")){ + show_capitalized=false; + }else if(!strcmp(argv[1],"--show-sentences")){ + show_sentences=true; + }else if(!strcmp(argv[1],"--show-words")){ + show_words=true; + }else if(!strcmp(argv[1],"--show-numbers")){ + show_words=true; + }else if(!strcmp(argv[1],"--hide-forbidden-words")){ + show_forbidden_words=false; + }else if(!strcmp(argv[1],"help") || !strcmp(argv[1],"--help")){ + printf("%s", + "Usage: spam [file] [file] [file]\n" + "Flag defaults:\n" + " hide-capitalized = true\n" + " show-sentences = false\n" + " show-words = false\n" + " show-numbers = false\n" + " hide-forbidden-words = false\n"); + return 0; + } + printf("File: %s\n", argv[i]); analyze_file(argv[i]); + printf("%s\n", rmalloc_stats()); printf("\n"); } - printf("%s\n", rmalloc_stats()); + return 0; } analyze(stdin); printf("%s\n", rmalloc_stats()); return 0; -} \ No newline at end of file +}