original_string: public static function typoFix($str)
      {
  
          //mistakes
          $common_typos = array(
  
              "adn"=>"and",
              "agian"=>"again",
              "ahve"=>"have",
              "ahd"=>"had",
              "alot"=>"a lot",
              "amke"=>"make",
              "arent"=>"aren't",
              "beleif"=>"belief",
              "beleive"=>"believe",
              "broswer"=>"browser",
              "cant"=>"can't",
              "cheif"=>"chief",
              "couldnt"=>"couldn't",
              "comming"=>"coming",
              "didnt"=>"didn't",
              "doesnt"=>"doesn't",
              "dont"=>"don't",
              "ehr"=>"her",
              "esle"=>"else",
              "eyt"=>"yet",
              "feild"=>"field",
              "goign"=>"going",
              "hadnt"=>"hadn't",
              "hasnt"=>"hasn't",
              "hda"=>"had",
              "hed"=>"he'd",
              "hel"=>"he'll",
              "heres"=>"here's",
              "hes"=>"he's",
              "hows"=>"how's",
              "hsa"=>"has",
              "hte"=>"the",
              "htere"=>"there",
              "i'll"=>"I'll",
              "infromation"=>"information",
              "i'm"=>"I'm",
              "isnt"=>"isn't",
              "itll"=>"it'll",
              "itsa"=>"its a",
              "ive"=>"I've",
              "mkae"=>"make",
              "peice"=>"piece",
              "seh"=>"she",
              "shouldnt"=>"shouldn't",
              "shouldve"=>"should've",
              "shoudl"=>"should",
               "somethign"=>"something",
              "taht"=>"that",
              "tahn"=>"than",
              "Teh"=>"The",
              "teh"=>"the",
              "taht"=>"that",
              "thier"=>"their",
              "weve"=>"we've",
              "workign"=>"working"
  
          );
  
          foreach($common_typos as $typo=>$correction){
              $str = preg_replace("~\b".$typo."\b~", $correction, $str);
          }
  
          //fix ; fragments
          $str = str_replace("n;t", "n't", $str);
  
          return $str;
  
  
      }
code: public static function typoFix($str)
      {
  
          //mistakes
          $common_typos = array(
  
              "adn"=>"and",
              "agian"=>"again",
              "ahve"=>"have",
              "ahd"=>"had",
              "alot"=>"a lot",
              "amke"=>"make",
              "arent"=>"aren't",
              "beleif"=>"belief",
              "beleive"=>"believe",
              "broswer"=>"browser",
              "cant"=>"can't",
              "cheif"=>"chief",
              "couldnt"=>"couldn't",
              "comming"=>"coming",
              "didnt"=>"didn't",
              "doesnt"=>"doesn't",
              "dont"=>"don't",
              "ehr"=>"her",
              "esle"=>"else",
              "eyt"=>"yet",
              "feild"=>"field",
              "goign"=>"going",
              "hadnt"=>"hadn't",
              "hasnt"=>"hasn't",
              "hda"=>"had",
              "hed"=>"he'd",
              "hel"=>"he'll",
              "heres"=>"here's",
              "hes"=>"he's",
              "hows"=>"how's",
              "hsa"=>"has",
              "hte"=>"the",
              "htere"=>"there",
              "i'll"=>"I'll",
              "infromation"=>"information",
              "i'm"=>"I'm",
              "isnt"=>"isn't",
              "itll"=>"it'll",
              "itsa"=>"its a",
              "ive"=>"I've",
              "mkae"=>"make",
              "peice"=>"piece",
              "seh"=>"she",
              "shouldnt"=>"shouldn't",
              "shouldve"=>"should've",
              "shoudl"=>"should",
               "somethign"=>"something",
              "taht"=>"that",
              "tahn"=>"than",
              "Teh"=>"The",
              "teh"=>"the",
              "taht"=>"that",
              "thier"=>"their",
              "weve"=>"we've",
              "workign"=>"working"
  
          );
  
          foreach($common_typos as $typo=>$correction){
              $str = preg_replace("~\b".$typo."\b~", $correction, $str);
          }
  
          //fix ; fragments
          $str = str_replace("n;t", "n't", $str);
  
          return $str;
  
  
      }
code_tokens: public static function typoFix ( $ str ) { //mistakes $ common_typos = array ( "adn" => "and" , "agian" => "again" , "ahve" => "have" , "ahd" => "had" , "alot" => "a lot" , "amke" => "make" , "arent" => "aren't" , "beleif" => "belief" , "beleive" => "believe" , "broswer" => "browser" , "cant" => "can't" , "cheif" => "chief" , "couldnt" => "couldn't" , "comming" => "coming" , "didnt" => "didn't" , "doesnt" => "doesn't" , "dont" => "don't" , "ehr" => "her" , "esle" => "else" , "eyt" => "yet" , "feild" => "field" , "goign" => "going" , "hadnt" => "hadn't" , "hasnt" => "hasn't" , "hda" => "had" , "hed" => "he'd" , "hel" => "he'll" , "heres" => "here's" , "hes" => "he's" , "hows" => "how's" , "hsa" => "has" , "hte" => "the" , "htere" => "there" , "i'll" => "I'll" , "infromation" => "information" , "i'm" => "I'm" , "isnt" => "isn't" , "itll" => "it'll" , "itsa" => "its a" , "ive" => "I've" , "mkae" => "make" , "peice" => "piece" , "seh" => "she" , "shouldnt" => "shouldn't" , "shouldve" => "should've" , "shoudl" => "should" , "somethign" => "something" , "taht" => "that" , "tahn" => "than" , "Teh" => "The" , "teh" => "the" , "taht" => "that" , "thier" => "their" , "weve" => "we've" , "workign" => "working" ) ; foreach ( $ common_typos as $ typo => $ correction ) { $ str = preg_replace ( "~\b" . $ typo . "\b~" , $ correction , $ str ) ; } //fix ; fragments $ str = str_replace ( "n;t" , "n't" , $ str ) ; return $ str ; }
docstring: Fixed common typos, can be used directly as it is a static property
  
  <code>
  textBling::typoFix('Teh bird cant fly');
  //returns 'The bird can't fly'
  </code>
  
  @param the text to be cleaned $str
  @return string
docstring_tokens: Fixed common typos can be used directly as it is a static property