-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
71 lines (51 loc) · 2.98 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
SUBVERTLE
-----------------------------------------------------------------------
Subvertle is a set of tools to extract, manipulate and synthesize BBC iPlayer
subtitles, created for Culture Hack Day London 2011.
Its main constituents are:
- python/subvertle/iplayerlib.py - a Python library to access iPlayer metadata
- python/subvertle/translate.py - a translation framework, to iteratively transform
text into different dialects
- python/subvertle/singSomeText.py - an interface to the Canoris web service, to
- python/web/subvertle-web.py - a Flask-based web framework to access, translate
and serve iPlayer subtitles
- python/web/subvertle-web.py - a Flask-based web framework to access, translate
and serve iPlayer subtitles
- greasemonkey/iplayer_subtitles.user.js
- a Greasemonkey (Firefox) script which overlays
subtitles onto iPlayer by interfacing with the
subvertle-web service.
REQUIREMENTS
-----------------------------------------------------------------------
For the iPlayer library (iplayerlib.py), no libraries are required.
Python 2.5+ is supported.
A number of python module dependencies are present for additional functionality:
- nltk (for translation)
- swmixer, canoris (for singing)
- Flask (for web services)
- xgoogle.translate (for language translation):
http://www.catonmat.net/blog/python-library-for-google-translate/)
USAGE
-----------------------------------------------------------------------
For an example of the iPlayer interface and translation code in action:
cd python
python example.py <iplayer_programme_url>
Translation
-----------------------------------------------------------------------
The subtitles can be arbitrarily transformed through the connection of translation
'pipes'. The 'plumber' object takes a list of pipe names in its constructor, and will
then sequentially run any text it is given to process() through these 'pipes'. All
pipe definitions are in subvertle/pipes, the process is straight-forward and creation of
more should be easy. Currently there exists:
- expletive: adds swear words at appropriate points (using nltk)
- language: use Google Translate to convert between languages
- swap: general module for performing basic substitution
- lolspeak: exactly what it says on the tin, annoying but easy to implement
The plumber object can be created thus:
translator = plumber(["expletive"]) # just add expletives
translator = plumber(["lolspeak","expletive"]) # make lolspeak, then add expletives
# add expletives, translate to Spanish then French and back to English, finally make lolspeak
# note that the languages are their own list
translator = plumber(["expletive",["es","fr","en"],"lolspeak"])
Text can then be processed simply using:
translationString = translator.process(originalString)