Jump to content

(solved) Help Big_Daddy's Spell Check


Recommended Posts

1 hour ago, Subz said:

Believe I figured out the issue:

You need to turn off sorting of the listbox otherwise the index in $oSpellCollection won't match the listbox.

$Listbox1 = GUICtrlCreateList("", 24, 168, 137, 97, BitOR($WS_BORDER, $WS_VSCROLL))
$Listbox2 = GUICtrlCreateList("", 232, 168, 137, 97, BitOR($WS_BORDER, $WS_VSCROLL))

 

2 hours ago, Subz said:

Not sure if you tried my code above, but that way will always work correctly since it's getting the text that you selected from the listbox, otherwise you're using the index returned from the listbox to determine the word in the $oSpellCollection object based upon that index, which means it could always return the wrong text.

Yes sir you did.  Thanks.  All good to go.  Its always those little details.  Thank you!

Link to comment
Share on other sites

  • 6 years later...

I'm having an issue with this and punctuations. If a word that I want to correct happens to have a punctuation this will error out because when it searches for the word in the array to correct it, it wont find it because it's looking for the word without the punctuation, but in the array the punctuation is on it. 

1/ I tried regexpreplace before the lookup to remove punctuations which prevents the errors, but when submitting the final corrected passage it is without punctuations.

2/ I tried simply exiting the function if the word isn't found in the array (because it has a punctuation attached), but that will obviously not be any good.

3/ I though about on the error of searching the array do some complicated gymnastics and separate the punctuation, send the word through the spell correction, and then add the punctuation back after. The problem with this is there's no way (I see) of knowing with certainty...although 99% sure...where the punctuation would go afterwards....and I possibly put the punctuation in the wrong place.

Any suggestions on a better way to attack this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...