Skip to content

Commit 7119d67

Browse files
committed
Fix optional DictationContainer *spoken_form* method parameter
Re: dictation-toolbox#387. This parameter is now on the base class `format()' method and has the correct name.
1 parent d61898e commit 7119d67

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

dragonfly/engines/backend_natlink/dictation.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,7 @@ def __init__(self, words, methods):
5656
DictationContainerBase.__init__(self, words=unicode_words,
5757
methods=methods)
5858

59-
def format(self, use_spoken=False):
60-
"""
61-
Format and return this dictation.
62-
63-
Arguments:
64-
- *use_spoken* (*bool*, default: *False*) --
65-
whether to use the spoken form of dictated words in the result
66-
instead of the written form
67-
68-
"""
59+
def format(self, spoken_form=False):
6960
formatter = WordFormatter()
70-
formatted = formatter.format_dictation(self._words, use_spoken)
61+
formatted = formatter.format_dictation(self._words, spoken_form)
7162
return self.apply_methods(formatted)

dragonfly/engines/base/dictation.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,17 @@ def words(self):
236236
""" Sequence of the words forming this dictation. """
237237
return self._words
238238

239-
def format(self):
240-
""" Format and return this dictation as a Unicode object. """
239+
def format(self, spoken_form=False):
240+
"""
241+
Format and return this dictation as a string.
242+
243+
Arguments:
244+
- *spoken_form* (*bool*, default: *False*) --
245+
whether to use the spoken form of dictated words in the result
246+
instead of the written form. Only has an effect if using the
247+
Natlink/DNS engine back-end
248+
249+
"""
241250
return self.apply_methods(u" ".join(self._words))
242251

243252
def apply_methods(self, joined_words):

0 commit comments

Comments
 (0)