Re: Using Python for a demonstration in historical linguistics

2010-11-27 Thread Vlastimil Brom
2010/11/27 Dax Bloom : > On Nov 6, 6:41 am, Vlastimil Brom wrote: >> 2010/11/6 Dax Bloom : >> ... >> Rask_Grimm_re = ur"[bdgptk]ʰ?" >> Rask_Grimm_dct = {u"b":u"p", u"bʰ": u"b", u"t": u"þ", } # ... >> >> def repl_fn(m): >>     return Rask_Grimm_dct.get(m.group(), m.group()) >> >> ie_txt = u" bʰrāte

Re: Using Python for a demonstration in historical linguistics

2010-11-26 Thread Dax Bloom
On Nov 6, 6:18 am, Peter Otten <__pete...@web.de> wrote: > Peter Otten wrote: > s = """ > > ... In the framework of a project onevolutionarylinguisticsI wish to > > ... have a program to process words and simulate the effect of sound > > ... shift, for instance following the Rask's-Grimm's rul

Re: Using Python for a demonstration in historical linguistics

2010-11-26 Thread Dax Bloom
On Nov 6, 6:41 am, Vlastimil Brom wrote: > 2010/11/6 Dax Bloom : > > > > > > > Hello, > > > In the framework of a project on evolutionary linguistics I wish to > > have a program to process words and simulate the effect of sound > > shift, for instance following the Rask's-Grimm's rule. I look to

Re: Using Python for a demonstration in historical linguistics

2010-11-06 Thread Vlastimil Brom
2010/11/6 Dax Bloom : > Hello, > > In the framework of a project on evolutionary linguistics I wish to > have a program to process words and simulate the effect of sound > shift, for instance following the Rask's-Grimm's rule. I look to have > python take a dictionary file or a string input and rep

Re: Using Python for a demonstration in historical linguistics

2010-11-06 Thread Peter Otten
Peter Otten wrote: s = """ > ... In the framework of a project on evolutionary linguistics I wish to > ... have a program to process words and simulate the effect of sound > ... shift, for instance following the Rask's-Grimm's rule. I look to have > ... python take a dictionary file or a stri

Re: Using Python for a demonstration in historical linguistics

2010-11-06 Thread garabik-news-2005-05
Dax Bloom wrote: ... > I look to have > python take a dictionary file or a string input and replace the > consonants in it with the Grimm rule equivalent. ... > How easy is it to find the python functions > to do that? > http://code.activestate.com/recipes/81330-single-pass-multiple-replace/ --

Re: Using Python for a demonstration in historical linguistics

2010-11-06 Thread Steven D'Aprano
On Sat, 06 Nov 2010 11:09:34 +0100, Peter Otten wrote: > If you are using nonascii characters like θ you should use unicode > instead of str. Basically this means writing string constants as u"..." > instead of "..." Or using Python 3.1 instead of 2.x. -- Steven -- http://mail.python.org/ma

Re: Using Python for a demonstration in historical linguistics

2010-11-06 Thread Peter Otten
Dax Bloom wrote: > Hello, > > In the framework of a project on evolutionary linguistics I wish to > have a program to process words and simulate the effect of sound > shift, for instance following the Rask's-Grimm's rule. I look to have > python take a dictionary file or a string input and replac

Re: Using Python for a demonstration in historical linguistics

2010-11-05 Thread MRAB
On 06/11/2010 02:17, Dax Bloom wrote: Hello, In the framework of a project on evolutionary linguistics I wish to have a program to process words and simulate the effect of sound shift, for instance following the Rask's-Grimm's rule. I look to have python take a dictionary file or a string input

Re: Using Python for a demonstration in historical linguistics

2010-11-05 Thread Chris Rebert
On Fri, Nov 5, 2010 at 7:17 PM, Dax Bloom wrote: > Hello, > > In the framework of a project on evolutionary linguistics I wish to > have a program to process words and simulate the effect of sound > shift, for instance following the Rask's-Grimm's rule. I look to have > python take a dictionary fi

Using Python for a demonstration in historical linguistics

2010-11-05 Thread Dax Bloom
Hello, In the framework of a project on evolutionary linguistics I wish to have a program to process words and simulate the effect of sound shift, for instance following the Rask's-Grimm's rule. I look to have python take a dictionary file or a string input and replace the consonants in it with th