Code Monkey home page Code Monkey logo

enhanceddictionaries's Introduction

EnhancedDictionaries 1.5.0

Nvda ADDON for handling more advanced dictionaries processing

download

Download the Enhanced Dictionaries 1.5.0 addon

Features

Profile specific dictionaries

The way NVDA applies conditional settings, such as document formatting and others, is through the use of profiles.

Profiles are groups of settings that can, together, be applied conditionally to the screen reader.

For example, you can create a profile for coding applications, in which punctuation level is set to all, indentation announcement is set to tones and speech rate is set to a slower level, so you can read code in a better way. You can, then, associate this profile with visual studio, eclipse, notepad plus plus and Visual Studio Code, so that when any of these applications become active these configurations will automatically apply.

When you alt tab to other applications, or when you close one of these applications and land in desktop, for example, the default configuration takes place. It is then possible to easily jump from your coding application to a browser and, without pressing any keys, read without punctuations in the browser and have your specific configuration applied when you are back on your code environment.

NVDA dictionaries are powerful, offering great features such as regular expression substitution. However, there is currently no way to attach dictionaries to profiles on NVDA.

This means that if you set a substitution in the default dictionary, it will be applied in all cases, even in applications or situations where you might wish they are not.

This addon implements profile context when processing and creating / editing dictionaries.

How it works?

Simply install the addon. When it's active:

  • Dictionaries are now correctly handled taking in consideration the active profile.

  • If dictionaries (default or voice specific) exist for the current profile, they are used.

  • 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.

  • 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.

  • The dictionary dialog, when opened, always shows on its title what profile that dictionary relates to.

  • The active profile will determine which dictionary is opened for editing when the default or voice dictionary menus are activated.

    This is consistent to the way NVDA behaves, because if one goes to settings and change a setting, this will be saved on the active profile.

    Similarly, the opened dictionary will belong to that profile.

  • 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.

  • 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.

    This button appears only when a profile specific dictionary is being edited. On activation, it behaves the following way:

    • The entries from default dictionary (or voice specific dictionary) from the default profile are read.
    • Entries that are not found on the dictionary being edited are added to it.
    • If an entry from the default (or voice) dictionary is found on the dictionary being edited, it does not overwrite the current entry.
    • 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 the oportunity to review the new list of entries, as if they have typed by hand all of them.
  • Whenever the user creates a dictionary on a specific profile, it is effective immediately for that profile.

  • 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.

  • 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.

Contributing and translating

If you want to contribute or translate this addon, please access the project repository and find instructions on the contributing.md in the english documentation directory.

Contributors

Special thanks to

  • Ângelo Miguel Abrantes - Portuguese translation
  • Rémy Ruiz - French translation
  • Rémy Ruiz - Spanish translation
  • Tarik Hadžirović - Croatian translation
  • Thiago Seus - Brazilian Portuguese translation
  • Umut KORKMAZ - Turkish translation
  • Ivan Shtefuriak - Ukrainian translation

enhanceddictionaries's People

Contributors

cyrilleb79 avatar ishtef avatar marlon-sousa avatar roberta-santos avatar thgcode avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

enhanceddictionaries's Issues

Addon breaks menus on the secure desktop

STR:

  1. Switch to NVDA on the secure desktop, with this addon installed.
  2. Activate one of the menu items, like settings.

I get this traceback:

IO - speech.speech.speak (07:34:05.633) - MainThread (20660):
Speaking ['Settings...', 's', CancellableSpeech (still valid)]
IO - inputCore.InputManager.executeGesture (07:34:06.184) - winInputHook (22228):
Input: kb(laptop):enter
DEBUG - external:globalPlugins.EnhancedDictionaries.ConfigManager.getActiveProfile (07:34:06.190) - MainThread (20660):
safe profile
ERROR - unhandled exception (07:34:06.191) - MainThread (20660):
Traceback (most recent call last):
  File "C:\Users\tyler\AppData\Roaming\nvda\addons\EnhancedDictionaries\globalPlugins\EnhancedDictionaries\__init__.py", line 76, in onVoiceDictionaryCommand
    dic = dictHelper.getDictionary("voice")
  File "C:\Users\tyler\AppData\Roaming\nvda\addons\EnhancedDictionaries\globalPlugins\EnhancedDictionaries\dictHelper.py", line 71, in getDictionary
    return _getVoiceDictionary(profile)
  File "C:\Users\tyler\AppData\Roaming\nvda\addons\EnhancedDictionaries\globalPlugins\EnhancedDictionaries\dictHelper.py", line 50, in _getVoiceDictionary
    if not profile.name or _hasVoiceDictionaryProfile(profile.name, synth.name, dictionaryFilename):
AttributeError: 'NoneType' object has no attribute 'name'

An easier way to debug this is to restart NVDA with --secure --debug on the normal desktop, cause the error, restart NVDA and look at %temp%\nvda-old.log.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.