Re: simplified Python parsing question

Discussion in 'Python' started by Eric S. Johansson, Jul 30, 2012.

  1. On 7/30/2012 5:25 AM, Laszlo Nagy wrote:
    >
    > Did you try to use pygments?
    >
    > http://pygments.org/docs/api/
    >


    thanks, I'll take a look.

    >
    > I would first tokenize the code, then divide it by statement keywords.
    > Finally, you just need to find expression/assignment statements in the
    > remaining sections. (Maybe there is a better way to do it.)
    >
    >
    >


    yeah the problem is also little more complicated than simple parsing of Python
    code. For example, one example (from the white paper)

    *meat space blowback = Friends and family [well-meaning attempt]

    *could that be parsed by the tools you mention? I suspect not but this is what I
    need to generate using speech recognition because it's easily spoken. A more
    complex example might be something like

    new base = OS path-base name (old path)

    or

    if OS base exists (current path): new base name = OS path base name(current path)

    What's particularly cute here is that using the translation technique I can
    actually describe the full object method path with a minimum of speaking
    overhead. Python is great. :)

    But the questions remain, will these tools are stuff like this?
     
    Eric S. Johansson, Jul 30, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grey

    simplified chinese encoding

    Grey, Apr 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    507
  2. Eric S. Johansson

    simplified Python parsing question

    Eric S. Johansson, Jul 30, 2012, in forum: Python
    Replies:
    2
    Views:
    188
    Eric S. Johansson
    Jul 30, 2012
  3. Dieter Maurer

    Re: simplified Python parsing question

    Dieter Maurer, Jul 30, 2012, in forum: Python
    Replies:
    0
    Views:
    120
    Dieter Maurer
    Jul 30, 2012
  4. Laszlo Nagy

    Re: simplified Python parsing question

    Laszlo Nagy, Jul 30, 2012, in forum: Python
    Replies:
    0
    Views:
    189
    Laszlo Nagy
    Jul 30, 2012
  5. Eric S. Johansson

    Re: simplified Python parsing question

    Eric S. Johansson, Jul 30, 2012, in forum: Python
    Replies:
    6
    Views:
    212
    BartC
    Aug 3, 2012
Loading...

Share This Page