Esempio n. 1
0

csvfile = codecs.open('beta.csv','wb') 
csvfile.write(u'\ufeff'.encode('utf8'))
writer = csv.writer(csvfile)

W = Words("VisualTest.txt")

S = Nsyllables(W) 

writer.writerow(["Elika"])
writer.writerow(["Basic Count"])
writer.writerow([" ", "Words","Syllables","+Stress","-Stress"])

for vow in span_vowells:
	words = sum(W.return_tokens_words(vow).values())
	syllables = sum(S.return_tokens_sylls(vow).values())
	stressedcount = sum(S.stressed_target_sylls(vow).values())
	unstressedcount = sum(S.unstressed_target_sylls(vow).values())
	writer.writerow([vow, words, syllables, stressedcount, unstressedcount])

writer.writerow([" "])
writer.writerow([" "])
writer.writerow(["Environment Count"])
writer.writerow([" ","_V","C_","_C","S_","_S","Pre","Post"])
for vow in span_vowells:
	post_vowells = sum(S.posterior_vowell(vow).values())
	prec_consonants = sum(S.preceding_consonant(vow).values())
	post_consonants = sum(S.posterior_consonant(vow).values())
	prec_cons_dict = S.preceding_consonant(vow)
	if "s".encode('utf-8') in prec_cons_dict.keys():