Re: Parser needed.

2015-06-11 Thread Rustom Mody
On Thursday, June 11, 2015 at 6:08:22 PM UTC+5:30, larry@gmail.com wrote: > On Thu, Jun 11, 2015 at 8:35 AM, Joel Goldstick wrote: > > but you aren't asking questions. You are having a conversation with > > yourself on a public q/a list. Its unpleasant > > Well, he did mention masterbation i

Re: Parser needed.

2015-06-11 Thread Larry Martell
On Thu, Jun 11, 2015 at 8:35 AM, Joel Goldstick wrote: > but you aren't asking questions. You are having a conversation with > yourself on a public q/a list. Its unpleasant Well, he did mention masterbation in another post. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-11 Thread Joel Goldstick
On Thu, Jun 11, 2015 at 7:15 AM, Skybuck Flying wrote: > Well it did help a little bit. > > Somebody asked if there was already a parser for it. > > I answered yes in C#. > > So I took a closer look at it... and learned something from it. > > Maybe I would have done that anyway... or maybe not...

Re: Parser needed.

2015-06-11 Thread Skybuck Flying
Well it did help a little bit. Somebody asked if there was already a parser for it. I answered yes in C#. So I took a closer look at it... and learned something from it. Maybe I would have done that anyway... or maybe not... Now we will never know... but I am happy that the parser is now ok,

Re: Parser needed.

2015-06-09 Thread Rustom Mody
On Wednesday, June 10, 2015 at 5:04:17 AM UTC+5:30, Michael Torrie wrote: > On 06/09/2015 06:20 AM, Skybuck Flying wrote: > > Euhm... > > > > My parser is already done... since today > > > > Loving it too > > > > Wrote it myself... based on the c# code technique explained somewhere in > > this

Re: Parser needed.

2015-06-09 Thread Michael Torrie
On 06/09/2015 06:20 AM, Skybuck Flying wrote: > Euhm... > > My parser is already done... since today > > Loving it too > > Wrote it myself... based on the c# code technique explained somewhere in > this thread too I'm glad you're having fun, and making good progress. And it's good to hear of

Re: Parser needed.

2015-06-09 Thread Skybuck Flying
Euhm... My parser is already done... since today Loving it too Wrote it myself... based on the c# code technique explained somewhere in this thread too Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-09 Thread Ryan Stuart
On Tue, Jun 9, 2015 at 12:30 PM, Skybuck Flying wrote: > Anyway... I am trying a more robust parser... because my own parser right > now didn't work out for new inputs. > You should take a look at lrparsing: https://pypi.python.org/pypi/lrparsing/1.0.11 Cheers > > It almost worked except for

Re: Parser needed.

2015-06-08 Thread Skybuck Flying
I made it way too difficult on myself with that stupid dictionary bs... What I really wanted was to know if the ref was already in the reflist. Turns out python has a really nice simple operation for that: if not (Ref in EntityRef): EntityRef.append(Ref) DONE ! =D No need for dictionary.

Re: Parser needed.

2015-06-08 Thread Skybuck Flying
Oh I think I forgot to mention... parser is now getting close to 1 second... with tokenizer and such. But I think this is still within acceptable performance level for now. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
Well... I must say I am impressed: Python parsers the file/info I want in just: Seconds: 0.013389648 For +/- 20.000 lines of input data/text. This makes it very usuable cool ! Now I try the bigger file: +/- 285.000 lines of input data/text: Seconds: 0.092351501 Very impressive ! I

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
Ok problem found. The data contains: EntityRef EntityRef So perhaps I screwed it up or perhaps the data is a bit bad. I ll check on my web drive: http://www.skybuck.org/Games/StartrekOnline/Parser/SpaceFleetAlertEnemyExample.demo Firefox doesn't find it... so apperently I fucked up data a b

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
Something strange happens with: 36044817 near the update section... for some reason it doesn't copy it properly... Hmm... Maybe a bug in output or an additional new line or maybe something wrong... Hmm.. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
I feel my conclusion is a bit hasty... but using dictionaries is not easy that for sure. Apperently the problem is DemoEntityInde is none ? But why would it be none ? Hmmm strange... maybe some refs are not in there... hmmm... Yeah could be... I cutted some stuff out... so I better check for

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
get was tried but now new error somewhere else: [error] TypeError ( list indices must be integers ) [error] --- Traceback --- error source first line: module ( function ) statement 133: main ( ProcessUpdateEntityDead ) DemoEntityDead[DemoEntityIndex] = Dead Apperently the returned index from

