[Nook Touch General] nmyshkin:
Update 2-11-24: replaced inflection table for Oxford English Dictionary (UK) with an expanded and better targeted version. I've learned some new things! Look for revised inflection databases for all of the listed dictionaries soon!

Disclaimer 1: I am neither a lexicographer nor a linguist. The dictionaries I have put together or organized are as much demonstrations as they might be practical tools (maybe more demonstrations). I've tried not to introduce any errors, but I am not responsible for erroneous material that was already present.

Disclaimer 2: No attempt has been made to alter or "improve on" the internal structure of the dictionaries, which are modeled after the stock dictionary and comparable to it in file size. These dictionaries may not be suitable for all users.

Note: An earlier forum thread with the most information on alternative dictionaries is here.

I first became interested in the structure and potential production of dictionaries for the NST/G when I was working on updating the UK version of the ROM for FW 1.2.2. I saw that dictionary management was built into the Settings app and that got me thinking. Of course it doesn't work on the UK ROM and I now think it's doubtful that there ever were any non-English dictionaries available for download. Still, the seed was planted.

In conjunction with the release of a Dictionary Management app for the NST/G, I am making available a set of single language dictionaires and three sets of translation dictionaries for the languages originally supported on the UK ROM. These dictionaries are NOT, however, for the UK ROM but rather the more common US version of the OS.

The first set of dictionaries I built from scratch using the "translation" table of Wiktionary databases and an adapted Python routine I discovered while researching. These contain more words than the second or third sets of dictionaries, but they include incomplete entries as well as complete ones. The simplest entries are just word→word with no other information. The more complete entries include a short contextual sense in the first language (practically a definition), the part of speech, gender (if applicable and available), as well as a list of possible words in the second language.

Just as I had wrapped up my "final" pair of dictionaries my wandering searches delivered me to Wikdict. There the clever people had done some amazing cross referencing of the three databases that are involved with each language pair. From this they generated translation dictionaries in Stardict format. After decompiling one I was so impressed I started again on another set of dictionaries. This second set covers fewer words since only the complete entries from Wiktionary are used.

And then there is the Wiktionary site of Matthias Buchmeier. Among others, he has assembled translation dictionaries in the ding format (text--yeah, I never heard of it either). I liked these also, and although they were more difficult to work with, I gave them a whirl to produce a third set of translation dictionaries. Now I'm in rehab.

Edit: and from my little padded cell I managed to sneak a peek at the WWW and finally found a source for single-language dictionaries based on Wiktionary, thanks to Mickaël Schoentgen et. al. Although the Italian and Spanish dictionaries are on the small side, these are in a format similar to the Oxford English dictionary in which all senses and part of-speech variations of a word are in a single citation, so you can't really compare "word" counts with the translation dictionaries.

Each dictionary consists of two files: basewords.db and inflectedwords.db. If you're not interested in the Dictionary Management app you can still use these dictionaries. However, contrary to some of the posts in the long-ago thread on alternative dictionaries, it is not wise to simply replace the stock files with these dictionaries (even after backing up the stock files). During the development of the Dictionary Management app I noticed that over time the available space in /system decreased during dictionary swaps. It took me a lot of fooling around and research to sort out the remedy, so if you elect to skip the app, be sure to follow the manual dictionary installation instructions carefully. Each of the basewords.db files that go from English→whatever use the same inflectedwords.db (

not

the same as the stock file). If the dictionary goes from whatever→English, there is an inflectedwords.db specifically for that language (the same inflectedword files are used for any of the three sets of dictionaries).

For each dictionary you must download one basewords file and one inflectedwords file. There is only one inflectedwords file for each language, however, so you don't need to download duplicates. You want an inflectedwords file for the

first

language in a pair.

Single Language

(Wiktionary, after Mickaël Schoentgen et. al.)

basewords.db:

Oxford English (43,800 entries) [

includes inflectedwords.db

]

