* @param entry
* the input vector
* @return the created fst
*/
private Fst entryToFSA(ArrayList<String> entry) {
TropicalSemiring ts = new TropicalSemiring();
Fst efst = new Fst(ts);
State s = new State(ts.zero());
efst.addState(s);
efst.setStart(s);
// Build the basic FSA
for (int i = 0; i < entry.size() + 1; i++) {
s = new State(ts.zero());
efst.addState(s);
if (i >= 1) {
int symIndex = Utils.getIndex(g2pmodel.getIsyms(),
entry.get(i - 1));
efst.getState(i).addArc(new Arc(symIndex, symIndex, 0.f, s));
} else if (i == 0) {
int symIndex = Utils.getIndex(g2pmodel.getIsyms(), sb);
efst.getStart().addArc(new Arc(symIndex, symIndex, 0.f, s));
}
if (i == entry.size()) {
State s1 = new State(ts.zero());
efst.addState(s1);
int symIndex = Utils.getIndex(g2pmodel.getIsyms(), se);
s.addArc(new Arc(symIndex, symIndex, 0.f, s1));
s1.setFinalWeight(0.f);
}