How difficult it would be to integrate spell checker?

Let’s say you have nice screenplay/dialogue editor. It’s convenient, easy to use for writer.
The only missing functionality is a spell checker.

How do you think, how difficult it would be integrate spell checker with engine?
The basic mechanism seems to easy to implement, but there could be a lot of surprises when it comes to operating on text.
Is it worth to use some open source library?

Do you have any experience with it?