French (437,983 entries!)

German (135,658 entries)

Italian (52,626 entries)

Spanish (55,631 entries)

(you also need an inflectedwords.db file from below matching the language--except for Oxford)

Translation

basewords.db:

Set 1 (direct from Wiktionary translation table)

English→French (114,000 entries, 70,244 complete)

English→German (81,200 entries, 68,874 complete)

English→Italian (74,190 entries, 65,281 complete)

English→Spanish (67,647 entries, 65,623 complete)

French→English (103,760 entries, 90,230 complete)

German→English (113,542 entries, 73,286 complete)

Italian→English (54,743 entries, 29,204 complete)

Spanish→English (51,124 entries, 13,101 complete)

Set 2 (Wiktionary via Wikdict)

English→French (44,208 entries)

English→German (41,233 entries)

English→Italian (35,971 entries)

English→Spanish (39,855 entries)

French→English (73,751 entries)

German→English (52,115 entries)

Italian→English (21,112 entries)

Spanish→English (8,726 entries)

Set 3 (Wiktionary after Mattias Buchmeier)

English→French (81,464 entries)

English→German (79,068 entries)

English→Italian (59,474 entries)

English→Spanish (72,176 entries)

French→English (93,969 entries)

German→English (83,569 entries)

Italian→English (150,625 entries)

Spanish→English (108,852 entries)

inflectedwords.db:

English (105,660 forms)

French (284,435 forms)

German (631,222 forms)

Italian (313,537 forms)

Spanish (488,956 forms)

For comparison with the values shown above, the stock basewords.db contains 86,301 entries. That is supplemented by the biographical and geographical dictionary which contains 15,745 entries. The dictionaries based on Wiktionary databases contain bio/geo entries (too many, if you ask me...) along with the other words, so for typical words you might look up the number of entries is somewhat inflated.

Other dictionaries

There are many, many, many language pairs among the databases and files from Wiktionary and Wikdict. I didn't look very closely and some might be quite small like Spanish (or even smaller!), but if you have an interest in trying your hand at a different combination, there is more information in the technical section on making dictionaries. There are single-language databases but they don't include definitions or even senses. They seem to mostly focus on statistics and also sometimes include genders and parts of speech. It is possible to construct a very simple dictionary using, say, the German-English pair, ignoring the English translations in the construction of the database. This would only work for the complete citations, of course, so you'd have smallish dictionaries. However, I think the data represented in the single-language dictionaries by M. Schoentgen are much more extensive.

Problems, Probleme, problèmes, i problemi, problemas

Single-word lookup for translation is rife with challenges, especially where multi-part verbs are concerned. It's also true that some words don't have single-word equivalents in some languages. Anyone who has ever struggled with a translation dictionary while enrolled in a first-year language course knows this already. Therefore the more contextual information available in the lookup citation, the better. That's one reason why I like the Wiktionary databases--when the citation is complete. Like Wikiwhatever, Wiktionary is, however, a work in progress. Data dumps are annual and one might expect some progress each year. Exactly why Spanish has received so little love is a mystery to me, considering the large number of Spanish speakers around the world. The small size of the Italian databases is a little easier to understand.

For the most part, the Lookup function behaves as you might expect but French presents some problems. Lookup is equipped to deal with hyphenations that span lines (there are hyphen dictionaries for various languages buried in the NST). But Lookup bracketing eschews any other punctuation as far as I can tell. The rather extravagent use of the apostrophe (or what looks like an apostrophe--sorry, my French is limited to culinary and operatic) in written French means that only part of a word will sometimes be selected. It is possible to drag the selection brackets across an apostrophe and on to the terminus of a word, but it is difficult.

Finally, the function of the inflectedwords.db is spotty. Based on my tests even the stock dictionary sometimes fails to pick up an inflection and properly direct it to the baseword ("word not found"), even though I can see with my own eyes the correct inflection and referral in the database. Easy enough in your native language to backup on an ending you recognize to find the baseword. But in a translation dictionary you may not be as familiar with inflections. Your mileage may vary.

