It's not primarily rules based as that would be impossible to scale. Where rules are helpful is to provide principles for when a longer or shorter phrase is chosen.
Optimising the tradeoff between more frequent repetition of vocabulary versus better quality grammar examples is where a lot of the work is.
I'll actually expand on this, because I think it gets at an interesting point, and at a fundamental 'bet' I'm making.
The approach I use should work if there are sufficient 'scaleable' ways to improve accuracy and choose the right phrases. Language analysis, NLP, LLMs etc all help here, and there are many methods I can still use and will add over time. I'm very much at a proof of concept stage right now!
This approach won't work if accuracy improvements quickly reach diminishing returns and an explosion of rules and/or human proofing to handle edge cases are required.
This is something that will improve over time - as it gets better at identifying longer phrases I can implement rules so it won't omit a neighbouring noun if the phrase contains a verb.
Something I'd love to look at longer-term. I think an overlay onto the real world that slowly immersed you in a new language would be a really powerful way to learn.
I expect the app still works well for reinforcing vocabulary, but less well for demonstrating grammar.