Re: extracting string.Template substitution placeholders

2014-01-17 Thread Mark Lawrence
On 17/01/2014 06:07, gmflanagan wrote: On Sunday, January 12, 2014 3:08:31 PM UTC, Eric S. Johansson wrote: As part of speech recognition accessibility tools that I'm building, I'm using string.Template. In order to construct on-the-fly grammar, I need to know all of the identifiers before the

Re: extracting string.Template substitution placeholders

2014-01-16 Thread gmflanagan
On Sunday, January 12, 2014 3:08:31 PM UTC, Eric S. Johansson wrote: > As part of speech recognition accessibility tools that I'm building, I'm > > using string.Template. In order to construct on-the-fly grammar, I need > > to know all of the identifiers before the template is filled in. what i

Re: extracting string.Template substitution placeholders

2014-01-14 Thread Eric S. Johansson
On 1/13/2014 2:24 AM, Steven D'Aprano wrote: On Sun, 12 Jan 2014 10:08:31 -0500, Eric S. Johansson wrote: Now just walk the template for $ signs. Watch out for $$ which escapes the dollar sign. Here's a baby parser: found a different way import string cmplxstr="""a simple $string a longer $s

Re: extracting string.Template substitution placeholders

2014-01-12 Thread Steven D'Aprano
On Sun, 12 Jan 2014 10:08:31 -0500, Eric S. Johansson wrote: > As part of speech recognition accessibility tools that I'm building, I'm > using string.Template. In order to construct on-the-fly grammar, I need > to know all of the identifiers before the template is filled in. what is > the best wa

extracting string.Template substitution placeholders

2014-01-12 Thread Eric S. Johansson
As part of speech recognition accessibility tools that I'm building, I'm using string.Template. In order to construct on-the-fly grammar, I need to know all of the identifiers before the template is filled in. what is the best way to do this? can string.Template handle recursive expansion i.e.