Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Help Needed for Spellcheck

by kvale (Monsignor)
on Apr 17, 2006 at 04:36 UTC ( #543753=note: print w/ replies, xml ) Need Help??


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

<compound-word> := <word> <compound-word> <word> := word1 | word2 | ... | wordn
Regexes can do this for you, for a reasonably small number of atomic words:
my $compound = "onlinetrading"; my $words = 'online|trading'; my ($first, $second); if ($compound =~ /^($words)($words)$/) { $first = $1; $second = $2; } print "$first, $second\n";
Alternatively, check out Aspell, as it has some support for compound words.

-Mark


Comment on Re: Help Needed for Spellcheck
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://543753]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-12-28 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls