def test5(): name1 = 'anki-front.txt' name2 = 'anki-back.txt' home = 'd:/Program Files/GoldenDict/content/Others/' home = '../../../work/' db = stardict.open_local('treasure.db') treasure.compile_mdx(db, home + name1, home + name2)
def test6(): db = stardict.open_local('ultimate.db') data = db['sting'] data['translation'] += u'\n> hahahah\n[网络] 你好' import StringIO sio = StringIO.StringIO() generator._generate_html(sio, data)
def test6(): db = stardict.open_local('ultimate.db') data = db['sting'] data['translation'] += u'\n> hahahah\n[网络] 你好' import StringIO sio = StringIO.StringIO() generator._generate_html(sio, data) print sio.getvalue().encode('gbk', 'ignore')
def test4(): db = stardict.open_local('treasure.db') data = db['breakup'] # html = treasure.define_html(data['translation']) html = treasure.get_collins(data).encode('gbk', 'ignore') print html
def test1(): db = stardict.open_local('stardict.db') data = db['higher'] # data = {'exchange':'p:P/d:D/i:I/0:haha'} print(generator.word_exchange(data, 0)) print(generator.word_exchange(data, 1))