Re: Parser needed.

2015-06-04 Thread Michael Torrie
On 06/04/2015 11:14 AM, Steven D'Aprano wrote: > On Fri, 5 Jun 2015 03:02 am, Skybuck Flying wrote: > >> Yeah... my first nice parser for this kind of stuff... >> >> Python is really nice for this stuff... >> >> Piece a cake.. now I just need to stuff it in some dictionary and I am >> done or so ;

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
Very nice code almost done. Now I am trying to do the code correctly and fast, thus using a dictionary, but I run into a little problem: The dictionary is declared as: DemoEntityRefIndex = {} Pairs are added as: DemoEntityRefIndex[Ref] = DemoEntityIndex And now I try to retrieve the demo e

Re: Parser needed.

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 03:02 am, Skybuck Flying wrote: > Yeah... my first nice parser for this kind of stuff... > > Python is really nice for this stuff... > > Piece a cake.. now I just need to stuff it in some dictionary and I am > done or so ;) > > Though a dictionary might be hard to traverse in

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
Yeah... my first nice parser for this kind of stuff... Python is really nice for this stuff... Piece a cake.. now I just need to stuff it in some dictionary and I am done or so ;) Though a dictionary might be hard to traverse in sequence... A list is probably enough... assuming no duplicate

Re: Parser needed.

2015-06-04 Thread Skybuck Flying
Yes these string processing techniques will work very nicely and very fast: cut and pasted an example but should work... now I developed it a bit further, bye ,bye. BotDemoFolder = "C:\\Games\\Startrek Online\\Startrek Online\\Cryptic Studios\\Star Trek Online\\Live\\demos" BotDemoFile = "Sp

Re: Parser needed.

2015-06-02 Thread Skybuck Flying
"MRAB" wrote in message news:mailman.71.1433263397.13271.python-l...@python.org... On 2015-06-02 05:45, Skybuck Flying wrote: Example for python: MyString = "Hello World" print MyString.rfind("World") if MyString.rfind("World"): print "yes" else: print "no" Pretty cool. " .rfind retur

Re: Parser needed.

2015-06-02 Thread MRAB
On 2015-06-02 05:45, Skybuck Flying wrote: Example for python: MyString = "Hello World" print MyString.rfind("World") if MyString.rfind("World"): print "yes" else: print "no" Pretty cool. .rfind returns the index if found, -1 if not found. "World".rfind("World") returns 0, which will be tre

Re: Parser needed.

