To check the spell of a text file, maybe written with vi/vim, emacs, or any other text editor even sed, awk or a here-document, you may use aspell.
From the man page:
aspell is a utility program that connects to the Aspell library so that
it can function as an ispell -a replacement, as an independent spell
checker, as a test utility to test out Aspell library features, and as
a utility for managing dictionaries used by the library.
The Aspell library contains an interface allowing other programs direct
access to it’s functions and therefore reducing the complex task of
spell checking to simple library calls. The default library does not
contain dictionary word lists. To add language dictionaries, please
check your distro first for modified dictionaries, otherwise look here
for base language dictionaries http://aspell.net.
So, you may write your text file, with any editor, and once done, enter this command, for example imagine you have written test.txt
Here is what the file has:
helo, heri is a documet wit some erors to be checed by Aspell
Now run aspell.
aspell check test.txt
This is the screen you will see:

If this was useful for you, please consider making a donation, any amount is welcome, please proceed by clicking on the yellow donate button, thank you in advance.





