I was adding Italian, Brazilian Portuguese and Indonesian to a word puzzle app. The script that builds each language’s word list worked for the first two, then stopped on the third with No wordlist 'large' available for language 'id'. The fallback works, but the resulting lexicon is less than a fifth the size, and that changes what content you can write for it.
TL;DR — wordfreq has no large list for Indonesian; best and small both hold 31,188 entries. Filtered through a Hunspell dictionary and limited to 2–9 letter words, it gives 13,618 game words, against 77,977 for Italian and 78,032 for Portuguese from their large lists.
The setup
The app has daily word games: a five-letter guessing game, crosswords, word search, hangman. Each language needs a lexicon: every word a player may type, with a frequency score so that daily puzzles use common words and accept rare ones as guesses.
I build it from two free sources:
- wordfreq gives word frequencies (as a Zipf score: 7 is « the », 3 is a rare word) from large text corpora. Corpus text is full of typos, names and foreign words.
- A Hunspell spelling dictionary, here the LibreOffice ones (
it_IT,pt_BR,id_ID), read with the pure-Python spylls library. It knows real words, including inflected forms, but has no frequencies.
A word is kept only if both agree: frequent enough to be in wordfreq, and spelled correctly according to Hunspell. Words are then folded to plain A–Z (accents removed) because players type on a 26-letter keyboard.
What I expected
wordfreq’s README lists Indonesian among the supported languages, so I expected get_frequency_dict("id", wordlist="large") to work like it did for Italian and Portuguese, and a lexicon of roughly the same size.
What actually happens
>>> wordfreq.get_frequency_dict("id", wordlist="large")
LookupError: No wordlist 'large' available for language 'id'
The large lists exist only for the languages with the most source data. Indonesian has small and best, and both return the same 31,188 entries. The raw entry counts on the machine I used:
| Language | wordlist | Entries | Kept for the game |
|---|---|---|---|
| Italian | large | 322,796 | 77,977 |
| Portuguese | large | 267,979 | 78,032 |
| Indonesian | best | 31,188 | 13,618 |
![]()
The fix
Pick the wordlist per language and pass the same one to the frequency lookup: zipf_frequency("rumah", "id", wordlist="large") raises the same LookupError.
import wordfreq
from spylls.hunspell import Dictionary
WORDLIST = {"id": "best"} # no "large" list for Indonesian
def build(lang, hunspell_path):
wl = WORDLIST.get(lang, "large")
dic = Dictionary.from_files(hunspell_path) # e.g. "dicts/id_ID" (.aff + .dic)
out = {}
for form in wordfreq.get_frequency_dict(lang, wordlist=wl):
if not (form.isalpha() and form.islower() and 2 <= len(form) <= 9):
continue
if dic.lookup(form):
out[form] = round(wordfreq.zipf_frequency(form, lang, wordlist=wl), 2)
return out
print(len(build("id", "dicts/id_ID"))) # ~13,600 (my pipeline also folds accents)
.islower() drops proper nouns, since wordfreq keeps the case only for words that exist capitalised. Your length limit is whatever your games need.
Why it works, and what the small list costs
The ratio of kept to raw entries is similar for all three languages (24 %, 29 %, 44 %): Hunspell rejects about the same share of noise. The difference comes from the raw list. A 31k-entry list stops much higher in the frequency range, so the rare-but-real words that make a crossword or a hangman game interesting are simply absent.
Two more things showed up with Indonesian:
- Clitic forms pass Hunspell. The least frequent words of my candidate list included
impianmu(« your dream »: impian + the possessive suffix -mu). Hunspell accepts these because they are valid spellings, but they make poor puzzle answers. I told the content writers to skip anything ending in -ku, -mu, -nya, -lah, -kah rather than filtering mechanically, because some real roots end in those letters. - Content written for the language hits the wall. When themed word lists (animals, food…) were written for Indonesian, many natural words were not in the 13.6k lexicon, so every list needed a lexicon check and replacements. Peribahasa (proverbs) and quotes came out at 309 and 191, against 500 and 350 for Portuguese, because the writers stopped where they ran out of verified material.
If you need more Indonesian coverage, the lexicon has to come from another frequency source; the Hunspell dictionary alone has the words but no way to rank them.
What I did not test
I only checked wordfreq’s behaviour for these three languages. The counts depend on the LibreOffice dictionary versions downloaded on the date above. I did not measure how many of the 13,618 Indonesian words are clitic forms.
Facts
context: Building per-language word game lexicons from wordfreq frequencies filtered by Hunspell dictionaries
problem: wordfreq.get_frequency_dict("id", wordlist="large") raises LookupError; Indonesian only has small/best lists
solution: Use wordlist="best" for Indonesian (same value for zipf_frequency); expect ~13.6k kept words vs ~78k for Italian/Portuguese
verified_on: 2026-10-28
applies_to: wordfreq 3.1.1, spylls, LibreOffice it_IT / pt_BR / id_ID Hunspell dictionaries
does_not_apply_to: Languages that have a "large" wordfreq list