title: Basic Profanity Filter in Objective C for iPhone
body: <p>How have you like minded individuals tackled the basic challenge of filtering profanity, obviously one can't possibly tackle every scenario but it would be nice to have one at the most basic level as a first line of defense.</p>
  
  <p>In Obj-c I've got </p>
  
  <pre><code>NSString *tokens = [text componentsSeparatedByString:@" "];
  </code></pre>
  
  <p>And then I loop through each token to see if any of the keywords (I've got about 400 in a list) are found within each token.</p>
  
  <p>Realising False positives are also a problem, if the word is a perfect match, its flagged as profanity otherwise if more than 3 words with profanity are found without being perfect matches it is also flagged as profanity.</p>
  
  <p>Later on I will use a webservice that tackles the problem more precisely, but I really just need something basic. So if you wrote the word penis it would go yup naughty naughty, bad word written.</p>