LangModelToFst { public SeqTransducer fromArpa(File arpaFile) { ArpaNgramReader reader = new ArpaNgramReader(); try (BufferedReader br = Files.newBufferedReader(arpaFile.toPath(), Charsets.UTF_8)) { NgramLM model = reader.read(br); return fromModel(model); } catch (IOException e) { throw new RuntimeException(e); } }  SeqTransducer fromArpa(File arpaFile); SeqTransducer fromModel(NgramLM model); static final double REALLY_HIGH; static final double PRETTY_HIGH; }
@Test public void shouldConvertAndWrite() throws Exception { SeqTransducer transducer = new LangModelToFst() .fromArpa(new File("/home/steve/Documents/phonetisaurus-0.7.8/script/g_0_a/data.arpa")); Convert.export(transducer.getFst(), "testfst"); }