Improve your knowledge of the english language by learning new words used in your favourite TV Shows and movies
Subtle is a simple Ruby command-line program that analyze SubRip subtitles files. It extracts all the unique words and check these agains a local dictionary of common words. The entries not found in the dictionary are translated from English to Italian (or a language of your choice).
- Download the
subtle.rb
script and thedictionary.txt
file; - Install the Google API gem
$ gem install google-api-client
; - Obtain a key from Google to use their API;
- Write the key in a filename called
api.key
; - Enable billing on Google Developer Console to be able to call the Translate API;
Run the script with the following command:
$ subtle.rb filename.srt
The program produces to file output:
filename.srt.dictionary.txt
with the list of new words, that can be manually added to the main dictionary;filename.srt.translations.txt
with the list of translations as showed in the screenshot above.