3

I am trying to achieve English words to Phoneme word translation to create a language model for CMUSphinx. Now I am using the following tool to achieve the word translation link

For example if I give a text file as input with the following word it would get translated as follows

NAMASTE N AH M EY S T

But I want to do this on the fly dynamically using Java. Are there any API or libraries out there to achieve this.I do not want to reinvent the wheel.Or some other programming language which has libraries I could use.

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
luckysing_noobster
  • 1,933
  • 5
  • 24
  • 50

1 Answers1

0

CMUSphinx can do itself. You can download g2p model and configure the dictionary use.

Just for conversion you can use G2PConverter class:

G2PConverter converter = new G2PConverter("model.fst.ser")
converter.init()
ArrayList<Path> = converter.phoneticize(word,1);

Alternatively you can just force dictionary to create missing pronunciation.

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87