From 54ae4f846776c51d3e74f0640cad11ae2f658a61 Mon Sep 17 00:00:00 2001 From: adash Date: Thu, 19 Nov 2009 19:12:07 +0000 Subject: [PATCH] few changes --- Robust/src/Benchmarks/Distributed/SpamFilter/emails/gen.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Robust/src/Benchmarks/Distributed/SpamFilter/emails/gen.c b/Robust/src/Benchmarks/Distributed/SpamFilter/emails/gen.c index 07ed60f0..53c0d355 100644 --- a/Robust/src/Benchmarks/Distributed/SpamFilter/emails/gen.c +++ b/Robust/src/Benchmarks/Distributed/SpamFilter/emails/gen.c @@ -74,6 +74,7 @@ char** readList(char* fileName,int* num) (*num)++; } + fclose(fp); return list; } @@ -91,7 +92,6 @@ void generateEmails(int num_email,char** wl,int word_num,char** ul,int url_num,c srand(1); for(i=0; i < num_email;i++) { - sprintf(fileNameBuffer,"%s%d",fileName,i+1); newFile = fopen(fileNameBuffer,"w"); @@ -99,7 +99,7 @@ void generateEmails(int num_email,char** wl,int word_num,char** ul,int url_num,c // 60% of email is spam and rest is ham char yes[] = "yes"; char no[] = "no"; - int tmprandindex = rand() % num_email; + int tmprandindex = rand() % 100; if(tmprandindex<60) fprintf(newFile,"Spam: %s\n",yes); else @@ -129,7 +129,8 @@ void generateEmails(int num_email,char** wl,int word_num,char** ul,int url_num,c fprintf(newFile,"\n"); // write Body - bodyLength = rand() % 500 + 300; + //TODO change this to make length of email small + bodyLength = rand() % 200 + 150; for(j=1;j