views:

356

answers:

3

I recall I have read about a parser which you just have to feed some sample lines, for it to know how to parse some text.

It just determines the difference between two lines to know what the variable parts are. I thought it was written in python, but i'm not sure. Does anyone know what library that was?

+2  A: 

Conceivably you might mean Reverend?

chaos
No, it's not really what is was looking for.
Ikke
+1  A: 

If you need end up needing a more powerful parser, ANTLR is great (it is also multi-language, and supports Java, Ruby, C++ as well as Python).

The creator of Python (Guido van Rossum), commented:

I'm actually really liking ANTLR! I have a pretty darn good velocity with...

If you are going to do some great stuff with parsers, then you might consider also using ANTLR Studio (free plugin for Eclipse IDE).

Happy parsing.

Daniel Ribeiro
Thanks, I will look into that one. But actually right now the parsing is really simple. Mostly some static text, with some variable parts in it.
Ikke
+7  A: 

Probably you mean TemplateMaker, I haven't tried it yet, but it builds on well-researched longest-common-substring algorithms and thus should work reasonably... If you are interested in different (more complex) approaches, you can easily find a lot of material on Google Scholar using the query "wrapper induction" or "template induction".

PhilS
Yeah, this is what I had seen. Not really a parser, but it commes close ;)
Ikke