Hi All.
Using: $field{'phrase'} which contains a form input, for example "auto dealers new", i am running a well working ispell routine to check spelling on the entry, what I am having a devil of a time figuring out is how to substitute the corrected words for the misspelled words and retain all corrected words...
Example: Entry... aurto dealers nerw (sloppy fingers)
will find auto and new as correct replacements for the misspelled words, but it will also find a custom dictionary collection of other words that might be intended.. i need to respond with
auto dealers new
audio dealers new
etc... where the misspelled words are offered in the fully corrected phrase for each variation..
this is being used: it houses the 'term' which is the incorrect 'word' and the corresponding 'replace' word, it can be quite long with variations...
@corrected = split('\n',$spellingcorrected);
for $cor (@corrected){
($term,$replace)=split(/\|/,$cor);
}
Having assigned $field{'phrase'} to $phrase
This ($phrase =~ s/$term/$replace/) works to make one replacement on the original, but once replaced, a word with a different alternative can't be replaced...
Please... i'm seeking expertise well past my meager mind...
any help will be greatly appreciated
thank you all...
Using: $field{'phrase'} which contains a form input, for example "auto dealers new", i am running a well working ispell routine to check spelling on the entry, what I am having a devil of a time figuring out is how to substitute the corrected words for the misspelled words and retain all corrected words...
Example: Entry... aurto dealers nerw (sloppy fingers)
will find auto and new as correct replacements for the misspelled words, but it will also find a custom dictionary collection of other words that might be intended.. i need to respond with
auto dealers new
audio dealers new
etc... where the misspelled words are offered in the fully corrected phrase for each variation..
this is being used: it houses the 'term' which is the incorrect 'word' and the corresponding 'replace' word, it can be quite long with variations...
@corrected = split('\n',$spellingcorrected);
for $cor (@corrected){
($term,$replace)=split(/\|/,$cor);
}
Having assigned $field{'phrase'} to $phrase
This ($phrase =~ s/$term/$replace/) works to make one replacement on the original, but once replaced, a word with a different alternative can't be replaced...
Please... i'm seeking expertise well past my meager mind...
any help will be greatly appreciated
thank you all...