Irony \ˈīrənē\

While working with the UK ROM got me started down this path, I have not been successful in creating any dictionaries for it. There is more discussion of this in the technical section on stock dictionaries. Supposedly it has been done in the past (see: https://xdaforums.com/t/spanish-dic...nario-en-espanol-para-nook-glowlight.3554472/). While the post is not specifically about the NST/G, the dictionary format is apparently the same. I sent the member a message but as he has not been seen since 2019, the likelihood of a reply is pretty small.

Edit: 9-6-22--Thanks to @backup2 for refreshing the download link to the Spanish language dictionary. This should work on the

UK version

of the ROM. Manual dictionary installation instructions below should be adapted to the appropriate directories. The name of the dictionary file

must

remain ox_en_GB.db or the NST will not recognize it.

Manual dictionary installation

My key discovery in the development of the Dictionary Management app is that com.bn.nook.reader.activities must be killed prior to moving any dictionary files. This process generally runs in the background and it has tendrils attached to the dictionary databases. If you don't kill the process, you may not get back all of the free space due when removing the stock dictionaries, or removing custom dictionaries and replacing with the stock dictionaries. At some point, you will not even have enough free space left to restore the stock dictionaries, even though there should be plenty. If reading this makes your head hurt already, you'd be happier installing the app. Otherwise, read on.

You cannot safely swap dictionaries without ADB (or the app)

Copy the basewords and inflectedwords files from the dictionary you want to the root of your sdcard.

Connect to your device with ADB (via USB or WiFi). Execute the following:

adb shell pidof com.bn.nook.reader.activities
[a four digit number is returned*]
adb shell kill [the four digit number--no square brackets]

*If you get a blank response rather than a 4-digit number, it is likely that com.bn.nook.reader.activities has died a natural death. If so, you can skip the "kill" command.

Now you need to backup the stock dictionary. If you use an sdcard that is easiest:

adb shell mkdir /sdcard/Dictionary
adb shell mount -o rw,remount /dev/block/mmcblk0p5 /system
adb shell cp /system/media/reference/basewords.db /sdcard/Dictionary/basewords.db
adb shell cp /system/media/reference/inflectedwords.db /sdcard/Dictionary/inflectedwords.db

If you are uneasy about this, check with a file manager that the operations above did what they should have (don't leave the ADB connection or you might have to kill com.bn.nook.reader.activities again!)

Now to delete the stock dictionary (not the backup):

adb shell rm /system/media/reference/basewords.db
adb shell rm /system/media/reference/inflectedwords.db

Now to copy the new dictionary to its proper place:

adb shell cp /sdcard/basewords.db /system/media/reference/basewords.db
adb shell cp /sdcard/inflectedwords.db /system/media/reference/inflectedwords.db
adb shell chmod 644 /system/media/reference/basewords.db
adb shell chmod 644 /system/media/reference/inflectedwords.db

That should do it. When you access a book, com.bn.nook.reader.activities will restart and you'll be using a new dictionary.

To restore the stock dictionary:

adb shell pidof com.bn.nook.reader.activities
[a four digit number is returned]
adb shell kill [the four digit number--no square brackets]
adb shell mount -o rw,remount /dev/block/mmcblk0p5 /system
adb shell rm /system/media/reference/basewords.db
adb shell rm /system/media/reference/inflectedwords.db
adb shell cp /sdcard/Dictionary/basewords.db /system/media/reference/basewords.db
adb shell cp /sdcard/Dictionary/inflectedwords.db /system/media/reference/inflectedwords.db
adb shell chmod 644 /system/media/reference/basewords.db
adb shell chmod 644 /system/media/reference/inflectedwords.db

You can remove the backup files in /sdcard/Dictionary with a file manager.

Spoiler content hidden.

Spoiler content hidden.