Transliteration Plugin to prosemirror

Hello I was wondering if anyone can help me change this into a prosemirror plugin to change the text as a user types by replacing characters as they type. I tried using handleDomEvents to accomplish the event handling but prosemirror seems to abstract away the dom. Can anyone please help me out. Thank you.

	var char = e.target.value;
	console.log(char);
	char = char.replace(/[äâ]/g, "e");
	char = char.replace(/[êëē]/g, "é");

	char = char.replace(/[əǝ]/g, "");
	char = char.replace(/w/g, "ው");
	char = char.replace(/ውe/g, "ወ");
	char = char.replace(/ውu/g, "ዉ");
	char = char.replace(/ውi/g, "ዊ");
	char = char.replace(/ውa/g, "ዋ");
	char = char.replace(/ውe/g, "ዌ");
	char = char.replace(/ውé/g, "ዌ");
	char = char.replace(/ውo/g, "ዎ");
var startPos = e.target.selectionStart;
	var endPos = e.target.selectionEnd;

	var beforeLen = e.target.value.length;
	var afterLen = char.length;
	var adjustment = afterLen - beforeLen;

	e.target.value = char;
	e.target.selectionStart = startPos + adjustment;
	e.target.selectionEnd = endPos + adjustment;

You may be looking for the prosemirror-inputrules extension.

Can you give me an example for using that extenstion in terms of transliteration. Since I need to replace every character with some sort of JSON object containing the transliteration mapping?