import fiatio

class lex:
	def __init__(self, info):
		if info['Nsyllables'] != '?':
			self.nsyl = int(info['Nsyllables'])
		else:
			self.nsyl = None



def read(fn):
	hdr, data, comment = fiatio.read(open(fn, 'r'))
	lexicon = {}
	for d in data:
		lexicon[d['word']] = lex(d)
	return lexicon

