Hey,

I'm trying to come up with a peg for natural language time parsing.

given a string like:

"the sunday before last"

or

"4 fridays hence"

or

"jan 1st last year"

I'd like to parse these and convert to meaningful data.

'the sunday before last' translates to sunday, past, 2
'2 fridays hence' translates to friday, future, 4
'jan 1st last year' translates to jan, 1, past, year-1

(or something like that :))

i've started in building my grammar, but i'm struggling to get my head
around how to approach it - and therefore would appreciate any
feedback as to the best approach.

e.g. i'm not sure that PEG is completely right, and since there are no
tokens separating content (other than a space) it's been tricky to
figure out how to approach it.

so... if anyone is willing to help share some pointers and discuss
approach for this, i'd very much appreciate it!

Thanks,

James Cox

_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg

Reply via email to