tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

Strip /dictag in the good-words list #191

Closed tallforasmurf closed 10 years ago

tallforasmurf commented 10 years ago

In pqEdit word census code, words in an alt-dict scope are added to IMC.wordCensus as wordtext/dictag. If such a word is correctly spelled in its dict there is no issue. The issue arises when it is not correctly spelled, e.g. a typo or some variant or archaism in its language. Now the user would like to add it to good-words.

pqWords displays the word as wordtext/dictag and if you tell it add to good-words, it goes in as wordtext/dictag.

In pqEdit.doSpellCheck (called from Words panel Refresh), wordCensus items are split into wordtext and dictag (using .partition('/')) and only wordtext is tested against IMC.goodWordList and IMC.badWordList. doSpellCheck will not get a match between wordtext and wordtext/dictag, will pass it to the alt-dict and fail, and the word is still marked as misspelled even though supposedly added to good-words.

So an easy fix for this is for pqWords to split off wordtext and add only it to good-words. Then on a Refresh, doSpellCheck will find wordtext in good-words and mark it ok.

There is a potential problem in that now an identical word from a different dictionary scope (main dict or another alt-dict) will now also pass spellcheck when perhaps it shouldn't. But how likely is it that a misspelled word from one language might also appear in the main-dict or another language context where it should be marked as misspelled, when it is not misspelled in its original language? I can't think of an example.

There is no issue related to the syntax highlighter that marks misspelled words. It uses only the misspelled flag value set by doSpellCheck. So it does not have to know about alt-dict scopes, good-words, bad-words or anything.