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

Provide more options for manipulating speech dictionary entries #4252

Open
nvaccessAuto opened this issue Jul 6, 2014 · 12 comments
Open

Provide more options for manipulating speech dictionary entries #4252

nvaccessAuto opened this issue Jul 6, 2014 · 12 comments

Comments

@nvaccessAuto
Copy link

Reported by zahari_bgr on 2014-07-06 02:51
Many users have need for switching more than one speech dictionary and currently they are achieveing this by copying files and maintaining multiple copies of NVDA.
When a user works on multiple machines they also have to copy the file by hand on the right place.
For the above reasons (and also for backup and sharing purposes) It will be handy if there is a possibility of importing/exporting the speech dictionaries from/to desired location.
Also, since the entries higher in the list are applied earlier and one could only append to the list, it is somethimes nessesary to move some entries up and down.

@nvaccessAuto
Copy link
Author

Attachment moveImportExportClearRevertDict.diff added by zahari_bgr on 2014-07-06 03:11
Description:

@nvaccessAuto
Copy link
Author

Comment 1 by zahari_bgr on 2014-07-06 03:12
To achieve this, I've added the following buttons to the speech dictionary dialogs:
Move up, Move down, Import, Export, and in addition (to complete the possible actions) - Clear and Revert.
I've removed the wx.LC_SINGLE_COL option from listCtrl creation to allow selecting of multiple entries, and also modified the onRemoveClick() and made it to delete backwards.
To achieve looping backwards between the selected items I've added a GetSelectedItems() helper function to the gui module. This function accepts listCtrl object and returns a list of selected items. I used it also in the onMoveDownClick() function.

While importing, I allowed the user the choice of appending the dictionary to the current one or clearing it first by answering a Yes/No messageBox.
To prevent duplication of entries, I've used the modified speechDictHandler.SpeechDict.load() function from my patch in ticket 3656, so if that patch (or at least this concreet change) is rejected, this part of onImportClick() should be changed.
also, to apply this diff you have to apply the one from ticket 3656 first - I was wondering whether to create this ticket, or to merge all in 3656, but since they are completely different issues I ended up creating a new one.

I've attached a patch (moveImportExportClearRevertDict.diff) and also created a branch named "t4252" in the following repository:
https://bitbucket.org/zahyur/nvda.git

@nvaccessAuto
Copy link
Author

Comment 2 by nvdakor on 2014-07-06 03:41
Hi,
Would you like to make binary snapshots of your patches available? That way some alpha testers can test them for you in addition to code reviews (I'll wait till either Mick or Jamie to flag this and other patches for code review). Also, I personally think you should continue your work on 3656 branch, as your 4252 work depends on what's been implemented in 3656 (as for that though, I'd wait for Jamie's or Mick's comments next week (at the earliest, as Mick is in America at the moment). Thanks.

@nvaccessAuto
Copy link
Author

Comment 3 by beqa on 2014-07-06 04:40
hi.

for those who want to test all the modification made by @zahari_bgr i built a snapshot.

here you can download and test, however please remember, that this snapshot isn't digitally signed.

https://www.dropbox.com/s/9l609g0nwt03m0z/nvda_snapshot_source-testing-c8685e1.exe?dl=1

@nvaccessAuto
Copy link
Author

Comment 4 by jteh on 2014-07-06 09:06
Thanks for your work.

Can you/others please provide use cases (example scenarios) as to why a user would need to swap multiple dictionaries in and out? Also, doesn't #3656 cover this; i.e. if a user wants different dictionaries, they just use different profiles? I really want to avoid duplicate functionality here.

If #3656 isn't sufficient, wouldn't a user want to "load" different dictionaries rather than "importing" them?

@nvaccessAuto
Copy link
Author

Comment 5 by zahari_bgr on 2014-07-07 19:16
Hi,
thanks to Joseph and Beqa for your appinions and the provided binary build.
in #3656 the goal is invokeing the right dictionary in the right time while doing other stuff.
Here, import and export serv for managing dictionary files.
For example, when you install a new voice (or create new profile) and want to use an existing dictionary with it, or when you transfer a dictionary from one machine to another, or when a friend sends you his/her dictionary, or when you want to send your dictionary to a frend and forget where the dictionary folder was, or just wanna make backup.
Import and Export are very much like save and load, except in this case the contents of the dictionaries are copyed and one speech dictionary olways points to the same original file and location, only its contents are changeing. Import can also append the imported dictionary to the current one.
I want to avoid working directly with the file system and especialy manual editing files which is even more difficult for some people and also could leed to encodeing errors etc.
I can rename import and export to load and save if you think that sounds more appropried.

@nvaccessAuto
Copy link
Author

Comment 6 by jteh (in reply to comment 5) on 2014-07-08 07:36
Replying to zahari_bgr:

For example, when you install a new voice (or create new profile) and want to use an existing dictionary with it,

This requires that the user be able to locate the dictionary file in the NVDA configuration directory. Alternatively, they could export the dictionary and then import it, but this seems fairly clunky and still requires some understanding of the file system. I think re-use of profile dictionaries could be handled better by cloning tem along with profiles.

or when you transfer a dictionary from one machine to another, or when a friend sends you his/her dictionary, or when you want to send your dictionary to a frend and forget where the dictionary folder was, or just wanna make backup.

All of these issues aren't specific to dictionaries. They apply to normal configuration, profiles, etc. Some of that data is difficult to export alone; e.g. triggers for a specific profile. The question is how far we go with import/export functionality and how useful it is in the end, especially given that the user still has to know enough about the file system to know where they saved it.

@nvaccessAuto
Copy link
Author

Comment 8 by vgjh2005 on 2014-08-03 16:28
Hi:
dictionary entries are made by normal list items now. If the function is not useful at this time, and we had to remove them. If we want to use it again, and we must rewrite it. I thinks that it should be changed to be checkboxes. It can be opened or closed by checking or unchecking. then the label of the comment change to name. We can use regular expression to made more personal extendable function.
Thanks!

@zahyur
Copy link
Contributor

zahyur commented Aug 19, 2016

As far as I can remember, the user is pointed to the dictionary's folder, so it was very intuitive.
Maybe I made a mistake, explaining myself too much, instead of leaving the talking to the code itself. Or maybe it's hard to imagine it, without seeing it in action.
Actually, that's why I wrote it first, instead of explaining, which takes alot more time. Further modifications of course are also possible, and also wouldn't take much time - it's a simple feature.
However, I joined today just to note that I don't have plans to look at that at the near future, so anyone is free to take it over.

@derekriemer
Copy link
Collaborator

Hi:
Mind if I turn this patch into a pr? @LeonarddeR is this the same account you pulled changes from for another ticket?
This would be a useful feature, especially if I could select specific entries.
Example:
([cgat])([cgat])([cgat])([cgat])([cgat])(?=([cgat]|\b|$))
\1 \2 \3 \4 \5
makes sure the vast majority of dna sequences match, and replacing
_{4,}
with "blank" fixes a lot of exams so they say "blank' rather than 10 line.
With this feature, domain specific dictionaries could be created.

@jcsteh
Copy link
Contributor

jcsteh commented Sep 16, 2016 via email

@Adriani90
Copy link
Collaborator

@derekriemer, @jcsteh has any further discusion took place during last two years? Any updates? In my view importing and exporting dictionaries should be part of copying Settings when creating portable copies or installing NVDA from a portable copy. I also think that Profile based dictionaries could actually be enough. But I am not sure if profiles are exported when creating portable copies of NVDA.

A Feature which would really help would be a converter for speech dictionaries from other Screen Readers. But I doubt that this is feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants