Text this: A novel algorithm for analysing gravitational microlensing events