Sinology with Python

I’m a bit late to the Jupyter Notebook bandwagon (and bandwagons in general), it seems… Now that I’ve started using it I’m seeing it everywhere.

The Chinese Text Project is one of my favorite websites, because it not only offers literally thousands of premodern Chinese texts online for free, but provides sophisticated search functions, a built-in dictionary, and other nifty features, many of which were added quite recently.

Among them is an API for accessing the text database programmatically, and a Python module which provides easy-to-use wrapper functions for it (the module is written for Python 3 and doesn’t work with Python 2, however it simply fails and doesn’t show an error message if you inadvertently try to use it with Python 2).

Donald Sturgeon, who is the author of these tools and also the maintainer of ctext.org, has posted some online tutorials using Jupyter Notebooks to show how to access the database, and some simple data analyses that can be done on texts.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s