Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow attaching speech dictionaries to profiles #3656

Open
nvaccessAuto opened this issue Nov 20, 2013 · 13 comments
Open

Allow attaching speech dictionaries to profiles #3656

nvaccessAuto opened this issue Nov 20, 2013 · 13 comments
Labels
blocked/needs-code-review component/speech enhancement triaged Has been triaged, issue is waiting for implementation.

Comments

@nvaccessAuto
Copy link

Reported by clev on 2013-11-20 23:22
Along with settings, one must be able to associate speech dictionariies to profiles. This will allow for example to put some words in the dictionary for making NVDA less verbose in some problematic sites, such as Google Groups and Outlook.com, where it keeps saying clicable clicable clicable clicable each time I move to a different heading. Another use will be to "translate" specific applications to other languages when it isn't possible to truly translate them, for whatever reason.
Blocking #4832

@nvaccessAuto
Copy link
Author

Comment 2 by zahari_bgr on 2014-06-22 19:57
Hi,
silensing system messages and translating are not the best examples, but this is a modern version of long requested application specific dictionaries.
However, this one is better, cause you can have one profile for reading emoticons, one for mathematical expressions etc. and use them in many applications.
here is my attempt to solve this problem (look at the attached profDict.diff).
I mimicked in big part the way voice dictionaries work, and also I've added 2 functions to handle deleting and renaming profiles.
I've changed a little speechDictHandler.SpeechDict.load() so a profile specific dictionaries could stack (when a manually activated profile and a triggered one are active at the same time).
I've created a menuitem in preferences -> speech dictionaries which is enabled if there is more than one loaded profile, e.g. something other than the default configuration.
To update the state of menuitem i call gui.initialize() which is not very clever, but I couldn't find a better way.
I've added a function to handle the menuitem which calls the appropriate dialog only with dictionary entries for the profile currently being edited.

I'm a beginner in Python and I have very little knolage how NVDA Core works so I will be happy if you can review it and point me my mistakes and how things could be achieved better.

@nvaccessAuto
Copy link
Author

Comment 3 by zahari_bgr on 2014-06-24 22:44
Hi,
I've edit my patch a little. I don't update the whole gui when a profile is loaded or unloaded anymore - I now assign an Id to the menuitem with wx.NewId() and use this to enable/disable the menuitem. I've also added a third argument to loadProfileDict to allow just returning a new SpeechDict object loaded with the data for the appropried profile - to feed the dictionary dialog. I've added a few checks and rearranged things a little.

@nvaccessAuto
Copy link
Author

Comment 5 by zahari_bgr on 2014-07-06 02:40
I've updated the patch against the latest master, and also changed the behaviour of the SpeechDictHandler.handleConfigProfileSwitch() when it is called with no parameters - it now will try to get the profiles directly from config.conf.profiles.
I've forked the bitbucket repository and created a branch for this ticket called "t3656". It can be found on:
https://bitbucket.org/zahyur/nvda.git

@nvaccessAuto
Copy link
Author

Attachment profDict.diff added by zahari_bgr on 2014-07-10 15:04
Description:

@nvaccessAuto
Copy link
Author

Comment 6 by zahari_bgr on 2014-07-10 15:06
Hi,
I found a better way to update the state (enabled/disabled) of the Profile dictionaries menuitem, which looks like the best I could imagine so far.
Now I listen for the wx.EVT_UPDATE_UI and call a handler that updates the state accordingly to the number of active profiles, and that's all.
I also changed the check for duplicate entries during load to check all atributes and not just pattern and replacement.

@nvaccessAuto
Copy link
Author

Comment 10 by vgjh2005 on 2015-01-20 07:46
Hi:
When does NVDA merge this ticket into mainversion? More games use NVDA to the screen reader because of NVDA controller client. Thanks!

@bhavyashah
Copy link

@jcsteh and others: Just a friendly reminder to review this almost 3-year-old code submission.

@bdorer
Copy link
Sponsor

bdorer commented Jan 21, 2018

I like this functionality. I don't know wheather you have abbreviations which mean something complete.
In german we use km for kilometer but if you read medical evidences km means "Kapselmuster" so it would be really helpful to have this.

@feerrenrut
Copy link
Contributor

