Install for python 27
 Installation stable version python2
 How to start
 Log of changes
 Problems with installation
 problems with NatLink
 Speech Model
 Ini file strategy
 Configure administrator rights
 Setting HOME
 Technical details
  configure GUI
  Batch mode for configuration
  Testing natlink
  Working with subversion
Installation experimental version python3
log of changes Python 3


This module was written by Joel Gould a few years after the initial release of NatLink. It is in the MacroSystem/Core directory of NatLink.

The purpose is to do formatting of the dictated words in a window/control (VDct) was replaced by a DictGramBase subclass. By this DictGramBase all dictated words are caught, but not formatted.

Nsformat can also be used to format words that are called by the dgndictation imported rule, also called _anything in Vocola.

In NatSpeak versions up to 10 the word properties of each dictated word were extracted and with these word properties the words were formatted.

Starting with Dragon 11 the word properties cannot be extracted by NatLink anymore, but a new mechanism of category is introduced in dictated words. Like:

.\period\full stop
a\spelling-letter\A  (in spell mode)
l\spelling-letter\Lima (in spell mode)

With these categories the formatting properties are constructed in the updated version of nsformat (with release 4.0 of NatLink).


The essential call to nsformat is:

import nsformat
    def gotResults_dgndictation(self, words, fullResults):
        formattedOutput, outputState = nsformat.formatWords(words, state=-1)  # no capping, no spacing

  • Note the output is a tuple of length 2, the output text and the output state, the latter can be used in a subsequent call of nsformat.
  • This example comes (a bit adapted) from the grammar, see there for more implementation details.
  • Do not forget dgndictation imported; in your grammar specification. If you use the DocstringGrammar subclass (like, you can define importedrule_dgndictation instead.


The state to start with can be given as None (default), as integer or as tuple.



None (default)

no space next, active cap next (like beginning of dictation box)


no properties set, will start with a space and lowercase


no space, starting with lowercase

positive integer

extract properties according to bit positions

tuple of integers

these are the "extracted properties", examples:

(8, 11)

no space at start, capitalize all words

(8, 12)

no space at start, uppercase all words

(13, 14)

no spacing, all lowercase (eg for dictating email address)


See more details in the source file,, and in the unittest file (in the PyTest directory of NatLink).