require('mw.ustring')

heUtils = require('Module:he-utilities')
heLetters = heUtils.letters
heVowels = heUtils.vowels

p = {}

function p.finalToMedial(word)
	word = mw.ustring.gsub(word, heLetters.kafSofit, heLetters.kaf)
	word = mw.ustring.gsub(word, heLetters.memSofit, heLetters.mem)
	word = mw.ustring.gsub(word, heLetters.nunSofit, heLetters.nun)
	word = mw.ustring.gsub(word, heLetters.peiSofit, heLetters.pei .. heVowels.rafe)
	word = mw.ustring.gsub(word, heLetters.tsadiSofit, heLetters.tsadi)
	return word
end

return p