class SphinxGrammarCreator {

	public void createGrammar(String name, String keywordStartSingle, String keywordStartMulti, String keywordEndMulti,
			String keywordStopOutput) {
		Path grammarFile = this.grammarDir.resolve(name + ".gram");

		try (BufferedWriter bw = Files.newBufferedWriter(grammarFile, StandardOpenOption.CREATE,
				StandardOpenOption.TRUNCATE_EXISTING)) {
			bw.write(generateGrammarString(name, keywordStartSingle, keywordStartMulti, keywordEndMulti, keywordStopOutput));
		} catch (IOException e) {
			throw new IllegalStateException("Can't write grammar file", e);
		}
	}

}