On Sun, Sep 20, 2009 at 6:50 AM, andrew cooke <and...@acooke.org> wrote: > On Sep 19, 9:34 pm, Peng Yu <pengyu...@gmail.com> wrote: >> On Sep 19, 6:05 pm, Robert Kern <robert.k...@gmail.com> wrote: >> >http://nedbatchelder.com/text/python-parsers.html >> >> This is more a less just a list of parsers. I would like some detailed >> guidelines on which one to choose for various parsing problems. > > it would be simpler if you described what you want to do - parsers can > be used for a lot of problems.
I have never used any parser. The task at my hand right now is to parse this http://genome.ucsc.edu/goldenPath/help/wiggle.html, which is a fairly simple even without any parser package. I think that it is worthwhile for me to learn some parser packages to try to parse this format. So that I may in future parse more complex syntax. Do you have any suggestion what parser I should use for now? Regards, Peng > also, the parsers do not exist in isolation - you need to worry about > whether they are supported, how good the documentation is, etc. > > and different parsers handle different grammars - see > http://wiki.python.org/moin/LanguageParsing - so if you already have a > particular grammar then your life is simpler if you choose a parser > that matches. > > > these are the three that i know most about - i think all three are > currently maintained: > > for simple parsing problems, i think pyparsing is the most commonly > used - http://pyparsing.wikispaces.com/ > > my own lepl - http://www.acooke.org/lepl/ - tries to combine ease of > use with some more advanced features > > the nltk - http://www.nltk.org/ - is particularly targeted at parsing > natural languages and includes a wide variety of tools. > > > but for parsing a large project you might be better interfacing to a > compiled parser (lepl has memoisation, so should scale quite well, but > it's not something i've looked at in detail yet). > > andrew > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list