Jump to content

User:Symplectic Map/spell.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Symplectic Map (talk | contribs) at 00:43, 13 May 2009. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function common_misspellings(str) {

   str = str.replace(/([^\w][Yy])easr([^\w])/gm, '$1ears$2');
   str = str.replace(/([^\w][Yy])eild((?:s|ing|)[^\w])/gm, '$1ield$2');
   str = str.replace(/([^\w][Yy])elow([^\w])/gm, '$1ellow$2');
   str = str.replace(/([^\w][Yy])era([ ]*[=]?[ ]*[0-9]{4})/gm, '$1ear$2');
   str = str.replace(/([^\w][Yy])ouself([^\w])/gm, '$1ourself$2');
   str = str.replace(/([^\w])X-box([^\w])/gim, '$1Xbox$2');

   return str;

}