Re: regular expression, unicode

2009-04-30 Thread Simon Strobl
Thanks for your hints. Usually, all my files are utf-8. Obviously, I somehow managed to inadvertently switch the encoding when creating this specific file. I have no idea how this could happen. Simon -- http://mail.python.org/mailman/listinfo/python-list

regular expression, unicode

2009-04-29 Thread Simon Strobl
Hello, why can't I use this statement in python3: good = re.compile("^[A-ZÄÖÜ].*") According to the documentation, patterns can be unicode strings. I get this error message: Traceback (most recent call last): File "./get.py", line 8, in for line in sys.stdin: File "/usr/lib64/python3.

regular expression, unicode

2009-04-29 Thread Simon Strobl
Hello, why can't I use this pattern good = re.compile("^[A-ZÄÖÜ].*") in python3. According to the documentation, patterns may be unicode strings. I get this error message: Traceback (most recent call last): File "./get.py", line 8, in for line in sys.stdin: File "/usr/lib64/python3.0/

Re: do export statement in Python script

2008-10-22 Thread Simon Strobl
On 22 Okt., 13:24, "James Mills" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 22, 2008 at 9:19 PM, Simon Strobl <[EMAIL PROTECTED]> wrote: > > #!/usr/bin/ > > python > > > import os > > > os.system("export NLTK_DATA=/opt/nltk/data/") >

do export statement in Python script

2008-10-22 Thread Simon Strobl
Hello, a program of mine, which is supposed to be used in a project, uses nltk. I want the other users to be able to use my program without having to fiddle around with their environment. Therefore, I tried this code: #!/usr/bin/ python import os os.system("export NLTK_DATA=/opt/nltk/data/") i

Re: very large dictionary

2008-08-05 Thread Simon Strobl
> Have you considered that the operating system imposes per-process limits > on memory usage? You say that your server has 128 GB of memory, but that > doesn't mean the OS will make anything like that available. According to our system administrator, I can use all of the 128G. > > I thought it wo

Re: very large dictionary

2008-08-04 Thread Simon Strobl
On 4 Aug., 00:51, Avinash Vora <[EMAIL PROTECTED]> wrote: > On Aug 4, 2008, at 4:12 AM, Jörgen Grahn wrote: > > > (You might want to post this to comp.lang.python rather than to me -- > > I am just another c.l.p reader. If you already have done to, please > > disregard this.) > > Yeah, I hit "repl

Re: very large dictionary

2008-08-01 Thread Simon Strobl
> What does "load a dictionary" mean? I had a file bigrams.py with a content like below: bigrams = { ", djy" : 75 , ", djz" : 57 , ", djzoom" : 165 , ", dk" : 28893 , ", dk.au" : 854 , ", dk.b." : 3668 , ... } In another file I said: from bigrams import bigrams > How about using a database in

very large dictionary

2008-08-01 Thread Simon Strobl
Hello, I tried to load a 6.8G large dictionary on a server that has 128G of memory. I got a memory error. I used Python 2.5.2. How can I load my data? SImon -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with dictionaries

2008-04-23 Thread Simon Strobl
> You musts have missed the memo. The rules of the universe > changed at 0834 UST yesterday, and all functioning Python programs > stopped working. As always, the rules of the universe have not changed. (Or, at least, I do hope so.) It seems that the cause of my problem was my switching too fast

problem with dictionaries

2008-04-23 Thread Simon Strobl
Hello, the idea of the following program is to parse a frequency list of the form FREQUENCY|WORD, to store the frequency of a word in a dictionary (and to do some things with this information later). I have done this many many times. Suddenly, it does not work any more: The value frq[key] is diff