<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>TSF Aware : dictation</title><link>http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx</link><description>Tags: dictation</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>What’s new in Windows Speech Recognition?</title><link>http://blogs.msdn.com/tsfaware/archive/2009/01/29/what-s-new-in-windows-speech-recognition.aspx</link><pubDate>Thu, 29 Jan 2009 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9378890</guid><dc:creator>Eric Brown</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/9378890.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=9378890</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=9378890</wfw:comment><description>&lt;P&gt;Now that the Beta of Windows 7 is out, it’s time to talk about the improvements and new features in Windows Speech Recognition.&lt;/P&gt;
&lt;P&gt;For Windows 7, we focused primarily on improving the user experience and removing the “rough spots” that we did not have time to fix in Vista.&lt;/P&gt;
&lt;P&gt;First and foremost, we focused on performance.&amp;nbsp; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;We rewrote the logic that builds the “say what you see” grammar to use the new native UI Automation API (instead of the MSAA IAccessible API).&amp;nbsp; This dramatically reduces the number of cross-process COM calls (by an order of magnitude), and speeds up the grammar generation by about 5-6 times. &lt;/LI&gt;
&lt;LI&gt;The document harvester also has substantial performance improvements; &lt;/LI&gt;
&lt;LI&gt;Building the “start application” grammar also runs much faster, as well. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Second, we focused on usability.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Dictation into TSF-unaware applications works &lt;STRONG&gt;much&lt;/STRONG&gt; better than it did before.&amp;nbsp; Now, when you dictate into an unaware application, the dictation scratchpad appears. 
&lt;UL&gt;
&lt;LI&gt;You can use the scratchpad as a temporary document, and it is even voice, mouse, and keyboard-enabled; you can type, use the arrow keys for navigation, or use the mouse or voice commands to select and correct text before inserting the finished text into the unaware application. &lt;/LI&gt;
&lt;LI&gt;If you don’t like the scratchpad, you can turn it off, and your dictations will be directly inserted into the unaware application. &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Sleep mode works &lt;STRONG&gt;much&lt;/STRONG&gt; better than it did before; false recognitions of “start listening” have been greatly reduced. &lt;/LI&gt;
&lt;LI&gt;We simplified the transitions between OFF and SLEEP mode; for security reasons, we now default to OFF after “stop listening”; although users can change the default to SLEEP mode.&amp;nbsp; (We call this “voice activation” in the Control Panel and First Time User Experience.) &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Third, we looked at accuracy.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The SR engine now uses the WASAPI audio stack, so we support array microphones and echo cancellation; this vastly improves WSR’s accuracy when used without a headset. &lt;/LI&gt;
&lt;LI&gt;Document harvesting runs periodically, rather than just at startup; this lets the harvester pick up new documents as you create them, rather than having to wait for you to reload speech. &lt;/LI&gt;
&lt;LI&gt;You can upload your training data to Microsoft, so that we can improve the recognizers in the future.&amp;nbsp; (You have to initiate this, incidentally; we will not upload any data without your explicit consent.)&lt;/LI&gt;
&lt;LI&gt;The Chinese recognizer has substantial accuracy improvements as well.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Lastly, we did a few tweaks to the recognizer.&amp;nbsp; In Vista, 3rd party applications couldn’t tell whether the shared recognizer was ON or SLEEPing.&amp;nbsp; For Win7, there are new APIs that expose SLEEP mode.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9378890" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/WSR/default.aspx">WSR</category></item><item><title>More ways to fix problems with dictation</title><link>http://blogs.msdn.com/tsfaware/archive/2008/09/05/more-ways-to-fix-problems-with-dictation.aspx</link><pubDate>Fri, 05 Sep 2008 22:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8926767</guid><dc:creator>Eric Brown</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/8926767.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=8926767</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=8926767</wfw:comment><description>&lt;p&gt;One common cause of dictation not working is that CTFMon is not running.&amp;#160; This is a helper process used by the Text Services Framework to implement things like global compartments and the like.&lt;/p&gt;  &lt;p&gt;If dictation is not working, try running this command from an elevated command prompt:&lt;/p&gt;  &lt;p&gt;schtasks /Query /TN \Microsoft\Windows\TextServicesFramework\MsCtfMonitor&lt;/p&gt;  &lt;p&gt;(all on one line)&lt;/p&gt;  &lt;p&gt;You should get some output that looks like this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="3"&gt;TaskName&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Next Run Time&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Status     &lt;br /&gt;=================== =============&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =======      &lt;br /&gt;MsCtfMonitor&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; N/A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Running&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If the status doesn’t say ‘Running’, then you need to restart CTFMon like this:&lt;/p&gt;  &lt;p&gt;schtasks /Run /TN \Microsoft\Windows\TextServicesFramework\MsCtfMonitor&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Run the query again, and verify that the MsCtfMonitor task is running.&lt;/p&gt;  &lt;p&gt;Once it is, restart Windows Speech Recognition, and dictation should work again.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8926767" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/TSF+Manager/default.aspx">TSF Manager</category></item><item><title>Inline Dictation commands</title><link>http://blogs.msdn.com/tsfaware/archive/2008/08/26/inline-dictation-commands.aspx</link><pubDate>Wed, 27 Aug 2008 02:15:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8898517</guid><dc:creator>Eric Brown</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/8898517.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=8898517</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=8898517</wfw:comment><description>&lt;p&gt;I’ve heard from a number of sources that there isn’t any good documentation about the ‘inline’ dictation commands.&amp;#160; These commands can be uttered in the middle of a dictation stream (in other words, you don’t have to stop speaking to use these commands), and are used to guide the Speech Recognition Engine to produce the desired results.&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;strong&gt;Command&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;tab&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Inserts a &amp;lt;tab&amp;gt; character.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;new-line&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Inserts a new line character and forces the next word to be capitalized.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;new-paragraph&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Inserts two new line characters and forces the next word to be capitalized.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;caps &amp;lt;word&amp;gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Capitalizes the first letter of &amp;lt;word&amp;gt;.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;no caps &amp;lt;word&amp;gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Lowercases &amp;lt;word&amp;gt;.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;all caps &amp;lt;word&amp;gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Uppercases &amp;lt;word&amp;gt;.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;no space&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Does not insert a space before the next word.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;literal &amp;lt;argument&amp;gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Does not perform any inverse text normalization on &amp;lt;argument&amp;gt;.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;numeral &amp;lt;argument&amp;gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Forces &amp;lt;argument&amp;gt; into numeric form, if possible.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;Simple Examples&lt;/h2&gt;  &lt;p&gt;Tab, new-line, new-paragraph, caps, no caps, and all caps are pretty straightforward:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;strong&gt;User Input&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;&lt;strong&gt;Recognition Result&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;king &lt;em&gt;tab&lt;/em&gt; county&lt;/td&gt;        &lt;td valign="top" width="200"&gt;king&amp;lt;tab&amp;gt;county&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;this is a test &lt;em&gt;new-line&lt;/em&gt; this is another test&lt;/td&gt;        &lt;td valign="top" width="200"&gt;This is a test          &lt;br /&gt;This is another test&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;this is a test &lt;em&gt;new-paragraph&lt;/em&gt; this is another test&lt;/td&gt;        &lt;td valign="top" width="200"&gt;This is a test          &lt;br /&gt;          &lt;br /&gt;This is another test&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;em&gt;no caps&lt;/em&gt; C I A&lt;/td&gt;        &lt;td valign="top" width="200"&gt;cia&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;C I A&lt;/td&gt;        &lt;td valign="top" width="200"&gt;CIA&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;I have &lt;em&gt;caps&lt;/em&gt; in my closet&lt;/td&gt;        &lt;td valign="top" width="200"&gt;I have In my closet&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;I have &lt;em&gt;all caps&lt;/em&gt; nothing&lt;/td&gt;        &lt;td valign="top" width="200"&gt;I have NOTHING&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;I have &lt;em&gt;no space&lt;/em&gt; available&lt;/td&gt;        &lt;td valign="top" width="200"&gt;I haveavailable&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h2&gt;Examples using &amp;lt;literal&amp;gt;&lt;/h2&gt;  &lt;p&gt;In order to understand what &amp;lt;literal&amp;gt; does, you need to know what Inverse Text Normalization does.&amp;#160; Inverse Text Normalization is the process of converting spoken forms into a preferred textual representation.&amp;#160;&amp;#160; Some examples are:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;strong&gt;User Input&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;&lt;strong&gt;Recognition Result&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;doctor smith&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Dr. Smith&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;period&lt;/td&gt;        &lt;td valign="top" width="200"&gt;.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;united states of america&lt;/td&gt;        &lt;td valign="top" width="200"&gt;United States of America&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;three hundred and five&lt;/td&gt;        &lt;td valign="top" width="200"&gt;305&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The &amp;lt;literal&amp;gt; command prevents that conversion from occurring, and forces the text to be input exactly as spoken.&lt;/p&gt;  &lt;h2&gt;Examples using &amp;lt;numeral&amp;gt;&lt;/h2&gt;  &lt;p&gt;The best way to describe the &amp;lt;numeral&amp;gt; command is to give some examples:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;strong&gt;User Input&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;&lt;strong&gt;Recognition Result&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;em&gt;numeral&lt;/em&gt; two&lt;/td&gt;        &lt;td valign="top" width="200"&gt;2&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;two&lt;/td&gt;        &lt;td valign="top" width="200"&gt;two&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;em&gt;numeral&lt;/em&gt; twelve&lt;/td&gt;        &lt;td valign="top" width="200"&gt;12&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;twelve&lt;/td&gt;        &lt;td valign="top" width="200"&gt;12&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;em&gt;numeral&lt;/em&gt; four eight seven six two three&lt;/td&gt;        &lt;td valign="top" width="200"&gt;487623&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;four eight seven six two three&lt;/td&gt;        &lt;td valign="top" width="200"&gt;four eight seven six two three&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;numeral one and a half million&lt;/td&gt;        &lt;td valign="top" width="200"&gt;1,500,000&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;numeral one point five million&lt;/td&gt;        &lt;td valign="top" width="200"&gt;1.5 million&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;numeral one point four five&lt;/td&gt;        &lt;td valign="top" width="200"&gt;1.45&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;If the phrase cannot be interpreted as a number, then the numeral command does nothing:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;User Input&lt;/td&gt;        &lt;td valign="top" width="200"&gt;recognition result&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;numeral I want to go to the store&lt;/td&gt;        &lt;td valign="top" width="200"&gt;I want to go to the store&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Note that this phrase has a possible number (to –&amp;gt; two –&amp;gt; 2), but the intervening words deactivate the command.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8898517" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category></item><item><title>When Dictation doesn't Work</title><link>http://blogs.msdn.com/tsfaware/archive/2008/05/22/when-dictation-doesn-t-work.aspx</link><pubDate>Fri, 23 May 2008 02:17:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8535121</guid><dc:creator>Eric Brown</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/8535121.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=8535121</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=8535121</wfw:comment><description>&lt;p&gt;WSR Dictation should &lt;strong&gt;always&lt;/strong&gt; work in Wordpad.&amp;#160; If you're having problems with dictation, make sure it works in Wordpad.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If dictation doesn&amp;#8217;t work in WordPad:&lt;/p&gt;  &lt;p&gt;1)&amp;#160; Start regedit, go to the key HKEY_CURRENT_USER\Software\Microsoft\Speech\Preferences\en-us\ and remove any value named DictationEnabled.&lt;/p&gt;  &lt;p&gt;If there is no registry key named DictationEnabled, then &lt;/p&gt;  &lt;p&gt;2)&amp;#160; Check %windir%\ime\sptip.dll - it should exist, be 128KB in size, and have a file version of 6.0.6001.17128 and a product version of 6.0.6000.16386.&lt;/p&gt;  &lt;p&gt;3)&amp;#160; The file %windir%\ime\en-us\sptip.dll.mui should also exist.&lt;/p&gt;  &lt;p&gt;4)&amp;#160; Make sure ctfmon.exe is running.&amp;#160; It should start at login (there is a scheduled task that starts it).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If dictation works in WordPad, but doesn't work in your application:&lt;/p&gt;  &lt;p&gt;Your application probably doesn't support TSF.&amp;#160; Complain to your vendor.&amp;#160; You can enable a (very limited) version of dictation by checking 'Enable Dictation Everywhere' in the Windows Speech Recognition context menu.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8535121" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category></item><item><title>Oops!</title><link>http://blogs.msdn.com/tsfaware/archive/2007/11/14/oops.aspx</link><pubDate>Wed, 14 Nov 2007 21:01:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6219479</guid><dc:creator>Eric Brown</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/6219479.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=6219479</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=6219479</wfw:comment><description>&lt;p&gt;If you've tried to use the modified version of Scintilla that I described in my &lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/07/Dictation/"&gt;MSDN article&lt;/a&gt;, you will find that the zipped sources don't actually have the changes that I made.&amp;nbsp; That was my fault; when I was packaging the sources, I had two versions of ScintillaWin.cxx around, and I picked the newer one, which (sigh) was the wrong one.&amp;nbsp; Anyway, here's a link to the correct version of &lt;a href="http://cid-c57822bc3c7d1873.skydrive.live.com/self.aspx/Public/ScintillaWin.cxx"&gt;ScintillaWin.cxx with TSF support&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6219479" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/tsf/default.aspx">tsf</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/Applications/default.aspx">Applications</category></item><item><title>The usual path</title><link>http://blogs.msdn.com/tsfaware/archive/2007/10/08/the-usual-path.aspx</link><pubDate>Mon, 08 Oct 2007 17:00:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5276716</guid><dc:creator>Eric Brown</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/5276716.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=5276716</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=5276716</wfw:comment><description>&lt;p&gt;Text Services Framework assumes that your text service follows a particular processing path.&amp;nbsp;&amp;nbsp;If your text service doesn't conform to these assumptions, then your programming job will be more complicated.&amp;nbsp; (Not impossible, just more complex.)&amp;nbsp; The text service samples on MSDN also follow these assumptions, but they aren't explicitly stated anywhere (that I know of).&amp;nbsp;&amp;nbsp; I've mentioned some of these assumptions in previous articles, but I thought I'd bring them together in one post.&lt;/p&gt; &lt;p&gt;Text Services makes the following assumptions:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Your service &lt;strong&gt;must&lt;/strong&gt; perform all changes to a context or range object within an edit session.&amp;nbsp; Text Services Framework enforces this assumption through the use of edit cookies.  &lt;li&gt;Your service should not assume that it is possible to request a synchronous edit session.&amp;nbsp; (I discussed this &lt;a href="http://blogs.msdn.com/tsfaware/archive/2007/05/17/rules-of-text-services.aspx"&gt;here&lt;/a&gt;.)  &lt;li&gt;Your service should track focus changes between applications and between controls within an application.&amp;nbsp; This means that your text service must install event sinks for &lt;a href="http://msdn2.microsoft.com/library/ms628969.aspx"&gt;ITfThreadFocusSink&lt;/a&gt;&amp;nbsp;and &lt;a href="http://msdn2.microsoft.com/library/ms628973.aspx"&gt;ITfThreadMgrEventSink&lt;/a&gt;.  &lt;li&gt;Your text service should use &lt;a href="http://msdn2.microsoft.com/library/ms538061.aspx"&gt;compositions&lt;/a&gt; to handle partially formed input.&amp;nbsp; &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;This last assumption is the big one.&amp;nbsp; It can cause problems for text services that aren't keyboard-related (speech, for example).&lt;/p&gt; &lt;p&gt;The problem is that TSF handles the (admittedly, very difficult) job of interacting with non-TSF aware applications entirely through compositions.&amp;nbsp; Once you close the composition, TSF assumes that you're completely finished with that piece of input.&lt;/p&gt; &lt;p&gt;Unfortunately, it's hard to tell beforehand when you're done with a piece of dictation.&amp;nbsp; SAPI will tell you when it's recognized a piece of text, obviously, but, ideally, once you've dictated some text, you would like to be able to correct it.&amp;nbsp; That requires that you leave the composition open.&lt;/p&gt; &lt;p&gt;In an application that isn't TSF-aware, though, you need to close that composition as soon as you can (it's bad form to have large open compositions; most IMEs have compositions that are a few characters in size).&lt;/p&gt; &lt;p&gt;So there's a tradeoff here.&amp;nbsp; Dictation in Windows Vista currently closes the composition as soon as the text is recognized.&amp;nbsp; (In fact, it doesn't use compositions at all.)&amp;nbsp;&amp;nbsp; That works fine for TSF-aware applications, but causes problems with TSF-unaware applications.&amp;nbsp; In particular, once you've dictated some text, you can't correct it by voice.&amp;nbsp; That's why Windows Speech recognition makes you confirm every dictation into a TSF-unaware application.&amp;nbsp; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5276716" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/Text+Services/default.aspx">Text Services</category></item><item><title>How do I use RichEdit 4.1?</title><link>http://blogs.msdn.com/tsfaware/archive/2007/06/14/how-do-i-use-richedit-4-1.aspx</link><pubDate>Thu, 14 Jun 2007 21:18:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3294773</guid><dc:creator>Eric Brown</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/3294773.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=3294773</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=3294773</wfw:comment><description>&lt;p&gt;Another thing I didn't talk about in my article was how to make sure your rich text edit controls are based on RichEdit 4.1 (which has TSF support).&amp;nbsp; &lt;p&gt;You need to do two things: &lt;p&gt;1)&amp;nbsp; change your window class name from RICHEDIT_CLASS to MSFTEDIT_CLASS, and &lt;p&gt;2)&amp;nbsp; LoadLibrary("msftedit.dll") instead of LoadLibrary("richedit.dll"). &lt;p&gt;That's it!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3294773" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/Applications/default.aspx">Applications</category></item><item><title>Easy Dictation support for Windowless RichEdit controls</title><link>http://blogs.msdn.com/tsfaware/archive/2007/06/12/easy-dictation-support-for-windowless-richedit-controls.aspx</link><pubDate>Tue, 12 Jun 2007 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3233002</guid><dc:creator>Eric Brown</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/3233002.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=3233002</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=3233002</wfw:comment><description>&lt;P&gt;In my article in MSDN, I mention that there are some easy ways to enable dictation support in controls that don't normally support dictation.&amp;nbsp; All the methods I described assume that the control has a window.&amp;nbsp; There is a way to enable dictation support for windowless rich text edit controls, assuming that you are using the RichEdit 4.1 implementation of&amp;nbsp;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms651303.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms651303.aspx"&gt;ITextServices&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I did not include this method in my article because I didn't want to include all the details about ITextServices, how you get an instance, and so forth.&amp;nbsp; I assume that if you already have an existing windowless rich edit control that uses ITextServices, you already know all that.&amp;nbsp; (If you don't, there's a quick primer available at &lt;A href="http://www.codeproject.com/richedit/RichDrawText.asp" mce_href="http://www.codeproject.com/richedit/RichDrawText.asp"&gt;CodeProject&lt;/A&gt;; note that I haven't actually used this code, and cannot vouch for it.)&lt;/P&gt;
&lt;P&gt;Anyway, if you have an ITextServices interface pointer, then you can enable TSF support (and, by extension, dictation support), by calling &lt;A href="http://msdn2.microsoft.com/en-us/library/ms651335.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms651335.aspx"&gt;ITextServices::TxSendMessage&lt;/A&gt;(&lt;A href="http://msdn2.microsoft.com/en-us/library/ms652071.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms652071.aspx"&gt;EM_SETEDITSTYLE&lt;/A&gt;, SES_USECTF, SES_USECTF).&lt;/P&gt;
&lt;P&gt;I hope that more richedit users will enable TSF support, so that users will have an easier time using dictation.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3233002" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/Applications/default.aspx">Applications</category></item><item><title>Generating Candidates from an Application</title><link>http://blogs.msdn.com/tsfaware/archive/2007/05/25/generating-candidates-from-an-application.aspx</link><pubDate>Fri, 25 May 2007 21:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2878099</guid><dc:creator>Eric Brown</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tsfaware/comments/2878099.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tsfaware/commentrss.aspx?PostID=2878099</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tsfaware/rsscomments.aspx?PostID=2878099</wfw:comment><description>&lt;P&gt;Kirby left a comment to my post on &lt;A href="http://blogs.msdn.com/tsfaware/archive/2007/05/14/text-services-candidates.aspx" mce_href="http://blogs.msdn.com/tsfaware/archive/2007/05/14/text-services-candidates.aspx"&gt;candidates&lt;/A&gt;&amp;nbsp;asking when a text service should create an ITfCandidateList.&lt;/P&gt;
&lt;P&gt;The answer is that when the &lt;EM&gt;text service&lt;/EM&gt; wants to show candidates (via a &lt;A href="http://msdn2.microsoft.com/library/ms628684.aspx" mce_href="http://msdn2.microsoft.com/library/ms628684.aspx"&gt;preserved key&lt;/A&gt; or other mechanism), it should show its modal UI, and quite possibly may wish to push a new context so that the modal UI can be keyboard enabled (the &lt;A href="http://msdn.microsoft.com/archive/en-us/samples/internet/TextServicesFrameWork/CandidateList/default.asp" mce_href="http://msdn.microsoft.com/archive/en-us/samples/internet/TextServicesFrameWork/CandidateList/default.asp"&gt;sample&lt;/A&gt; does this).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The thing to note here is that ITfCandidateList is not involved here.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So when &lt;EM&gt;does&lt;/EM&gt; the text service use ITfCandidateList?&amp;nbsp; When the &lt;STRONG&gt;application&lt;/STRONG&gt; wants to show candidates.&lt;/P&gt;
&lt;P&gt;How does this work?&amp;nbsp; Well, it's pretty complicated, but I'll try to outline the steps here.&amp;nbsp; (Get ready, it's going to get a little wild...)&lt;/P&gt;
&lt;H2&gt;The big blocks &lt;/H2&gt;
&lt;P&gt;1)&amp;nbsp; Application gets &lt;A href="http://msdn2.microsoft.com/library/ms538970.aspx" mce_href="http://msdn2.microsoft.com/library/ms538970.aspx"&gt;ITfFnReconversion&lt;/A&gt; interface.&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp; Application gets&amp;nbsp;target range (&lt;A href="http://msdn2.microsoft.com/library/ms538388.aspx" mce_href="http://msdn2.microsoft.com/library/ms538388.aspx"&gt;ITextStoreACPServices::CreateRange&lt;/A&gt; comes in very handy here).&lt;/P&gt;
&lt;P&gt;3)&amp;nbsp; Application calls &lt;A href="http://msdn2.microsoft.com/library/ms538973.aspx" mce_href="http://msdn2.microsoft.com/library/ms538973.aspx"&gt;ITfFnReconversion::QueryRange&lt;/A&gt; to transform the target range.&lt;/P&gt;
&lt;P&gt;4)&amp;nbsp; Application calls &lt;A href="http://msdn2.microsoft.com/library/ms538972.aspx" mce_href="http://msdn2.microsoft.com/library/ms538972.aspx"&gt;ITfFnReconversion::GetReconversion&lt;/A&gt; to get the list of candidates.&lt;/P&gt;
&lt;P&gt;5)&amp;nbsp; Application displays candidate list (e.g., in context menu, dialog, what have you).&lt;/P&gt;
&lt;P&gt;6)&amp;nbsp; Application calls &lt;A href="http://msdn2.microsoft.com/library/ms538496.aspx" mce_href="http://msdn2.microsoft.com/library/ms538496.aspx"&gt;ITfCandidateList::SetResult&lt;/A&gt;() when the selection is selected.&lt;/P&gt;
&lt;P&gt;7)&amp;nbsp; Application releases candidate list, reconversion interface, and does other cleanup.&lt;/P&gt;
&lt;P&gt;Alternatively, if the application wants to let the text service manage the UI, it can call &lt;A href="http://msdn2.microsoft.com/library/ms538975.aspx" mce_href="http://msdn2.microsoft.com/library/ms538975.aspx"&gt;ITfFnReconversion::Reconvert&lt;/A&gt; at step 4 and step out of the way.&amp;nbsp;&amp;nbsp; (Note that not all text services implement this, as this function must not wait for the UI to be dismissed before returning.)&lt;/P&gt;
&lt;P&gt;An excellent way to test this is with Microsoft Word.&amp;nbsp; Word supports reconversion, and will show the candidates in the context menu when you right-click on a word.&lt;/P&gt;
&lt;H2&gt;Getting ITfFnReconversion&lt;/H2&gt;
&lt;P&gt;This is a two-step process.&amp;nbsp; First, you get the system function provider, and then you get the reconversion pointer (error checking is omitted):&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;ITfFunctionProvider* ipProvider;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;hr = ITfThreadMgr::GetFunctionProvider(GUID_SYSTEM_FUNCTIONPROVIDER, &amp;amp;ipProvider);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;IUnknown* ipConv;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;hr = ipProvider-&amp;gt;GetFunction(GUID_NULL, IID_ITfFnReconversion, &amp;amp;ipConv);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;ITfFnReconversion *ipConversion;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;hr&amp;nbsp;= ipConv-&amp;gt;QueryInterface(IID_ITfFnReconversion, &amp;amp;ipConversion);&lt;/FONT&gt;&lt;/P&gt;
&lt;H2&gt;What should QueryRange do?&lt;/H2&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/library/ms538973.aspx" mce_href="http://msdn2.microsoft.com/library/ms538973.aspx"&gt;ITfFnReconversion::QueryRange&lt;/A&gt; needs to modify the range to cover the entire range of text contained&amp;nbsp;by the&amp;nbsp;conversion token.&amp;nbsp; An example is useful here, as that last sentence didn't even make sense to me.&amp;nbsp; The Speech text service does correction by words, and all words must be part of a single recognition.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Therefore, the Speech text services's implementation of QueryRange alters the range of text to contain entire words that are part of a single recognition.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If the range starts in the middle of a word with recognition data, QueryRange shifts the start of the range to the start of a word.&amp;nbsp; If the range starts in text that doesn't have recognition data associated with it, it moves the start point to a point where it does have recognition data, or to the end of the initial range.&amp;nbsp; If it runs off the end, it sets pfConvertable to FALSE, and returns NULL.&lt;/P&gt;
&lt;P&gt;If it does find some recognition data for the start of the range, it adjusts the end of the range in the same manner.&lt;/P&gt;
&lt;P&gt;But wait, you say.&amp;nbsp; How can QueryRange do all that when it doesn't have an edit cookie?&amp;nbsp; Well, it gets one in the usual manner - it (say it with me) &lt;EM&gt;schedules an edit session&lt;/EM&gt; to do all that work.&amp;nbsp; OK, you say, how can I&amp;nbsp;get my data back from an&amp;nbsp;asynchronous edit session?&amp;nbsp; Well, you're in luck - you're &lt;EM&gt;guaranteed&lt;/EM&gt; to be able to schedule a &lt;STRONG&gt;synchronous&lt;/STRONG&gt; edit session from &lt;A href="http://msdn2.microsoft.com/library/ms538973.aspx" mce_href="http://msdn2.microsoft.com/library/ms538973.aspx"&gt;ITfFnReconversion::QueryRange&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;H2&gt;What should GetReconversion do?&lt;/H2&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/library/ms538972.aspx" mce_href="http://msdn2.microsoft.com/library/ms538972.aspx"&gt;ITfFnReconversion::GetReconversion&lt;/A&gt; needs to compute the candidates from a target range (that should be aligned with a conversion token).&amp;nbsp; Like QueryRange, most of the work will need to be done from an edit session, and also like QueryRange, you are guaranteed to be able to schedule a synchronous edit session from within GetReconversion.&amp;nbsp; How you go about computing the candidates is discussed in my next post.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2878099" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tsfaware/archive/tags/tsf/default.aspx">tsf</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/dictation/default.aspx">dictation</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/Text+Services/default.aspx">Text Services</category><category domain="http://blogs.msdn.com/tsfaware/archive/tags/Applications/default.aspx">Applications</category></item></channel></rss>