示例#1
0
文件: parser.c 项目: akkpatel/cs240
int main(int argc, char** argv) {
  char msg[SIZE];
		int len=0;
		int start=0;
		int *pstart=&start; 
		int end=0;
		int *pend=&end;
		int count=0;
		// read in every line of the tweets
  while ((len = readMsg(msg)) != EOF) {
    // get every word in the current line
    *pstart=0;
				*pend=0;
    while (getWord(msg,len,pstart,pend)) {
      // turn the word to small case
//	printf("start %d\n", *pend - *pstart);
//	printf("end %d\n", *pend);
      count = *pstart;
						while(count <= *pend) {
							unCapitalize(msg+count);
							count++;
      }
      // check and process the word
	printf("word %s\n",(msg+*pstart));
      checkWord((msg+*pstart),*pend-*pstart,argv,argc); 
    		
	}
    // output the processed message
    for(count=0;count<len;count++) {
   // putchar(*(msg+count));
    }
  }
  return 0;
}
示例#2
0
int main(int argc, char** argv) {
	int ch=255;
	char a=ch;
	char msg[]="hkyhuyfytfy ytytuy iu";
	msg[0]=a;
	int len;
	int start=0;
	int end=0;
	char* index=msg;
	int i=0;
	

  // read in every line of the tweets
  while ((len=readMsg(msg))!=EOF) {
      start=0;
      end=0;


    // get every word in the current line
    while (getWord(msg,len,&start,&end)) {
	    i=0;
	    while (i<len){
		unCapitalize(index+i);
	    i++;
	      
	    }
      // turn the word to small case
		checkWord(index+start,end-start,argv+1,argc-1);

      // check and process the word
    }
    i=0;
    while(i<len){
      printf("%c", msg[i]);
      i++;
    }
    // output the processed message
  }
  return 0;
}
示例#3
0
文件: parser.c 项目: akkpatel/cs240
int main(int argc, char** argv) {
  char msg[SIZE];
  // read in every line of the tweets 
  //int counter = 0; 
  int length = 0 ; 
  int  start = 0;
  int  end  = 0;  
  while (length = readMsg(msg) != EOF) 
   {

	 unCapitalize (msg); 
	
	    while ( getWord(msg,length,&start, &end) ) 
	   {
	     
		 
	      checkWord(msg,length,argv , argc);	      // check and process the word
	    }
    // output the processed message 
  	
  }
printf("%s", msg);
 return 0;
}