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

   return str;

}