Microsoft Azure speech to text behavior in JavaScript SDK in browser application - speech-to-text

I have deployed Azure speech to text SDK in JavaScript SDK in browser application. Finding difficulties with the below scenarios.
When trying to start dictation in a text box which already has text in it, it always starts from the end of the text. I cannot start in the beginning or in between of existing text.
If the text box has data and when data is cleared and after I start the dictation, converted text as well the previously deleted text both appear. Dictated text is appended to the previously deleted text.
How do i disable auto punctuation? E.g. If I pause during dictation, the sentence ends with a period automatically. If I say how are you, it results in how are you?.
Expected results:
Based on my cursor placement in the text box, it should start the speech to text from that location.
Deleted text shouldn't re appear.
Want to disable auto punctuation and use dictation words like period, question mark, exclamation mark etc. in dictation.

For question 3, if you enabled dictation previously, you many want to remove it from speech config to prevent interpretation of punctuations.

Related

Sublime Text 4: show word count for selected text

I recall that when selecting a block of text in Sublime Text the status bar used to display the word count. This answer confirms that I recall correctly, Sublime Text 3 used to show that information:
I'm running Sublime Text 4 (Build 4143) and this information is no longer displayed. Only lines and character counts are shown:
Is this feature hidden in the settings somewhere or did ST remove it entirely? If so, why??
Sublime does not and has never had this power without a plugin. Seen below is a screen shot of the last version of Sublime Text 3 with no settings or packages and some text selected.
The counts displayed are for the selected lines and characters, but not words; there is also no setting in the core that enables this.
The answer you linked is to a question where someone is asking about the WordCount package itself, and in particular asking about how to apply a setting. The answer states that you just need to select text to see counts in the status bar without having to set any setting, which is true:

MBCS File Menus generate ???? Characters

I am working on an MBCS app using MFC. I am trying to support Asian languages. For the purposes of this discussion, we'll say I'm trying to support Chinese. I am able to support Pop up dialogs via MessageBoxW and Dialog SCREENs by pasting Chinese characters directly into the RC file. I can't get file menus to work using either resource view or editing the RC file directly. Whenever I type in ANY Asian character, the screen shows ???. One ? for each character. I have tried modifying the menu in C++ using ModifyMenuW. I get more question marks. Visual Studio shows everything working, and the RC file is unicode (UTF-16). I can't easily convert my project to unicode mode. Spanish, French, and German all works fine (one of the Essets in German doesn't work, but that isn't a show stopper). What should I try next?
Thanks in advance!
Well, the easy answer would be change the application to Unicode, but this is not always simple, or possible at all.
Concerning using Unicode in a MBCS application, some things are possible and some others not. For example, I have made a MBCS application displaying and editing translations of program strings (messages, menues etc) in a ListView control, however ListView does have a specific message to turn it to Unicode (LVM_SETUNICODEFORMAT) and support operations (see also CCM_SETUNICODEFORMAT). Menus aren't controls though, but they do have "wide" (Unicode) functions.
If you want to use Unicode in your application, there are some tests you need to make. Success is not guaranteeded, but you can at least draw some conclusions and determine whether what you want to do is possible.
Test1:
You mentioned trying ModifyMenuW(), but this will try to modify an existing menu. Instead, try InsertMenuW() or InsertMenuItemW(). Any unicode string should be displayed properly, so try not just Chinese, but other laguages too (eg Greek or Russian). And btw, I can't see how French works and German doesn't (they use the same codepage - West European). What's the system codepage of your test-machine?
Test2: (if the above has failed)
Try changing the whole menu (SetMenu()) with having a single (unicode) menu item as its root.
Test3: (if the above have failed)
Then you need to check whether the window containing the menu must be Unicode. Create a simple "Hello World" Win32 application, or find a sample, if Visual Studio does not do this for you (these basically register the window class, create the main window and start the message-loop) - you must add a menu too, using the "wide" version of the menu functions explicitly. If this doesn't work, try changing the code that creates the window to unicode. This way you will know whether you need a unicode window, to own the menu.
Please make these tests and let us know the results. I will further post if needed.

