PDA

View Full Version : [SOLVED] Contractions words (wouldn't shouldn't etc) - spell check is stopping at these words



ravibsd
May 22, 2012, 16:32:19
Hi,
Our testing team found out that the new TxSpell stops at contraction words like wouldn't shouldn't isn't.
I tested with your sample application and it does stop.
Any ideas how I can instruct TxSpell to ignore these words?
I can use ignore all list or add to a user dictionary but that is only a workaround.
Thank you
Ravi

Gunnar Giffey
May 22, 2012, 17:11:21
Hi Ravi,

This is happening because of the definitions in the included Hunspell dictionary.
You can find a new release for the dictionary here (http://www.textcontrol.com/downloads/dictionaries/tx_spell_dictionary.en_US.zip), which will work as expected.
See tx_spell_dictionary_2.en_US inside the ZIP archive.

ravibsd
May 22, 2012, 18:03:12
Hi Gunnar,
I tried using the dictionay you suggested in our application and still the spell check engine stops at the word
wouldn't.
I am not sure what I am missing. It looks to me the engine is scooping the word "wouldn" in "wouldn't" and spell checking the word
"wouldn".
The word "wouldn't" is also included in the dictionary that I originally had.

I believe the issue is more than just dictionary.

Thank you for your help.
Ravi


Hi Ravi,

This is happening because of the definitions in the included Hunspell dictionary.
You can find a new release for the dictionary here (http://www.textcontrol.com/downloads/dictionaries/tx_spell_dictionary.en_US.zip), which will work as expected.
See tx_spell_dictionary_2.en_US inside the ZIP archive.

Gunnar Giffey
May 22, 2012, 18:21:12
Hi Ravi,

I think you are still using the old dictionary as it works perfectly with the new one.

You can test that by coping the files en_US.aff and en_US.dic to the path
C:\Program Files\Text Control GmbH\TX Spell 2.0 .NET for Windows Forms\Assembly\Dictionaries

After that, start TX Text Control Words .NET on your machine and activate spell checking through the menu "Tools" -> Tab "Spell Checking Options" -> "Enable spell checking".
Next, type " won't". Shows up correctly here.
1782

ravibsd
August 31, 2012, 23:38:25
Hi Gunnar,
Yes it has been a long while. But finally after an interim release I am back at this issue.
This is what I found:
1. The dictionary files are the latest that you recommended.
2. Adding a custom dictionary to the default dictionary is when this issue happens.
Below is a code snippet in vb.net. Copy and paste in your own project with the references and import statements.
In this if you add the custom dictionary then the contraction word is considered misspelled. But if the custom
dictionary is not added the contraction word is not considered misspelled.
I am not sure what I am missing. Any inputs are greatly appreciated.


Private Sub btnSpellCheck_Click(sender As System.Object, e As System.EventArgs) Handles btnSpellCheck.Click

Dim userPath As String = Environment.GetFolderPath(Environment.SpecialFolde r.MyDocuments)
Dim UserDictionaryFile As String = ""
UserDictionaryFile = userPath & "\UserDict.txd"

If File.Exists(UserDictionaryFile) Then
File.Delete(UserDictionaryFile)
End If

Dim fs As FileStream = File.Create(UserDictionaryFile)
fs.Close()
fs.Dispose()

Dim sw As StreamWriter = New StreamWriter(UserDictionaryFile)
sw.WriteLine("Non-framing")
sw.Close()
sw.Dispose()

Dim UserDictionary As UserDictionary = New UserDictionary(UserDictionaryFile)
UserDictionary.DictionaryEncoding = System.Text.Encoding.ASCII


Dim txSpellChecker1 As New TXSpell
TxSpellChecker1.Create()
txSpellChecker1.Dictionaries.Add(UserDictionary)

For i As Integer = 0 To txSpellChecker1.Dictionaries.Count - 1
Debug.Print(String.Concat("Dictionary: ", txSpellChecker1.Dictionaries(i).Name))
Next


'After commenting the above line the spell checker finds the word Non-framing as incorrect word
txSpellChecker1.Check("Section 055001 - Metal Fabrications: Non-framing steel fabrications attached to joists.")
If txSpellChecker1.IncorrectWords.Count > 0 Then
For i As Integer = 0 To txSpellChecker1.IncorrectWords.Count - 1

Debug.Print(String.Concat("Incorrect Word: ", txSpellChecker1.IncorrectWords(i).Text))
MessageBox.Show(String.Concat("Incorrect Word: ", txSpellChecker1.IncorrectWords(i).Text))
Next
End If


'Adding a user dictionary will find the contractions word "wouldn't" as misspelled
txSpellChecker1.Check("I wouldn't try to do this")

If txSpellChecker1.IncorrectWords.Count > 0 Then
For i As Integer = 0 To txSpellChecker1.IncorrectWords.Count - 1

Debug.Print(String.Concat("Incorrect Word: ", txSpellChecker1.IncorrectWords(i).Text))
MessageBox.Show(String.Concat("Incorrect Word: ", txSpellChecker1.IncorrectWords(i).Text))
Next

End If

End Sub

Gunnar Giffey
September 3, 2012, 18:38:19
Hi Ravi,
First of all, please use the code tags if you paste source code (see # button).
Also, to be able to reproduce your issue, please provide me with a small sample project and a step by step guide how to reproduce your issue here.

Thanks!

ravibsd
September 4, 2012, 16:03:12
Hi Gunnar,
Sorry! will remember to use code tags next time.
I will e-mail you a project.
Thanks
Ravi

Gunnar Giffey
September 4, 2012, 17:53:31
Hi Ravi,
The issue has been acknowledged as a bug which occurs after adding a UserDictionary.
Unfortunately, there is currently no work-around available.

ravibsd
September 5, 2012, 19:55:42
Hi Gunnar,
Thank you for looking in to it.
We will wait for the bug to be fixed.
Thanks
Ravi

ravibsd
October 16, 2012, 16:07:06
Hi Gunnar,
There is a new version of spell check 3.0. Does this version address the contraction word issue?
Thanks
Ravi


Hi Ravi,
The issue has been acknowledged as a bug which occurs after adding a UserDictionary.
Unfortunately, there is currently no work-around available.

Gunnar Giffey
October 24, 2012, 17:53:51
Hi Ravi,
This bug should have been fixed with TX Spell .NET 3.0.
Did you test that yet?
A free trial version is available here: http://www.textcontrol.com/en_US/downloads/trials/index/default/spelldotnet/

ravibsd
November 8, 2013, 17:42:53
This works fine.
Please close the thread.
Thanks
Ravi