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 02:47, 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\/\.][Aa])bcess([^\w\/])/gm, '$1bscess$2');
   str = str.replace(/([^\w\/\.][Aa])breviation([^\w\/])/gm, '$1bbreviation$2');
   str = str.replace(/([^\w\/\.][Aa])bb?riviation([^\w\/])/gm, '$1bbreviation$2');
   str = str.replace(/([^\w\/\.][Aa])bscence([^\w\/])/gm, '$1bsence$2');
   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');
   str = str.replace(/([^\w\/\.])XBox([^\w\/])/gim, '$1Xbox$2');

   return str;
}