MSKLC under Windows 10: Create custom keyboard layout which supports IME (input method) for Chinese and combined input in Spanish

This question is originally posted by me in Microsoft Community at:
https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/msklc-under-windows-10-create-custom-keyboard/8c5a7137-d575-4247-8ab3-b4dd1e5fb437?tm=1495318604424
In summary: I have created a custom keyboard layout with Microsoft Keyboard Layout Creator 1.4 in Windows 10, it is working but only partially. It cannot:
combine two keystrokes into one to type a "combined letter", e.g, "¨"+"u" = "ü". It should not exist in Chinese but I want to achieve this.
type Chinese pinyin and Chinese punctuation. In MS pinyin IME, I can press shift to switch between Chinese pinyin mode and English mode. Under pinyin mode I can convert letters into pinyin and thus get Chinese characters, but my layout lacks this. And, if I press "," in Microsoft Pinyin in pinyin mode, it should give me ","(full length comma), but this layout is not able to do this.
I am thinking about two ways to solve this:
Substitute Microsoft Pinyin's keyboard layout to my layout(replace the English part of MS Pinyin with my layout)
Copy the pinyin part of MS pinyin to my layout.
So, how can I solve this?
I have solved it.
For the first problem, you must define some "dead keys combinations". The details are explained here:
http://www.angelfire.com/planet/linguisticsisfun/Creating_a_Keyboard_Using_MSKLC.pdf
For the second problem, basically you do:
Create your keyboard layout.
Edit the .klc file with a Text Editor, to change the VK code mapping. That is because most of the applications in Microsoft Windows, when you press the hotkeys, detects VK code sent to OS, not the "key chars"(the characters output as you type in a text processing software). So in order to make the key chars of your keyboard layout to match with their VK code, you must do this manually. MSKLC will not change that for you. Some details here:
http://www.sensefulsolutions.com/2010/08/how-to-fix-keyboard-shortcuts-in-klc-eg.html
Install the layout.
Open your registry editor, enter HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\, find your new keyboard layout at the bottom (mine with name like a0000xxxx). Copy the dll file name. That is the DLL file containing your newly created keyboard layout info.
Go back to the registry father branch, search the language you want to apply this layout, like Chinese or Spanish. You will find several variations with names alike, but the descriptions are self-explanatory and can help you differentiate them.
Simplified Chinese uses KBDUS.dll, that means "keyboard layout for US keyboard". This will apply to MS Pinyin, too. Change this value to your copied DLL name, so that it will load your DLL next time the OS launches.
Restart.
The result:
I can type English and Chinese pinyin with Microsoft Pinyin with my custom keyboard layout, and I can navigate next/previous page with , and ..
With this keyboard layout I can type Spanish special characters, like ï, á, ç, ñ and € without switching to Spanish keyboard.
Hotkeys in any software are working as expected, because now VK code are matched with letters printed on the keys.

Spell check contents of Rich Text Content Control

I am having an issue with Word 2013 and spell checking the contents of Rich Text Content Controls.
I am currently working on a project where text is inserted (via a Word Add-In) into a pre-defined document template which makes use of Rich Text Content Controls. The inserting of the data into the content controls all works great, but I am having an issue where the newly inserted text within the content controls is not being spell checked by Word 2013.
I have read numerous posts on line which suggest that 'grouping' the content controls in the document resolves the issue, but haven't been able to implement this fix.
Text outwith the content controls is being spell checked, but any text within the content controls is not.
Steps to reproduce:
Open Word 2013 and create a new blank document.
Ensure that the DEVELOPER tab is enabled (if not, see instructions here)
On the DEVELOPER tab, enable Design Mode under the Controls group.
Still on the DEVELOPER tab, under Controls, add a new Rich Text Content Control.
Amend the default "Click here to enter text." so that it contains a spelling mistake.
On the DEVELOPER tab, exit Design Mode.
On the REVIEW tab, choose Spelling & Grammar. You should observe that the deliberate spelling mistake within the content control is not recognised.
James, the text you edit in the Rich Text Content Control is what is called the Placeholder Text. This text is to be defined by the 'content' developer.
This text won't be part of the Spelling & Grammar review as the Placeholder Texts are 'constants' defined by the developer, hence the reason why they are under the Developer tab.
So it is advised to first put the texts that you want to use in a Placeholder in a normal document, do the spell check and copy them over and apply to the Placeholder Text.
I think it is fairly reasonable not to include the Placeholder texts in Spelling & Grammar as:
It will take time to process the fixed assets
End users may not have access to the Placeholder Texts to edit the 'mistakes'

