Batch-Delete from Dictionary?

calkins

秀才
Apologies if this has already been discussed. I did a search and didn't find anything.

___________________

I added about 1,400 flashcards and then decided to delete them. When I import flashcards, I have the "Store in user dict" set to "ON".

I have successfully deleted the flashcards and now want to delete each word from my USR dictionary. I know how to do it one at a time, but searching through 5,000 plus dictionary entries and deleting 1,400 would be a time-consuming task.

Does anyone know of a way to do a batch-delete within a dictionary so that I could delete all 1,400 in one shot? Any insight would be greatly appreciated! Thanks.
 

mikelove

皇帝
Staff member
calkins said:
I added about 1,400 flashcards and then decided to delete them. When I import flashcards, I have the "Store in user dict" set to "ON".

I have successfully deleted the flashcards and now want to delete each word from my USR dictionary. I know how to do it one at a time, but searching through 5,000 plus dictionary entries and deleting 1,400 would be a time-consuming task.

Does anyone know of a way to do a batch-delete within a dictionary so that I could delete all 1,400 in one shot? Any insight would be greatly appreciated! Thanks.

Have you imported any other dictionary entries since then that you care about? If not, go into Settings / Manage Dicts, tap on your user dictionary, and tap on "Import Entries" and "Undo Last Import" and you should be able to get rid of all of those newly imported dictionary entries that way. (it keeps a record of previous imports too, so you can tap on it multiple times if you brought in some other entries too but don't mind deleting / re-importing them)
 

calkins

秀才
I was successful in deleting the dictionary entries by "Undo Last Import," as well as deleting a number of them manually. The problem I'm having is that my user dictionary now has hundreds of blank entries (see attached screenshots). So if I search for a word using pinyin, it won't appear because it has numerous blank entries above it.

Is there any way to delete these blank entries? Thanks.
 

Attachments

  • image-1.png
    image-1.png
    26.3 KB · Views: 1,240
  • image.png
    image.png
    61.2 KB · Views: 1,255

mikelove

皇帝
Staff member
calkins said:
I was successful in deleting the dictionary entries by "Undo Last Import," as well as deleting a number of them manually. The problem I'm having is that my user dictionary now has hundreds of blank entries (see attached screenshots). So if I search for a word using pinyin, it won't appear because it has numerous blank entries above it.

Is there any way to delete these blank entries? Thanks.

Sounds like a bug - could you export your user dict database (via Settings / Manage Dicts) and PM it to me? We can easily remove those blank entries for you on our end, and hopefully this will also shed some light on the bug.
 

mikelove

皇帝
Staff member
For anybody else encountering phantom entry issues, here's how to purge them from your database (until we roll out our bug fix):

1) Back up your user dictionary via Settings / Manage Dicts.
2) Copy that file to your computer.
3) Open it up in a SQLite browser utility - the Firefox plugin SQLite Manager is a good free one.
4) Run the following commands:

Code:
delete from pleco_dict_posdex_hz_1 where uid not in (select uid from pleco_dict_entries);
delete from pleco_dict_posdex_hz_2 where uid not in (select uid from pleco_dict_entries);
delete from pleco_dict_posdex_hz_3 where uid not in (select uid from pleco_dict_entries);
delete from pleco_dict_posdex_hz_4 where uid not in (select uid from pleco_dict_entries);
delete from pleco_dict_posdex_py_1 where uid not in (select uid from pleco_dict_entries);
delete from pleco_dict_posdex_py_2 where uid not in (select uid from pleco_dict_entries);
delete from pleco_dict_posdex_py_3 where uid not in (select uid from pleco_dict_entries);
delete from pleco_dict_posdex_py_4 where uid not in (select uid from pleco_dict_entries);
vacuum;

5) Copy the database back to your device, delete the old version via Manage Dicts and install the new one instead.

That should expunge all of the blank entries.
 

calkins

秀才
Hi Mike,

I'm a bit of an SQL dummy, would you please provide info. on where to paste and run the command? I've tried in a few areas without success.

Thanks!
 

Attachments

  • Screen shot 2012-02-20 at 7.54.52 PM.png
    Screen shot 2012-02-20 at 7.54.52 PM.png
    86.2 KB · Views: 1,222

mikelove

皇帝
Staff member
calkins said:
I'm a bit of an SQL dummy, would you please provide info. on where to paste and run the command? I've tried in a few areas without success.

You'd paste it in the "Enter SQL" box, then click "Run SQL."
 

calkins

秀才
I tried that before, many times, and kept getting the following error...
 

Attachments

  • Screen shot 2012-02-21 at 8.00.16 AM.png
    Screen shot 2012-02-21 at 8.00.16 AM.png
    95.7 KB · Views: 1,249
  • Screen shot 2012-02-21 at 7.59.45 AM.png
    Screen shot 2012-02-21 at 7.59.45 AM.png
    100.1 KB · Views: 1,227

mikelove

皇帝
Staff member
Sorry, didn't realize they were wrapping up commands in a single transaction - delete the last "VACUUM" line and you should be fine.
 

calkins

秀才
mikelove said:
Sorry, didn't realize they were wrapping up commands in a single transaction - delete the last "VACUUM" line and you should be fine.

I had tried that as well. Perhaps I should wait for the fix, as no matter what I try it doesn't work. When I click "Run SQL", it doesn't do anything except say "not an error." I exported that (since there's no 'save as') as an .sql file and uploaded it to Pleco. Pleco said it could not upload it. I even changed the file extension to .pqb...no luck there either.

This is not a huge priority, as everything is still useable, but I would like to be able to clean things up after deleting entries. Thanks.
 

Attachments

  • Screen shot 2012-02-21 at 8.35.44 PM.png
    Screen shot 2012-02-21 at 8.35.44 PM.png
    94.2 KB · Views: 1,224

mikelove

皇帝
Staff member
calkins said:
mikelove said:
Sorry, didn't realize they were wrapping up commands in a single transaction - delete the last "VACUUM" line and you should be fine.

I had tried that as well. Perhaps I should wait for the fix, as no matter what I try it doesn't work. When I click "Run SQL", it doesn't do anything except say "not an error." I exported that (since there's no 'save as') as an .sql file and uploaded it to Pleco. Pleco said it could not upload it. I even changed the file extension to .pqb...no luck there either.

That "not an error" actually means that it worked correctly. It's operating on the original database file, so you don't need to separately save anything - just copy the database file back to your device and you should find that the blank entries are gone.
 
Top