Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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))