Skip to content

Using trigram reference table to early stop searches, much faster computes#2

Open
RyanXu02 wants to merge 2 commits intojunged856:mainfrom
RyanXu02:main
Open

Using trigram reference table to early stop searches, much faster computes#2
RyanXu02 wants to merge 2 commits intojunged856:mainfrom
RyanXu02:main

Conversation

@RyanXu02
Copy link

Found this trigram reference table, a trigram is basically common 3 letter combinations.
I used it to stop a specific search early if it doesn't match any of the trigrams. (ie no way its a real word if even the first 3 letters are giberish)
its a LOT faster now (assuming it works im pretty sure lmao)

trigram table and inspiration here
https://jamchamb.net/projects/animal-crossing-letters

@junged856
Copy link
Owner

If the first couple letters are gibberish then this if-condition should implement early stopping:

Screenshot 2025-01-30 at 12 40 37 PM

It checks if the current letters selected are a prefix to an actual word in the dictionary (collins 2019 scrabble .txt), and only continues searching when the condition is true

ie.

if the algorithm selects 'axz', this is not a prefix to any word in the dictionary so the algorithm will stop,

but if the algorithm selects 'axo', this is a prefix to many words such as

"AXOID,
AXOIDS,
AXOLEMMA,
AXOLEMMAS,
... etc"

so it will continue to search the grid until the selected word is no longer a prefix

@RyanXu02
Copy link
Author

Using trigrams does skip over more cases than using the full 2019 Scrabble dictionary, I guess i was thinking less about completeness and more about aggressive early stopping.
image
image
As in you can sacrifice the chance of catching less common words but catch common words faster?... if that makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants