Using Python for a demonstration in historical linguistics

Vlastimil Brom vlastimil.brom at gmail.com
Sat Nov 6 12:41:09 CET 2010


2010/11/6 Dax Bloom <bloom.dax at gmail.com>:
> 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 the Grimm rule equivalent. For example:
> bʰ → b → p → f
> dʰ → d → t → θ
> gʰ → g → k → x
> gʷʰ → gʷ → kʷ → xʷ
> If the dictionary file has the word "Abe" I want the program to
> replace the letter b with f forming the word "Afe" and write the
> result in a tabular file. How easy is it to find the python functions
> to do that?
>
> Best regards,
>
> Dax Bloom
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Hi,
I guess, the most difficult part would be, to select appropriate
words, to apply the simple rules on (in order not to get "problems"
with Verner's Law or other special rules).
You also normally wouldn't want to chain the changes like the above,
but to keep them separated
bʰ → b; p → f (ie. *bʰrāter- > ... brother and not *p-... (at least
without the High German consonant shift)).
of course, there are also vowel changes to be dealt with and many more
peculiarities ...

As for implementation, I guess, the simplest way might be to use
regular expression replacements - re.sub(...) with a replace function
looking up the appropriate results in a dictionary.
maybe something along the lines:

########################################

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āter ... "
almost_germ_txt = re.sub(Rask_Grimm_re, repl_fn, ie_txt)
print u"%s >> %s" % (ie_txt, almost_germ_txt) # vowel changes etc. TBD

########################################

 bʰrāter ...  >>  brāþer ...


hth,
  vbr



More information about the Python-list mailing list