# -*- coding: utf-8 -*-
#! python
from __future__ import with_statement

from gmisclib import die

def write_as_alternatives(fn, ph):
	assert ph
	die.info('Write %d phones to %s' % (len(ph), fn))
	fd = open(fn, 'w')
	fd.write('(\n')
	for p in ph:
		fd.write(p.grammar_fmt() + '\n')
	fd.write(')\n')
	fd.close()

