thesaurle

2025-02-25

2025-02-26

2025-03-10

I also paired a bit on the thesaurle project! We found that our logic wasn’t great so we spent some time to refactor the code to:

Up next, we want to work through the game ergonomics and make sure the path that it prompts the user for isn’t a circular path.

2025-03-21

Today was a very thesaurle-focused day! Spent some time cleaning up the codebase a bit to get rid of some old cruft, and then a great whiteboarding session to figure out how we wanted to implement the game logic.

Essentially, we decided that we wanted the ability to find the shortest path between any two nodes, so that we could ensure the path the game was taking was (one of) the most direct paths, and also so that the game can give feedback to the user as they follow their path to determine if they’re getting further from a more direct route or closer (using a warmer / colder type of feedback).

This seemed like a perfect use case for a graph database, as all words can be easily stored as notes with a directed synonym relationship / edge between them. Most of these databases have some sort of “shortest path” function already built in. For the first iteration, we decided to use Memgraph, because it seemed much simpler to get started and running locally (without pesky sales people from Neo4J calling us).

It was pretty easy to get set up – using Docker seems like the paved / recommended path. The tutorials and instructions are super helpful, too. The nitty gritty of that is documented in the pull request. Some day, I’ll make that repo public again. :)

2025-03-24

Today was very heavily focused on thesaurle. I wanted to start getting some stats about the dataset and ended up fighting with a number of different libraries. I was looking at nxalg but ended up having a number of problems with the library – first, it seemed that the docker container I was using didn’t have the right dependencies and getting the exact right configuration was very difficult. In the end, I’m not sure what configuration I used ended up working. It involved having to import some modules which were then mounted in the docker container as a volume. I ended up abandoning that approach because our graph has almost 20K nodes so finding all paths between all nodes was going to take quite some time.

In the end, I generated a script which would iterate through all nodes, and using the built in breadth-first search algorithm, find 20 possible pairs for that node, which are all within 5-10 steps. This script was pretty fast and gives us a good data set which we can use to seed the game.

I also figured out how to generate a dump of the data from the database so that the docker container can be loaded from a snapshot, rather than having to run the migration script every time. Since this data doesn’t change much (or ever?), having the static data file should be helpful.

I opened a PR with all the changes. I think up next is probably making the game experience a bit nicer and maybe figuring out how to deploy it somewhere!

2025-03-26