Example #1
0
import dateparser
import helpers, induce
with induce.grammar() as g:
    lines = helpers.slurplstriparg()
    for l in lines:
        print l
        with induce.Tracer(l, g):
            dt = dateparser.parse(l)
Example #2
0
import selectsql
import helpers, induce

with induce.grammar() as g:
    for t in helpers.slurplstriparg():
        print "<%s>" % t
        with induce.Tracer(t, g):
            selectsql.select_stmt.parseString(t)
Example #3
0
import romannumerals
import induce, helpers

with induce.grammar() as g:
    for rn in helpers.slurplstriparg():
        with induce.Tracer(rn, g):
            romannumerals.romanNumeral.parseString(rn)
Example #4
0
import mathexpr
import induce, helpers

with induce.grammar() as g:
    exprs = helpers.slurplstriparg()
    for e in exprs:
        with induce.Tracer(e, g):
            mathexpr.Parser(e, {})
Example #5
0
from datetime import datetime
import deltatime
import induce, helpers

# test grammar
tests = helpers.slurplstriparg()
with induce.grammar() as g:
  print("(relative to %s)" % datetime.now())
  for t in tests:
    with induce.Tracer(t, g):
        print deltatime.nlTimeExpression.parseString(t)