Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export/Import Personal dictionaries #500

Open
User1l0 opened this issue Feb 17, 2024 · 15 comments
Open

Export/Import Personal dictionaries #500

User1l0 opened this issue Feb 17, 2024 · 15 comments
Labels
contributor needed There will not be any progress without someone volunteering to work on this enhancement New feature or request low priority This issue is unlikely to be resolved in the near future due to maintainers' priorities

Comments

@User1l0
Copy link

User1l0 commented Feb 17, 2024

No description provided.

@User1l0 User1l0 added the enhancement New feature or request label Feb 17, 2024
@Uranusek
Copy link

You can already do it. The backup and restore option is in the advanced keyboard settings.

@BlackyHawky
Copy link

If you're talking about the user dictionary, it doesn't work. I've implemented todo in the code so that it can be done later.

@Helium314
Copy link
Owner

I think there are already apps that can do it, so adding this functionality has rather low priority.

@Uranusek
Copy link

I thought it was possible :0 I once added this feature request and it was implemented, or at least I think so, since it was closed as completed. What is the UserHistoryDictionary.dict file?

@BlackyHawky
Copy link

What is the UserHistoryDictionary.dict file?

If I'm not mistaken, it's the file containing the words you've often typed, which are then automatically suggested in the suggestion bar.

@Uranusek
Copy link

I disabled this option, created a backup and these files are still there. The spellcheck_userunigram.dict files have disappeared.

@Charles7z
Copy link

For those looking for this feature:

User Dictionary Manager (UDM) play store is a great app.

However, be careful as to the dictionary being used.

Some keyboard use the "all languages" personal dictionary. HeliBoard adds words to the en_US personal keyboard for US English. Just an FYI.

@Helium314 Helium314 added PR Contributors are encouranged to submit a pull request. Just ask in case you are interested. low priority This issue is unlikely to be resolved in the near future due to maintainers' priorities contributor needed There will not be any progress without someone volunteering to work on this and removed PR Contributors are encouranged to submit a pull request. Just ask in case you are interested. labels Mar 24, 2024
@Roccobot
Copy link

Roccobot commented Apr 2, 2024

Why is this low priority though? Wouldn't users be more open to switching from GBoard if they could transfer their personal dictionaries? I'm loving HeliBoard so far, but I have a big personal dictionary (2 languages plus 'All languages') and copying words one by one would take forever 😅

@Helium314
Copy link
Owner

The phone's personal dictionary is part of the Android system and works across keyboards, the keyboard just needs to support it.
Import / export is just required for backup and switching devices.

@Roccobot
Copy link

Roccobot commented Apr 2, 2024

Oh, so probably the real question is: why isn't my GBoard dictionary available for HeliBoard? I see it completely empty :(
Should I open a bug issue?

@Helium314
Copy link
Owner

Maybe Gboard doesn't use the system personal dictionary?
But I think words added when via the menu in spell checker (when clicking words underlined in red) should always go to system dictionary. Though maybe Play services have a way to override this...

@Roccobot
Copy link

Roccobot commented Apr 2, 2024

So basically there's no way to copy my Gboard user dictionary to HeliBoard? 😰

@Charles7z
Copy link

Charles7z commented Apr 2, 2024

Introduction

Since this post has been linked to from the readme FAQ, I figured I would make it more comprehensive.

Gboard uses its own internal personal/user dictionary, therefore, while it looks like the system's personal dictionary it is not and therefore no other keyboards can see your Gboard words. So this tutorial will show you how to get your words out of Gboard and import them into system's personal dictionary, and I'll show you how you can manipulate the word's "weight".

Step one: export from Gboard

  1. Open Gboard's settings.
  2. Tap Dictionary
  3. Tap Personal dictionary
  4. You should see your dictionary (English US in my case) tap it
  5. Tap the three dot menu in the upper right.
  6. Tap export (Gboard will export the dictionary in a zip file.)
  7. File share menu will come up.
  8. Select an app you can share the zip file with. I use MiXplorer as my file manager so it handles copying from share menu. If you don't have a file manager that can do this you can share to email and send it to yourself.
  9. Once you have the zip export you'll need to extract it. It contains a dictionary.txt file with a list of all your words. Use a good file manager from F-Droid or MiXplorer if you don't have something that'll work already installed.
  10. You should now have the dictionary.txt file. 🎉

Step two: import

  1. Download User Dictionary Manager UDM()
  2. Install UDM
  3. Setup UDM — enable it as a keyboard, etc.
  4. Open UDM
  5. Select import
  6. Tap browse and locate the dictionary.txt file you exported & extracted in step one.
  7. Under "export file format" check Gboard.
  8. Under "export language" you have to decide which personal dictionary you want to import into — all languages, en_US etc.
  9. Tap start — UDM often has some type of notification/warming letting you know that it doesn't always work on all devices, clear it and continue importing your dictionary words.
  10. You should see a notice at the bottom telling you how many words imported.
  11. Done! 😁

Step three: alt import & word "weight"

HeliBoard gives a "weight" (I don't know what it's actually called) between 0-255 to every word in the dictionary and in the personal dictionary it gives all words the maximum weight of 255. This can be problematic.

The numbers from 0-255 correspond as 0 = don't show word, and 1-255 the higher the more important the word is. This means a word with 255 will be highly recommended in the suggestions. This may not be what you want and you may want to change the weight to something less important however, the only way to adjust this number in HeliBoard is one word at a time via the personal dictionary. Furthermore there is No way to backup these words with their number.

The solution is "Multiling O Keyboard" on the Google play store here.

Multiling O Keyboard hasn't been updated in a long time and its user dictionary can't be installed on my pixel 6a running GrapheneOS Android 14, but the keyboard does install.

Once you have it installed and enabled in the settings for Multiling O Keyboard you'll see:

  1. settings
  2. Misc.
  3. Import|Export
  4. User Dictionary

If you have imported your words and setup Multiling O Keyboard so it's using the user dictionary you'll see listed all you words with their weight number:

MLK_UDic_Begin
able::255::en_US
about::255::en_US
MLK_UDic_End

Notice the first and last line? Those lines are required by Multiling O Keyboard to import words. This list can't be used by UDM!

From this setting's screen you can copy all your words with their corresponding numbers and save them in a .txt file = export. This makes "batch" changing of the weight number easy (find & replace) along with an easy way to backup those numbers with their words.

Remember 0-255 are the numbers you can use, the higher the more important the word is. The number 0 doesn't seem to do anything in the personal dictionary — in the main dictionary it's used to signify a word that is NOT to be shown.

That's all I can think of. 🤷‍♂️

Edit: the "null" dictionary, if you used "all languages" to import using UDM, doesn't seem to work very well importing in Multiling, best to use a language specific dictionary (en_US).

@Roccobot
Copy link

Roccobot commented Apr 2, 2024

Thanks, I'll try that!

@Roccobot
Copy link

Roccobot commented Apr 7, 2024

I forgot to reply that it worked! The multi language is a but weird, but at least all my words are there now! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor needed There will not be any progress without someone volunteering to work on this enhancement New feature or request low priority This issue is unlikely to be resolved in the near future due to maintainers' priorities
Projects
None yet
Development

No branches or pull requests

6 participants