2015-06-02 Thread Grant Edwards
On 2015-06-02, Skybuck Flying wrote: > > { > > >{ > >} > } IOW, it's almost, but not quite, JSON. -- Grant Edwards grant.b.edwardsYow! My vaseline is at RUNNING... gmai

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Actually that's not true... messages not that interesting. This C# parser does not parse what I want which is: "updates" and "positions". Thus I rejected this parser some days ago. But it's technique could be handy. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
If some of this code could be made to work it could be of some use: ParserEngine is the least important... MessageParser is interesting. class AbstractSectionsParser(AbstractParser): # Provides a method to return a list of sections def GetResult(self): # Returns the list with the found resourc

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Example for python: MyString = "Hello World" print MyString.rfind("World") if MyString.rfind("World"): print "yes" else: print "no" Pretty cool. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Hmm this parser uses an interesting technique: if line.Contains("activePlayerRef"): self._activePlayerRef = Convert.ToInt64(line.Substring(line.LastIndexOf("activePlayerRef") + 16)) I'll see if python can do this as well... ;) Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/p

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Together with this it's might be of some use: http://codeconverter.sharpdevelop.net/SnippetConverter.aspx It converts C# to Python pretty fast. I'll give it a try to see if it can work. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Here is a parser for sto demo files written in C# maybe it can be of some use, check trunk folders: http://sourceforge.net/p/stodemolauncher/code/HEAD/tree/ Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-01 Thread Mark Lawrence
On 02/06/2015 01:29, Skybuck Flying wrote: Hello, I need some kind of parser and some kind of way to access the data contained in a file like the one below: (text file): http://www.skybuck.org/Games/StartrekOnline/Parser/SpaceFleetAlertEnemyExample.demo I am interested in learning the entity

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Perhaps the list.append operation is the cause of the slowdown, or perhaps my algo is flawed. No idea yet with slowdown of parser code so far. Instead of trying to debug everything going to add some time outputs to the whole thing to get to bottom of this ;) Ok another sikuli failure... I ju

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Apperently print speed has some exponential time issue in SikuliX kinda weird. But at least processing is high... however, debug console/print is only thing I got to diagnose problems... Could get time-wise nasty... hmmm... Perhaps I should make a small little parser in Delphi and port it to

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Test program shows, python/sikulix can handle about 3m chars per second so I must continue with a parser attempt. Apperently there is some bottleneck/slowdown in posted code... I may have to slow down a bit take more time... and perhaps use global vars or so... instead of parameters. Maybe t

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Test program shows, python/sikulix can handle about 3m chars per second so I must continue with a parser attempt. # test char processing speed. # test if sikulix 1.1, python, jython/whatever is a piece of shit when it comes to parsing dealing with characters, unicode processing bottleneck theo

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
I tried running this in SikuliX 1.1 from pyparsing import Word, alphas greet = Word( alphas ) + "," + Word( alphas ) + "!" greeting = greet.parseString( "Hello, World!" ) print greeting Doesn't seem to run pyparser module missing. Another reason why not to use it, unfortunately. Not sure if i

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
"Joel Goldstick" wrote in message news:mailman.34.1433209315.13271.python-l...@python.org... On Mon, Jun 1, 2015 at 9:31 PM, Skybuck Flying wrote: Yes this will work: DemoChars = FileObject.read() I think this is a cleaner solution. EOL can be ignored and focusses on { } and stuff like

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
I am trying to rush it a bit but things are starting to go to hell. SikuliX needs to be restarted continously to deal with bugs. Plus Eclipse breakpoints cannot be set. So both IDEs totally suck for any complex code development. Plus I can already tell this is going to be insanely slow in pyth

Re: Parser needed.

