refactoring of romanjiToHiragana function

refactoring of romanjiToHiragana function to use less code