const replacements = [ ["blöd", "plöd"], ["nein", "neim"], ["ein", "1"], ["bitte", "bidde"], ["Bitte", "Bidde"], ["ich", "i"], ["Ich", "i"], ["auch", "au"], ["noch", "no"], ["Hallo", "Halo"], ["hallo", "halo"], ["bin", "bims"], ["Bin", "Bims"], ["ist", "is"], ["Ist", "Is"], ["danke", "dangge"], ["Danke", "Dangge"], ["t", "dd"], ["mm", "m"], ["n", "m"], ["mir", "mi"], ["Mir", "Mi"], ["die", "di"], ["Die", "Di"], ["Immer", "Imer"], ["immer", "imer"], ["Hab", "Han"], ["hab", "han"] ]; export function schmuser(text) { replacements.forEach(filter => { let replaceFrom = new RegExp(filter[0], 'gm') , replaceTo = filter[1]; text = text.replace(replaceFrom, replaceTo); }); return text; }