Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #26241
| Date | 2012-07-30 05:57 -0400 |
|---|---|
| From | "Eric S. Johansson" <esj@harvee.org> |
| Subject | Re: simplified Python parsing question |
| References | <5015C58D.4040101@harvee.org> <50165308.5060708@shopzeus.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2722.1343642267.4697.python-list@python.org> (permalink) |
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?
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: simplified Python parsing question "Eric S. Johansson" <esj@harvee.org> - 2012-07-30 05:57 -0400
csiph-web