Spellchecker now works, but is very slow

Data is passed to the Python spellchecker by performing base64 encoding,
writing it to file, then being read from file and base64 decoded, then
the spellchecker reads in a giant text file, trains itself using that,
then spellchecks every single word whilst trying to maintain punctuation
and case, then returns that back to Matlab. The whole process is too
slow to be of any use.