Install Offline Dictionary

2 views
Skip to first unread message

Kandy Swartzel

unread,
Aug 4, 2024, 9:01:28 PM8/4/24
to downjactoubor
here I've used the switches -ven-uk-rp for British English Received Pronunciation (espeak --voices for more), -x to display mnemonics, -s for speech output speed. You can modify the switches for espeak or dict as per your needs.]

Note: To use gnome-dictionary offline, you should first install a dictionary server and the desired databases (the installation of dictd and some databases are shown in option (I) above.)


After installing gnome-dictionary, a dictionary server (e.g. dictd) and the databases (e.g. dict-wn, dict-gcide) you'll have to configure so that it looks up the locally installed server. To do this, start gnome-dictionary and from the menu navigate to Edit -> Preferences. In the Dictionary Preferences window, click Add button, then in Add Dictionary Source add the information about your local dictionary server; add the Description (like dictd), the Hostname - localhost (or some other in your local network), the Port number to 2628 (2628 is the default as specified in the DICT Protocol RFC.excerpt from dictd documentation) and hit the Add button. Then in Dictionary Preferences window, select dictd radio button and close the prefs window. Now you should be able to use it offline.


You can download the *.deb file from the homepage and install any dictionary of your choice. Available dictionaries from the website are: Wikipedia, Wikiquote, Wiktionary, Wikispecies, WordNet, Collaborative International Dictionary of English, Jargon File and Hitchwiki.


By default, dictd tries to query offline databases first, then online databases. However, offline databases will not be available unless dictd.service is enabled, with locale properly set up and offline dictionaries installed (see below).


Adds the English-Spanish dictionary installed by dict-freedict-eng-spaAUR. For other dictionaries, copy and paste the above database declaration but make sure to change the database name, i.e. eng-spa, and also change the data and index paths above to specify the right files.


This article describes installing a local server (Kiwix-serve) and a dictionary (Wiktionary) in Windows, providing an offline local dictionary server that may be queried with a web browser or any software that has a Dictionary Lookup command that outputs an http URL. The specific case here is to use it for lookups from the Calibre e-book software when the Internet is not available for online lookups.


There are several ways to do this. The first thing I found when searching is to use WordWeb or TheSage. These are free Windows dictionary programs that allow you to look up words from within most Windows programs. But their dictionaries are rather limited, and insufficient if you frequently look up scientific, technical, archaic, or foreign words.


Another possibility is to install a local LAMP/WAMP server stack (usually Apache, MySQL, and PHP), then install MediaWiki (the software that runs Wikipedia, etc.), then get a MySQL dump of Wiktionary, and set up a local instance. Complex and messy! Uses too many resources! Takes DAYS to configure!


Kiwix is a wiki reader with many nice features, including a lightweight http server with user-defined port, and enhanced output formatting to look like the online wikis. You can read your local wikis through the Kiwix program, or run its server, kiwix-serve.exe, and hit it with any web browser on your local network.


To query it with http URLs that Calibre can send, you need to run the kiwix server (called kiwix-serve.exe). You can start it from within Kiwix (menu Tools > Server), or you can run the server directly from a command line, and not run the Kiwix program at all, except for downloading, indexing, and setting up; or just using it as a stand-alone dictionary.


Kiwix-serve.exe (located in kiwixxulrunner) is a command-line utility. You need to run it with several parameters. To make it easy to run, create a shortcut (or run it as a Windows Service; see further below):


Now that you have Kiwix and an offline Wiktionary, you may want to add others. Given enough time and space, you can even install Wikipedia (52GB), Wikipedia for Schools, Wikipedia Simplified English, Wikipedia Medical, WikiBooks, WikiQuotes, WikiVersity, TED Talks, Project Gutenberg (40GB), and more. Some of those (Wikipedia and Gutenberg) will take like three days (each) to download, so you should do them manually, and use a download manager with auto-recovery. But most ZIMs are just a gig or so.


All the Kiwix ZIMs are at: download.kiwix.org/ZIM/ConclusionI hope this is helpful. It took me quite a while to stumble upon this solution, and it works quite well, so I wrote an article about it, since no one else has.


Per answers below, I now know that dictionaries are stored as .dictionary files in /System/Library/Assets/com_apple_MobileAsset_DictionaryServices. However, moving them to this folder on a new machine does not cause them to be recognized in Dictionary.app.


