I am building a basic workout logger that would save and display some statistics about your number of repetitions per movement over a period of time. The challenge here (for me at least) is that I want to extract these informations from what the user will type in a textbox (no inputbox, no dropdown list with a list of movement). I would like to run an analysis (per line) of what the user has written, extract the number of repetitions, and the movement from it then associate it so I can save it in the DB. So the user would write something like:
For Quality
3 rounds of:
12 push ups at 10kg
10 sit ups
From such a text I would like to extract and associate:
12 push ups
10 sit ups
For now this would have to be perfect match (no push-ups or sit-ups)
I have no clue where to start. I have Robert Sedgwick's book Algorithms in C which has some chapters on research (sequential, binary, binary tree, red black etc...) and string processing (pattern matching, context free gammar, top down parsing etc...)
What I had in mind was to run that analysis at every stroke, a bit like when you are typing a text on your phone and you have words suggestions.
Does it seems realistic to you ? If so, have you got any pointers to give me ?
Prefix tries is the lead I m exploring at the moment Thanks a lot.