[[Bug 18305]] Add Synonyms to Dictionary #5669
Conversation
LC 7 allowed searching for synonyms within the dictionary. Implementation appears to have been by duplicating the dictionary entries for each synonym. This fix will duplicate the dictionary entry for each synonym when the entries are built from the repository. "Synonym of" is added to the display name of each non-glossary entry (glossary synonyms do not seem to mean that the terms mean the same thing - i.e. card button, card field, card control, card object). The change is made in the "revDocsParseDictionaryToLibraryArray" handler. On each pass through the loop, the resulting array is tested to see if the "Synonyms" key contains data. If it does, then loop through each synonym and duplicate the entry (taking into account that glossary entries specify themselves as a synonym). The display name is changed to the synonym and "Synonym of ..." is added as a cross-reference for non-glossary entries.
Hi @bwmilby, thanks very much for the fix and very thorough commit message! It looks good to me. Regarding your second point, yes it perhaps does need something like what you mention there - although I'm slightly wary of something called I think the best option would be to make the dictionary search use display name as well as display syntax in its search - along with this commit that would solve the problem. |
Update the bug fix to add the synonym to the "display syntax" element. Each dictionary entry only carries the first "syntax" entry over to the "display syntax" as [1]. Using [2] for the synonym entry (it does not get displayed in the dictionary window).
Just saw your comment after I committed a change with the 'display syntax' addition. Not sure how to back that commit out though. |
@bwmilby I wouldn't back out the commit, just change it locally and push again. |
Pull #1658 created on livecode-ide to add the display name to the search in the IDE. |
Back out the "display syntax" addition to the dictionary. Pull request livecode#1658 created on the IDE to update the dictionary search to include the "display name".
@livecode-vulcan review ok 941f789 |
@bwmilby We can squash these commits when merging so that it comes out as a single commit anyway. Thanks very much! |
💙 review by @livecodeali ok 941f789 |
😎 test success 941f789
|
This reverts commit d72f163. Due to a regression where search terms such as "mobile" will display the "iphone" synonyms first and give the impression that those are the preferred entries. Changes are being made to the IDE (dictionary viewer) to implement the synonym search there. This code also caused issues with duplicates being displayed in the new Autocomplete feature.
Revert "[[Bug 18305]] Add Synonyms to Dictionary (#5669)" This reverts commit d72f163. Due to a regression where search terms such as "mobile" will display the "iphone" synonyms first and give the impression that those are the preferred entries. Changes are being made to the IDE (dictionary viewer) to implement the synonym search there. This code also caused issues with duplicates being displayed in the new Autocomplete feature.
Revert "[[Bug 18305]] Add Synonyms to Dictionary (#5669)"
LC 7 allowed searching for synonyms within the dictionary. Implementation appears to have been by duplicating the dictionary entries for each synonym. This fix will duplicate the dictionary entry for each synonym when the entries are built from the repository. "Synonym of" is added to the display name of each non-glossary entry (glossary synonyms do not seem to mean that the terms mean the same thing - i.e. card button, card field, card control, card object).
The change is made in the "revDocsParseDictionaryToLibraryArray" handler. On each pass through the loop, the resulting array is tested to see if the "Synonyms" key contains data. If it does, then loop through each synonym and duplicate the entry (taking into account that glossary entries specify themselves as a synonym). The display name is changed to the synonym and "Synonym of ..." is added as a cross-reference for non-glossary entries.