RTL language with Sublime Text editor

The RTL languages are not supported in the sublime text editor
I tried this plug-in Bidirectional text support
on windows os
Copied all files from the zip Sublime-Text-2-BIDI-master to the ST3 folder and changed the font type and size.
then I copied the unicodedata.pyd to C:\Users\USERNAME\AppData\Roaming\Sublime Text 2\Packages\Bidirectional text support\bidi
now the Tools > Bidirectional text part didn't look gray anymore but it is still disabled.
also I copied these two lines but it didn't work
sys.platform.startswith('win'):
sys.path.append('../../..')
Any help would be appreciated
In order to get Sublime Text to work with Arabic characters using Sublime Text BIDI plugin on Windows correctly, ensure you've done the following:
Copy the plugin folder to the following path C:\Users\USERNAME\AppData\Roaming\Sublime Text 2\Packages\
Copy unicodedata.pyd from ST installation directory to both, the main plugin folder which in your case is Sublime-Text-2-BIDI-master and inside bidi folder.
Set your sublime user-settings to the following:
{
"font-face": "arial",
"font_size": 11,
"default_encoding": "UTF-8",
"fallback_encoding": "Arabic (Windows 1256)"
}
Reload the plugin by viewing rtl.py and saving
In the case that doesn't fix it, you can read what sublime console log outputs when you click on Bidirectional text for a given Arabic text, console log can be accessed through ctrl+~.
Very Easy,
Just follow this Video steps
دعم اللغة العربية في برنامج Sublime
1- Download the Sublime-BIDI-master folder from Github of solution
2- Extract it and paste under \Sublime Text Build (whatever)\Data\Packages(the downloaded folder).
3- open sublime wit any RTL Language file and right click anywhere you'll new options (Bidirectional text) .. Click it :).
However, in my Sublime version (build 3126), Arabic letters will be reshaped when switching to Bidi.
Initially in the range U+0621-U+064A, which are the usual Unicode codes for Arabic letters, characters will be mapped to the range U+FE70-U+FEFC, which are codes for each (isolated, initial, middle, final) Arabic connected forms. These latter codes, called Arabic-Presentation-Forms-B, are deprecated by Unicode and their usage should be very limited.
For example, before switching to Bidi, the word كتب, looks ب ت ك, from left to right U+0643 U+062A U+0628. This is the memory order. (It is up to the final rendering tool to display the string in visual order by connecting letters.)
After Bidi switching in Sublime, the word will appear good as كتب, because the codes are ﺐ ‎U+FE90 followed by ﺘ U+‎FE98 followed by ﻛ U+‎FEDB. In this order. That means, in a Bidi enabled tool like a browser, it will appear ﺐﺘﻛ as the final visual order. This is not what the user expects.
So, not only Bidi switching changes the letters code, it also changes the memory order.
Personal experience.
When editing a source file (HTML and other languages or formats) containing some RTL characters, it is really tricky to navigate in the text edited. So the mode "before" (logical or memory order) might be very helpful than the mode "after" (visual or display order). With logical order, it's useless to join letters, it doesn't make sens.
Check this link, I had the same problem but solved it with the Sublime Text BIDI plugin.
I was still facing an issue because of the editor's font. It will be recommended to use a fixed-width font like Courier New. This should ensure the plug-in works as expected.

Resources