Example #1
0
void ExtractWords(struct word_collection * acol,char * text,unsigned int *textsize)
{
  printf("Extract Words called with input size %u \n",*textsize);
  if ( TextPointerError(text,*textsize) ) { return; }
  unsigned char found_word=0;

  unsigned char * newword = malloc(sizeof(char)*1024);
  unsigned int act_ptr=0;

  unsigned int i=0;
  for ( i=0; i<*textsize; i++)
  {
    if ( ( text[i]==' ' ) || (text[i]=='|') )
    {

      if ( found_word == 1 ) { newword[act_ptr++]=0;
                               UpcaseIt(newword,act_ptr);
                               if ( IgnoreWord(newword , act_ptr ) == 0 )
                               {
                                // printf("%s \n",newword);
                                 AddWord2Collection(acol,newword,act_ptr);
                               }
                             }
      newword [ 0 ] = 0;
      act_ptr=0;
      found_word = 0;
    } else
    {
      newword[act_ptr++]=text[i] ,  found_word = 1;
    }

  }

  free(newword) ;
}
NS_IMETHODIMP 
mozSpellChecker::IgnoreAll(const nsAString &aWord)
{
  if(mPersonalDictionary){
    mPersonalDictionary->IgnoreWord(PromiseFlatString(aWord).get());
  }
  return NS_OK;
}