Migrating AnySoftKeyboard user words history to HeliBoard
Get a copy from AnySoftKeyboard user words (in app settings there's an option to open its location)
You need Python and Java JRE.
Run this python code, you can adjust file path to your xml correct one.
from xml .etree import ElementTree as etree
from pathlib import Path
from datetime import datetime
file = Path ("UserWords.xml" )
def xml_to_aosp (lang , locale , description , date , version ):
tree = etree .parse (file )
root = tree .getroot ()
aosp_wordlist = f"dictionary=anysoftkeyboard:{ lang } ,locale={ locale } ,description={ description } ,date={ date } ,version={ version } \n "
elements = root .findall (".//pref/pref" )
for element in elements :
freq = element .find ("value[@freq]" ).get ("freq" )
word = element .find ("value[@word]" ).get ("word" )
aosp_wordlist += " word={},f={}\n " .format (word , freq )
Path (f"aosp_wordlist_{ lang } .txt" ).write_text (aosp_wordlist )
xml_to_aosp ("ar" , "ar" , "Arabic wordlist" , datetime .now ().timestamp (), 18 )
java -jar dicttool_aosp.jar makedict -s aosp_wordlist_ar.txt -d anysoftkey_words.dict
Copy the dict file to your device and open it from file manager to load with HeliBoard .