def createJftSynonyms(word_set):
	outfile = open('jft_synonyms.txt','wb')
	for word in word_set:
		syn_set = set([word])
		word_f = jft.j2f('gbk','utf-8',word.encode('gbk')).decode('utf-8')
		syn_set.add(word_f)
		outfile.write(word+"@"+",".join(syn_set)+"\r\n")
示例#2
0
def createJftSynonyms(word_set):
    outfile = open('jft_synonyms.txt', 'wb')
    for word in word_set:
        syn_set = set([word])
        word_f = jft.j2f('gbk', 'utf-8', word.encode('gbk')).decode('utf-8')
        syn_set.add(word_f)
        outfile.write(word + "@" + ",".join(syn_set) + "\r\n")
示例#3
0
            fout.write(']}')
            if (preb != building):
                fout.write(']},'
                           + '{'
                           + '"building":"' + building + '",'
                           + '"restaurants":['
                )
            else:
                fout.write(',')
            fout.write('{' +
                       '"restaurant":"' + restaurant + '",'
                       + '"foods":['
            )
        else:
            fout.write(',')

    fout.write('{'
               + '"name":"' + jft.j2f("utf8", "utf8", name) + '",'
               + '"url":"' + url + '",'
               + '"genre":"' + genre + '",'
               + '"price":"¥' + price + '",'
               + '"taste":"' + taste + '",'
               + '"description":"' + description + '",'
               + '"photographer":"' + photographer + '"'
               + '}'
    )
    preb = building
    prer = restaurant
fout.write(']}]}]')