コード例 #1
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")
コード例 #2
0
ファイル: jft_synonyms.py プロジェクト: chilynn/360app-tag
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
ファイル: get.py プロジェクト: YangMann/ChiChiApp_Android
            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(']}]}]')