in reply to Help Needed for Spellcheck
The compound word could also be split "on line trading" and in general, there is more than one way to do it. I would create a personal dictionary of atomic words that you want and test against those. You would do this by implementing the grammar
Regexes can do this for you, for a reasonably small number of atomic words:<compound-word> := <word> <compound-word> <word> := word1 | word2 | ... | wordn
Alternatively, check out Aspell, as it has some support for compound words.my $compound = "onlinetrading"; my $words = 'online|trading'; my ($first, $second); if ($compound =~ /^($words)($words)$/) { $first = $1; $second = $2; } print "$first, $second\n";
-Mark
In Section
Seekers of Perl Wisdom