How do I handle a large word list for a vocabulary app?

Hi everyone,I'm working on a new educational app that helps students with their vocabulary by challenging them with anagrams. I'm trying to figure out the best way to manage a large dictionary file within App Inventor. Should I use a text file in the assets, or is there a more efficient way to query a long list of words?My goal is to build something that can quickly find all possible words from a set of letters, similar to how a powerful Anagram Solver works. I've been using that site for inspiration, but I'm not sure how to replicate that kind of speed with a large word list on a mobile device.Has anyone built an app that needs to search through thousands of words? Any advice on the best practice for this would be greatly appreciated!Thanks!

Let me suggest to use the local sqlite database
Here is my paid extension App Inventor Extensions: SQlite | Pura Vida Apps, which follows the kiss principle - keep it simple stupid

See espexially rhe speed comparison in the FAQ there
Note: there exist also free sqlite extensions

Taifun

You will need a word file, and a database you can load at first run (like TinyDB) or pre-load and index like an sqlite database. Either would need to be in the Media folder.

For a TinyDB approach, I would generate signatures from each word (split at \n) found in the word file, and keep a list of words with that signature as a value using the signature of the word as tag or key.

Sample signature: sort the letters of the word.
Example:
SALT -> ALST
LAST -> ALST
so under tag ALST you would keep the list (SALT, LAST,...)

AI2 has blocks to split a word into letters (split at ''), and a sort block, along with a JOIN With Separator '' block to get a signature text from the sorted list.

A very good FREE Sqllite extension is here:

I found a word file at

This loads the words file slowly under the Companion ...

anagrams.aia (1.1 MB)

I haven't tried a built app's speed.

Note: Writing each word to TinyDB one at a time is too slow, even for a first run.
I'll try loading a dictionary in memory, then saving that.

This runs faster.
image

The first run loads a dictionary, and stores it as a single tag/value in TinyDB.

All queries are made against the dictionary.
anagrams_dictionary.aia (1.1 MB)

Anagramming single words into other single words is not as much fun as anagramming phrases into other phrases.

That would require different data structures and search techniques.

Any one have any?