public class G2PConverter
extends java.lang.Object
| Constructor and Description |
|---|
G2PConverter(java.lang.String g2pmodel_file)
Create a decoder by loading the serialized model from a specified
filename
|
G2PConverter(java.net.URL g2pModelUrl)
Create a decoder by loading the serialized model from a specified URL
|
| Modifier and Type | Method and Description |
|---|---|
java.util.ArrayList<Path> |
phoneticize(java.util.ArrayList<java.lang.String> entry,
int nbest)
Phoneticize a word
|
java.util.ArrayList<Path> |
phoneticize(java.lang.String word,
int nbest)
Phoneticize a word
|
public G2PConverter(java.net.URL g2pModelUrl)
throws java.io.IOException
g2pModelUrl - the URL of the serialized modeljava.io.IOException - when model is not loadedpublic G2PConverter(java.lang.String g2pmodel_file)
g2pmodel_file - the filename of the serialized modelpublic java.util.ArrayList<Path> phoneticize(java.util.ArrayList<java.lang.String> entry, int nbest)
entry - the word to phoneticize transformed to an ArrayList of Strings
(each element hold a single character)nbest - the number of distinct pronunciations to returnpublic java.util.ArrayList<Path> phoneticize(java.lang.String word, int nbest)
word - the word to phoneticizenbest - the number of distinct pronunciations to return