Guest quakey Posted July 10, 2003 Report Share Posted July 10, 2003 Hi, I want to check spelling of a word in Perl and how do I do that? I wanted to use Aspell but it doesn't seem to have a command-line mode that would just check a word and tells if the word is spell correctly or not. I looked at the Aspell options, but there doesn't seem to be a way to do things like: aspell "checkthisword" in the command-line and return something telling me if the word is spelled correctly. It does take in a file and check the words but it also goes into a "screen" that display more options than I need. Am I missing something here? Thank you. Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted July 10, 2003 Report Share Posted July 10, 2003 You can use aspell to check a word or list from STDIN like this: echo "luzer" | aspell -l If the word is spelled correctly, it returns nothing. If it is spelled incorrectly, it returns the word. No suggestions at all as to how to spell it, though. Also you can just do aspell -l [hit enter] [type a bunch of words here and hit Ctrl-D when you are done. It only returns the words that are spelled incorrectly. Once again, no suggestions] Quote Link to comment Share on other sites More sharing options...
qnr Posted July 10, 2003 Report Share Posted July 10, 2003 Steve's usage sounds like just what you need - just an indication that it is spelled correctly. To comment on the " No suggestions at all as to how to spell it, though. ", there is an option in ispell, so I imagine aspell has it: terry@timestorm: /home/terry 21:45:56 $ echo "loooser luzer lazer atari linux" | ispell -a @(#) International Ispell Version 3.2.06 08/01/01 & loooser 1 0: looser & luzer 2 8: luger, lurer & lazer 15 14: blazer, gazer, glazer, hazer, lacer, lager, laker, lamer, laser, later, layer, lazed, lazier, mazer, razer & atari 1 20: Atari & linux 2 26: Linus, Linux Note that it will show you proper capitalization, too Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted July 10, 2003 Report Share Posted July 10, 2003 Wow, there is: aspell -a [hit enter] [type a word][hit enter] [an asterick means it is spelled correctly....suggestions otherwise] [when done hit Ctrl-C] or echo "some word" | aspell -a Quote Link to comment Share on other sites More sharing options...
Guest quakey Posted July 10, 2003 Report Share Posted July 10, 2003 THANK YOU GUYS!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.