2015-06-01 Thread Joel Goldstick
On Mon, Jun 1, 2015 at 9:31 PM, Skybuck Flying wrote: > Yes this will work: > > DemoChars = FileObject.read() > > I think this is a cleaner solution. EOL can be ignored and focusses on { } > and stuff like that... when extracting information EOL could be used as > well. > > > Bye, > Skybuck. > --

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
On 06/01/2015 07:19 PM, Skybuck Flying wrote: How hard would it be to encode that into pyparser ? " Check out the docs and you probably will get an idea. The only real way to find out is to try it. Is this file from a certain program? If so, it's possible someone has already written a python

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Nice char based code: BotDemoFolder = "C:\\Games\\Startrek Online\\Startrek Online\\Cryptic Studios\\Star Trek Online\\Live\\demos" BotDemoFile = "SpaceFleetAlert.demo" import time def ParseDemoLines( ParaLines ): print "Parsing " + str( len(ParaLines) ) + " lines." for LineIndex in range(0,

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Yes this will work: DemoChars = FileObject.read() I think this is a cleaner solution. EOL can be ignored and focusses on { } and stuff like that... when extracting information EOL could be used as well. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Ok, so far so good, a little start has been made. Text file is read into lines... I am not so sure if this is a good idea... Maybe it's easier if the entire file is one gigant array of characters instead of fragmented lines. However I don't know yet exactly how to read as one gigant array of

Re: Parser needed.

2015-06-01 Thread Michael Torrie
On 06/01/2015 07:19 PM, Skybuck Flying wrote: > How hard would it be to encode that into pyparser ? Check out the docs and you probably will get an idea. The only real way to find out is to try it. Is this file from a certain program? If so, it's possible someone has already written a python li

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Since the file is probably ascii... not sure... I might come away with: " file.read([size]) Reads at most size bytes from the file (less if the read hits EOF before obtaining size bytes). " The doc does not mention is size is optionally... I will try and leave it out, see what happens, other

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
"Michael Torrie" wrote in message news:mailman.31.1433207544.13271.python-l...@python.org... On 06/01/2015 06:29 PM, Skybuck Flying wrote: The parser should be able to parse a textfile of somewhere between 20.000 lines to 50.000 lines in about 1 to 2 seconds. My environment is SikuliX 1.1 "

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
So far this is what I got... I like to name things for what they are so FileObject I like better than something abstract/weird like "text file", my code: BotDemoFolder = "C:\\Games\\Startrek Online\\Startrek Online\\Cryptic Studios\\Star Trek Online\\Live\\demos" BotDemoFile = "SpaceFleetAler

Re: Parser needed.

2015-06-01 Thread Michael Torrie
On 06/01/2015 06:29 PM, Skybuck Flying wrote: > The parser should be able to parse a textfile of somewhere between 20.000 > lines to 50.000 lines in about 1 to 2 seconds. > > My environment is SikuliX 1.1 I don't have any inclination to examine your input files, but you could certainly mock up a

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Readlines is indeed documented as reading EOF: http://www.tutorialspoint.com/python/file_methods.htm Bye, skybuck. "Skybuck Flying" wrote in message news:37cda$556d009d$5419aafe$38...@news.ziggo.nl... This will probably help: http://stackoverflow.com/questions/14676265/how-to-read-text-fi

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
I really like this python help file, it has served me well so far: http://www.tutorialspoint.com/python/python_functions.htm It's unusually better than the rest on the net ;) It matches nicely Sikuli's python's capabilities. Bye, Skybuck :) -- https://mail.python.org/mailman/listinfo/python-l

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Link looks a bit odd, home index link: Nice python documentation/tutorial/help: http://www.tutorialspoint.com/python/index.htm Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Except for the first bracket... it has no structure name. Perhaps the demo filename could be used as structure name or just be left empty. Bye, Skybuck. "Skybuck Flying" wrote in message news:aef84$556d00e7$5419aafe$39...@news.ziggo.nl... From examining the demo file it seems each brac

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
From examining the demo file it seems each bracketted data sections if pre-header/pre-fixed with it's name. So it's somewhat similar to a C structure: structure { } Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
This can help with parsing the C like bracketted data: http://stackoverflow.com/questions/1651487/python-parsing-bracketed-blocks algo: " For each string in the array: Find the first '{'. If there is none, leave that string alone. Init a counter to 0. For each character in the string:

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
This will probably help: http://stackoverflow.com/questions/14676265/how-to-read-text-file-into-a-list-or-array-with-python text_file = open("filename.dat", "r") lines = text_file.readlines() print lines print len(lines) text_file.close() Usually I like to consult officals docs though...Bye, Sk

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
Some further information about the demo file: It seems to be split up into "creation sections" and "update" sections. The update sections contain the positions. The update sections also contain a reference number to the created entities. (There is one empty creation section but that's because

Re: Parser needed.

2015-06-01 Thread Skybuck Flying
I will try and help for as far as possible, maybe I will end up writing it myself in the process. The first problem seems to be, how to read a textfile into python all at once... and then perhaps process them per line. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser

2010-05-06 Thread Andreas Löscher
Am Sonntag, den 02.05.2010, 21:54 +0200 schrieb Andreas Löscher: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. Which parser would you recommend? > > Best, > Andreas > Thanks for your an

Re: Parser

2010-05-03 Thread andrew cooke
On May 2, 3:54 pm, Andreas Löscher wrote: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. Which parser would you recommend? > > Best, > Andreas I develop Lepl - http://www.acooke.org/lepl

Re: Parser

2010-05-02 Thread Stefan Behnel
dmtr, 03.05.2010 07:39: ANTLR I don't know if it's that easy to get started with though. The companion for-pay book is *most excellent*, but it seems to have been written to the detriment of the normal online docs. IMO ANTLR is much easier to use compared to any other tool simply because it h

Re: Parser

2010-05-02 Thread dmtr
> > > ANTLR > > I don't know if it's that easy to get started with though. The > companion for-pay book is *most excellent*, but it seems to have been > written to the detriment of the normal online docs. > > Cheers, > Chris > --http://blog.rebertia.com IMO ANTLR is much easier to use compared to

Re: Parser

2010-05-02 Thread Chris Rebert
On Sun, May 2, 2010 at 10:10 PM, dmtr wrote: > On May 2, 12:54 pm, Andreas Löscher chemnitz.de> wrote: >> Hi, >> I am looking for an easy to use parser. I am want to get an overview >> over parsing and want to try to get some information out of a C-Header >> file. Which parser would you recommend

Re: Parser

2010-05-02 Thread dmtr
On May 2, 12:54 pm, Andreas Löscher wrote: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. Which parser would you recommend? ANTLR -- http://mail.python.org/mailman/listinfo/python-list

Re: Parser

2010-05-02 Thread Martin v. Loewis
Andreas Löscher wrote: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. To get information from a header file, try Tools/scripts/h2py.py Regards, Martin -- http://mail.python.org/mailman/

Re: Parser

2010-05-02 Thread Jason Scheirer
On May 2, 12:54 pm, Andreas Löscher wrote: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. Which parser would you recommend? > > Best, > Andreas Pyparsing: http://pyparsing.wikispaces.com

Re: parser module and doc

2009-03-20 Thread Steven D'Aprano
On Fri, 20 Mar 2009 01:19:38 -0700, Mark Dickinson wrote: > On Mar 20, 7:26 am, Steven D'Aprano cybersource.com.au> wrote: >> "All source files mentioned here which are not part of the Python >> installation are located in the Demo/parser/ directory of the >> distribution." >> >> http://docs.pyth

Re: parser module and doc

2009-03-20 Thread Mark Dickinson
On Mar 20, 7:26 am, Steven D'Aprano wrote: > "All source files mentioned here which are not part of the Python > installation are located in the Demo/parser/ directory of the > distribution." > > http://docs.python.org/library/parser.html#information-discovery > > What distribution? What does this

Re: parser recommendation

2008-06-06 Thread Kay Schluehr
On 6 Jun., 01:58, Alan Isaac <[EMAIL PROTECTED]> wrote: > One other possibility: > SimpleParse (for speed). > http://simpleparse.sourceforge.net/> > It is very nice. > Alan Isaac How does SimpleParse manage left-factorings, left-recursion and other ambiguities? For example according to [1] there

Re: parser recommendation

2008-06-05 Thread Alan Isaac
One other possibility: SimpleParse (for speed). http://simpleparse.sourceforge.net/> It is very nice. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: parser recommendation

2008-06-03 Thread rurpy
On Jun 3, 2:55 pm, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > I haven't given up on pyparsing, although I'm now heavily leaning > towards PLY as an end solution since lex and yacc parsing is available > on other platforms as well. Keep in mind that PLY's "compatibility" with YACC is functiona

Re: parser recommendation

2008-06-03 Thread Filipe Fernandes
> On Jun 3, 12:34 pm, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: >> On Tue, Jun 3, 2008 at 10:41 AM, Paul McGuire <[EMAIL PROTECTED]> wrote: >> But I do have more questions... when reading the ply.py header (in >> 2.5) I found the following paragraph... >> >> # The current implementation is only

Re: parser recommendation

2008-06-03 Thread Paul McGuire
On Jun 3, 12:34 pm, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 3, 2008 at 10:41 AM, Paul McGuire <[EMAIL PROTECTED]> wrote: > But I do have more questions... when reading the ply.py header (in > 2.5) I found the following paragraph... > > # The current implementation is only somewh

Re: parser recommendation

2008-06-03 Thread Kay Schluehr
On 3 Jun., 19:34, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > # The current implementation is only somewhat object-oriented. The > # LR parser itself is defined in terms of an object (which allows multiple > # parsers to co-exist). However, most of the variables used during table > # construc

Re: parser recommendation

2008-06-03 Thread Filipe Fernandes
On Tue, Jun 3, 2008 at 10:41 AM, Paul McGuire <[EMAIL PROTECTED]> wrote: > If you learn both, you may find that pyparsing is a good way to > quickly prototype a particular parsing problem, which you can then > convert to PLY for performance if necessary. The pyparsing prototype > will be an effici

Re: parser recommendation

2008-06-03 Thread Paul McGuire
On Jun 3, 8:43 am, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > > I've briefly looked at PLY and pyparsing.  There are several others, > but too many to enumerate.  My understanding is that PLY (although > more difficult to use) has much more flexibility than pyparsing.  I'm > basically looking

Re: parser recommendation

2008-06-03 Thread Kay Schluehr
On 3 Jun., 15:43, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > I have a project that uses a proprietary format and I've been using > regex to extract information from it. I haven't hit any roadblocks > yet, but I'd like to use a parsing library rather than maintain my own > code base of compli

Re: Parser Generator?

2007-08-27 Thread Steven Bethard
Paul McGuire wrote: > On Aug 26, 10:48 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: >> In Japanese and Chinese tokenization, word boundaries are not marked by >> different classes of characters. They only exist in the mind of the >> reader who knows which sequences of characters could be words giv

Re: Parser Generator?

2007-08-27 Thread Paul McGuire
On Aug 26, 10:48 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Paul McGuire wrote: > > On Aug 26, 8:05 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: > >> The only caveat being that since Chinese and Japanese scripts don't > >> typically delimit "words" with spaces, I think you'd have to pass the

RE: Parser Generator?

2007-08-26 Thread Ryan Ginstrom
> On Behalf Of Paul McGuire > > On Aug 26, 8:05 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: > > The only caveat being that since Chinese and Japanese scripts don't > > typically delimit "words" with spaces, I think you'd have > to pass the > > text through a tokenizer (like ChaSen for Japane

Re: Parser Generator?

2007-08-26 Thread Steven Bethard
Paul McGuire wrote: > On Aug 26, 8:05 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: >> The only caveat being that since Chinese and Japanese scripts don't >> typically delimit "words" with spaces, I think you'd have to pass the text >> through a tokenizer (like ChaSen for Japanese) before using Py

Re: Parser Generator?

2007-08-26 Thread Paul McGuire
On Aug 26, 8:05 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: > > On Behalf Of Jason Evans > > Parsers typically deal with tokens rather than individual > > characters, so the scanner that creates the tokens is the > > main thing that Unicode matters to. I have written > > Unicode-aware scanners

RE: Parser Generator?

2007-08-26 Thread Ryan Ginstrom
> On Behalf Of Jason Evans > Parsers typically deal with tokens rather than individual > characters, so the scanner that creates the tokens is the > main thing that Unicode matters to. I have written > Unicode-aware scanners for use with Parsing-based parsers, > with no problems. This is pret

Re: Parser Generator?

2007-08-26 Thread Jack
Thanks Json. There seem to be a few options that I can pursue. Having a hard time chooing one now :) "Jason Evans" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 24, 1:21 pm, "Jack" <[EMAIL PROTECTED]> wrote: >> "Jason Evans" <[EMAIL PROTECTED]> wrote in message >> >htt

Re: Parser Generator?

2007-08-26 Thread Jack
Good to know, thanks Paul. ! "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > Pyparsing was already mentioned once on this thread. Here is an > application using pyparsing that parses Chinese characters to convert > to English Python. > > http://pypi.python.org/pypi/zhpy/0.5 > > -- Paul -

Re: Parser Generator?

2007-08-26 Thread Jason Evans
On Aug 24, 1:21 pm, "Jack" <[EMAIL PROTECTED]> wrote: > "Jason Evans" <[EMAIL PROTECTED]> wrote in message > >http://www.canonware.com/Parsing/ > > Thanks Jason. Does Parsing.py support Unicode characters (especially CJK)? > I'll take a look. Parsers typically deal with tokens rather than indi

Re: Parser Generator?

2007-08-24 Thread Paul McGuire
On Aug 18, 11:37 pm, "Jack" <[EMAIL PROTECTED]> wrote: > Thanks for all the replies! > > SPARK looks promising. Its doc doesn't say if it handles unicode > (CJK in particular) encoding though. > > Yapps also looks powerful:http://theory.stanford.edu/~amitp/yapps/ > > There's also PyGgyhttp://lava.n

Re: Parser Generator?

2007-08-24 Thread Jack
Thanks Jason. Does Parsing.py support Unicode characters (especially CJK)? I'll take a look. "Jason Evans" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 18, 3:22 pm, "Jack" <[EMAIL PROTECTED]> wrote: >> Hi all, I need to do syntax parsing of simple naturual languages, >> fo

Re: Parser Generator?

2007-08-22 Thread Jason Evans
On Aug 18, 3:22 pm, "Jack" <[EMAIL PROTECTED]> wrote: > Hi all, I need to do syntax parsing of simple naturual languages, > for example, "weather of London" or "what is the time", simple > things like these, with Unicode support in the syntax. > > In Java, there are JavaCC, Antlr, etc. I wonder wha

Re: Parser Generator?

2007-08-19 Thread Jack
Very interesting work. Thanks for the link! "Alex Martelli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > """ > NLTK ¡ª the Natural Language Toolkit ¡ª is a suite of open source Python > modules, data sets and tutorials suppor

Re: Parser Generator?

2007-08-19 Thread Alex Martelli
Jack <[EMAIL PROTECTED]> wrote: > Thanks for the suggestion. I understand that more work is needed for natural > language > understanding. What I want to do is actually very simple - I pre-screen the > user > typed text. If it's a simple syntax my code understands, like, Weather in > London, I'll

Re: Parser Generator?

2007-08-19 Thread Jack
Thanks for the suggestion. I understand that more work is needed for natural language understanding. What I want to do is actually very simple - I pre-screen the user typed text. If it's a simple syntax my code understands, like, Weather in London, I'll redirect it to a weather site. Or, if it's

Re: Parser Generator?

2007-08-19 Thread samwyse
Jack wrote: > Thanks for all the replies! > > SPARK looks promising. Its doc doesn't say if it handles unicode > (CJK in particular) encoding though. > > Yapps also looks powerful: http://theory.stanford.edu/~amitp/yapps/ > > There's also PyGgy http://lava.net/~newsham/pyggy/ > > I may also giv

Re: Parser Generator?

2007-08-18 Thread Jack
Thanks for all the replies! SPARK looks promising. Its doc doesn't say if it handles unicode (CJK in particular) encoding though. Yapps also looks powerful: http://theory.stanford.edu/~amitp/yapps/ There's also PyGgy http://lava.net/~newsham/pyggy/ I may also give Antlr a try. If anyone has ex

Re: Parser Generator?

2007-08-18 Thread Tommy Nordgren
On 19 aug 2007, at 00.22, Jack wrote: > Hi all, I need to do syntax parsing of simple naturual languages, > for example, "weather of London" or "what is the time", simple > things like these, with Unicode support in the syntax. > > In Java, there are JavaCC, Antlr, etc. I wonder what people use >

Re: Parser Generator?

2007-08-18 Thread beginner
On Aug 18, 5:22 pm, "Jack" <[EMAIL PROTECTED]> wrote: > Hi all, I need to do syntax parsing of simple naturual languages, > for example, "weather of London" or "what is the time", simple > things like these, with Unicode support in the syntax. > > In Java, there are JavaCC, Antlr, etc. I wonder wha

Re: Parser Generator?

2007-08-18 Thread Diez B. Roggisch
Jack schrieb: > Hi all, I need to do syntax parsing of simple naturual languages, > for example, "weather of London" or "what is the time", simple > things like these, with Unicode support in the syntax. > > In Java, there are JavaCC, Antlr, etc. I wonder what people use > in Python? Antlr also ha

Re: Parser or regex ?

2005-12-16 Thread Paul McGuire
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Tim Arnold wrote: > > "Fuzzyman" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Hello all, > > > > > > I'm writing a module that takes user input as strings and (effectively) > > > translates them to f

Re: Parser or regex ?

2005-12-16 Thread Fuzzyman
Fredrik Lundh wrote: > Fuzzyman wrote: [snip..] > > I'd use some variation of: > > http://online.effbot.org/2005_11_01_archive.htm#simple-parser-1 > > (that version can parse tuples, but it should be too hard to extend > it to handle keyword arguments) > Thanks to all who answered - I'll inves

Re: Parser or regex ?

2005-12-16 Thread Fredrik Lundh
Fuzzyman wrote: > I'm writing a module that takes user input as strings and (effectively) > translates them to function calls with arguments and keyword > arguments.to pass a list I use a sort of 'list constructor' - so the > syntax looks a bit like : > >checkname(arg1, "arg 2", 'arg 3', keywa

Re: Parser or regex ?

2005-12-16 Thread Graham Fawcett
Fuzzyman wrote: > Hello all, > > I'm writing a module that takes user input as strings and (effectively) > translates them to function calls with arguments and keyword > arguments.to pass a list I use a sort of 'list constructor' - so the > syntax looks a bit like : > >checkname(arg1, "arg 2",

Re: Parser or regex ?

2005-12-16 Thread Michael Spencer
Fuzzyman wrote: > Hello all, > > I'm writing a module that takes user input as strings and (effectively) > translates them to function calls with arguments and keyword > arguments.to pass a list I use a sort of 'list constructor' - so the > syntax looks a bit like : > >checkname(arg1, "arg 2"

  1   2   >