This issue seems to have been forgotten about. The repo/branch still seems to be available here https://bitbucket.org/zahyur/nvda/branch/t3656#diff.

For this to be included in NVDA, the following needs to be done:

  • merge master into this branch, fix any conflicts.
  • Re test the expected behaviour.
  • Create a Pull Request against NVDA's master branch, explaining the changes.

@Adriani90
Copy link
Collaborator

Is there any chance to see it in NVDA 2018.1? It would really help for example in some Applications where the language of the synthesizer is being changed by profile setting. For example when using MS Excel in english but other applications in german.
We have many other users who would benefit out of it.

@marlon-sousa
Copy link
Contributor

marlon-sousa commented Apr 14, 2020

Hello,

I have created a completely new pull request #11005 to address this, as so many things have been changed in NVDA structure itself.

@feerrenrut and @Adriani90 and others please review carefully the considerations below, as they haven't be discussed on this issue and should be. The pull request currently addresses the problem in the way I describe below:

1- Dictionaries are now correctly handled taking in consideration the active profile.
1.1- If dictionaries (default or voice specific) exist for the current profile, they are used.
1.2- If they don't exist, the dictionaries for default profile are used. This is consistent to the way NVDA behaves, in the sense that when I create a new profile the configurations I don't change on this new profile are taken from the default one. Similarly, if I don't set a dictionary for a profile, the default dictionary is used.
1.3- Voice dictionaries behave the exact same way: if there is a voice specific dictionary for the active profile, it is used. Otherwise, the dictionary for that voice from the default profile (if it exists) is used.
1.4- The dictionary dialog, when opened, always shows on its title what profile that dictionary relates to.
1.5- If you go to the nvda settings menu and open dictionaries from there, the active profile will determine which dictionary is opened for editing. This is consistent to the way NVDA behaves, because if I go to settings and change a setting, this will be saved on the active profile. Similarly, the opened dictionary will belong to that profile.
1.5.1- If a given dictionary does not exist on an active profile and the dictionary dialog is opened, a new dictionary for that profile will be created. It will show no entries, as it is new. However, it won't be saved until the user closes that dialog clicking on "ok". If they do, the new dictionary will be effective. If they cancel the dialog, the default profile dictionary will still be used and no profile specific dictionary is saved.
1.5.2- When a new profile specific dictionary is created, it becomes effective and, thus, the patterns on the default dictionary are no longer active for that profile. This might be the desired behavior, but perhaps not. Perhaps the user wants to use all the patterns from the default dictionary plus new patterns only active on this profile. To cover this possibility, a new button, called "import entries from default dictionary profile", is created in the dictionary dialog.
1.5.3- This button appears only when a profile specific dictionary is being edited. On activation, it behaves the following way:
1.5.3.1- The entries from default dictionary (or voice specific dictionary) from the default profile are read.
1.5.3.2- Entries that are not found on the dictionary being edited are added to it.
1.5.3.3- If an entry from the default (or voice) dictionary is found on the dictionary being edited, it does not overwrite the current entry.
1.5.3.4 - The import does not save the new entries on disc. It just adds imported entries in the entries list in the dictionary dialog. Focus is placed on the list and the user then has a oportunity to review the new list of entries, as if they have typed by hand all of them.
1.6- Whenever the user creates a dictionary on a specific profile, it is effective immediately for that profile.
1.7- Whenever a profile changes, the specific dictionaries (default and voice) become active immediately. If these dictionaries do not exist, the default profile one's are used.
1.8- Builtin and temp dictionaries aren't affected, they are not dependent on profiles, the latter because it is temporary, the former because it is built in.

The solution is currently implemented and tested as much as I can. Documentation will be written (mostly from this comment) if you and of course the owners agree.

@marlon-sousa
Copy link
Contributor

Due to the recent pull requests freezing, I have taken #11005 and put the code into an addon with the exact behavior for now, until this is considered.
It is at the following repository: https://github.com/marlon-sousa/EnhancedDictionaries

@cary-rowen
Copy link
Contributor

I feel very powerless, I really hope that this feature will appear in the NVDA core, but the current problem makes me see no hope.
Where are the disputes and differences, is there anyone who can make the final decision?

@seanbudd seanbudd added the triaged Has been triaged, issue is waiting for implementation. label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-code-review component/speech enhancement triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

8 participants