On 10/23/07, Matthew Whipple <[EMAIL PROTECTED]> wrote:
> Mark Wagner wrote:
> > I'm working on a program to process Wikipedia pages. Wikipedia pages
> > can contain templates of the form:
> >
> > {{template name
> > |key = value
> > |key2 = value2
> > |...
> > }}
> >
> > Any value may in turn be
"Mark Wagner" schreef:
> I'm working on a program to process Wikipedia pages. Wikipedia pages
> can contain templates of the form:
>
> {{template name
> |key = value
> |key2 = value2
> | ...
> }}
>
> Any value may in turn be a template, with essentially no limit to the
> level of nesting. Given
Mark Wagner wrote:
> I'm working on a program to process Wikipedia pages. Wikipedia pages
> can contain templates of the form:
>
> {{template name
> |key = value
> |key2 = value2
> |...
> }}
>
> Any value may in turn be a template, with essentially no limit to the
> level of nesting. Given a "key
Recursion is the way I'd solve something like this.
Start processing the data, line by line, and when you hit a 'begin
template' ({{), recursively process it.
An example of a nested template and a sample of what you are trying to
generate might make it easier to be specific about the solution
--