Interestingly, if you open one of these .dictionary files in Dictionary.app, you get a message saying the dictionary could not be imported, because the "folder" format is not supported. Which begs the question, what format would be supported...


User specific Dictionaries are stored here /System/Library/Assets/com_apple_MobileAsset_DictionaryServices (based on your Language and Keyboard selection), here is mine, so if you have chosen Polish it will be there.


Now in MacOS Catalina the folder is apparently /System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX. There's also another folder called /System/Library/AssetsV2/PreinstalledAssetsV2/InstallWithOs/com_apple_MobileAsset_DictionaryServices_dictionaryOSX that might contain the dictionaries as well.


To make the dictionaries work with Dictionary.app, the manifest com_apple_MobileAsset_DictionaryServices_dictionaryOSX.xml in the folder is apparently crucial. It records the correct folder names for each dictionary.


On my computer running High Sierra 10.13.6, one of the dictionaries I was presented with was called: "New Oxford American Dictionary". I did a global search on my computer for that name and I got a hit on this name: New Oxford American Dictionary.dictionary. It is located in:


I don't know if this is what you're looking for but its the only hit I got on the dictionary name. Another one of my dictionaries is located similarly. Maybe these dictionaries were written to that location after selecting them for use. I dont know.


However, there are no additional plug-in features for hooking a Local Dictionary and there would need to be many languages and interests. I have found that there are many free apps that can read a selection in SumatraPDF and either OCR or translate or web search or Read out loud or offer offline dictionaries or even do ALL of the above in just one app. Not an endorsement as there are many good FOSS ones but one such freeware(why?) closed source product I find useful is called QTranslate




I also use my own addins or ahk to do similar so latest version of my web search (includes some example dictionary sites such as merriam-webster) is at MyNotes/WebSearch.vbs

and some alternatives using ahk are at Google-search a word/phrase with right-click - #5 by GitHubRulesOK


I love using WordWeb on Windows. This free dictionary program is perfect! It hides away until it is invoked with the intuitive keyboard shortcut Ctrl + Alt + W. The WordWeb UI is simple and the dictionary database is comprehensive.


I wanted such a light, comprehensive and offline dictionary in Ubuntu. I was surprised to discover that the GNOME Dictionary, which is the default, uses online dictionary servers. This is painful since quick word lookup is really nice to have and I do not always have Internet access.


A lot of times I run into unfamiliar words right in the middle of reading an online article. I hate to lose focus of that article by opening up a new browser tab. So, I guess a good online solution would be a NW-Prism app that launches in a fixed-width small window and can be dismissed easily (like WordWeb can be dismissed by pressing Esc).


I need to learn as much words as I can, so it'd take years to learn these as a non native English speaker. I want to import words from Wiktionary, so that I can mark or delete words I already learn. It'll save me time while continuing to learn.


The one thing this does not address is how you can edit your collection to mark entries 'done'. There is a possibility to set up your own wiki and import the data into that, so that you yourself can edit it. I leave it up to you to go through the FAQs for that.


Another approach would be to process the XML files further and extract the data into some tool that you are comfortable with, but your question gives no indications about your experience in this area.


How about buying a cheap (second hand?) paper dictionary that you can always carry with you, browse through randomly, noting words of interest (i.e. you may have encountered them earlier and/or not understand them exactly) in which you mark the words you know with a highlighter?


Kiwix allows you to save Wikimedia content to your computer for offline viewing. You'll find precompiled Wiktionary .ZIM files for different languages at this address, among other things: _in_all_languages


Kiwix uses ZIM compressed format which is optimized for offline use and more widely adopted for such use. It can be viewed and read by other programs, albeit Kiwix is the most popular. For mobile devices, kiwix-android is the only available ZIM reader, if we're not including proprietary apps like Livio which uses the Wiktionary data.


GoldenDict NG would be one example of an offline dictionary tool which can consume StarDict format (among many others) as well as integrate with pronunciation lookup services though I'm not personally familiar with tools for editing or annotating dictionary files. In it, you can right-click a dictionary in the sidebar and choose "Dictionary headwords" to get a list of entries.

3a8082e126
Reply all
Reply to author
Forward
0 new messages