I am trying to develop a app for my country's elderly. In a multi-racial country, i need to detect voice for English and Chinese(for now). I am having some problems with comparing the output, which is in chinese, to a Chinese unicode or character.
for example if the voice recognised 救命(help), which would be a right way to compare?
Currently I am using this.
if(d[i] .equals("help") || d[i] .equals("救命"))
sadly it doesn't work. Any help here guys?
You've encoded your Chinese characters using HTML encoding, which is inappropriate for Java source code. Try:
if(d[i] .equals("help") || d[i] .equals("\u6551\u547d"))
See section 3.3 Unicode Escapes of the Java Language Specification for complete information.
Related
Hi I want to pass installed Apps name to server for this I am using getApplicationLabel but server does not accept other than english character ,so I want to know whether getApplicationLabel (ApplicationInfo info) returns only English character or it may return non english character (like Chinese, hindi )?
No, it won't only return Latin characters.
There are at least two ways it won't.
If the app is only localized for a non-Latin alphabet, say some obscure Indian or Chinese app. The application probably isn't named using the basic Latin alphabet.
If the app is localized for many languages and the current device language is using a non-Latin script, such as Google Chrome. On a device with the language set to Chinese, getApplicationLabel() would likely return "谷歌浏览器".
Building an Android app with Speech recognition component. I've built a keyword .gram file, containing the 3.240 words I want to recognize. I've constructed a corresponding dictionary (phonetic), using http://www.speech.cs.cmu.edu/tools/lmtool-new.html. This is English only.. I need a tool that will create a Dutch phonetic dictionary. Any suggestions?
When I try to point to the Dutch Acoustic model, downloaded at https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Dutch%20Voxforge, I get an error in my app (Decoder_setJsgfFile returned -1). The error is on line 43 of Decoder.class.
When I use "en-us-ptm", the application works, but recognition is terrible. Please provice guidance. Other suggestions for frameworks for recognizing 3.500 dutch words also welcome. Thank you.
Content of the DUTCH acoustic model folder created by lmtool :
feat.params
mdef
means
mixture_weights
noisedict
transition_matrices
variances
Edit : the Decoder_setJsgfFile returned -1 is a generic error. Check your logfile lines prior to this error for more information.
Found the solution in matching the dictionary with the grammar file. You need ALL words that are in your grammar file to be present in the dictionary, or the application will crash.
You could also look at Kaldi-asr for speech recognition, it has a nice Dutch language model (by TU Twente) available on git (Kaldi_NL).
I have some Android applications about finance (prices and some calculations). What is the right way to show the finance data for Arabic localization? Formatted as Arabic numbers or "Latin" (١٢٣٤٥٦٧٨ or 12345678)?
Usually I format all the numbers to user locale, but uninstall rate for Arabic locale is way too high compared to other localizations (except Saudi Arabia). Also I've noticed that many of the developers from Arab countries (on Google Play) do not format the numbers.
Formatting numbers in Arabic Locale (١٢٣٤٥٦٧٨) is considered "going for the extra mile" and will be mostly appreciated by Arabic natives. Native Arabic speakers will certainly notice the product is extremely localized to their needs (in your case financial markets) and you have taken them into consideration.
Nevertheless, you need to consider copy-and-paste and form filling (mostly they are already taken care of by the OS). e.g. copying the number "١٢٣٤٥٦٧٨ " shall copy 12345678 to make sure compatibility with other apps. Also, Regular Expressions in forms shall consider the Arabic numbers.
PS, make sure the translation is perfect :)
I would like to develop an meme android app in which I require English to Telugu conversion API.
When I type letters in English language that has to be converted and displayed right away in Telugu font. For example i type "hyderabad" there should be instant conversion display of "హైదరాబాద్".
Any suggestions or code snippets or at least any API resources are appreciable.
Does the android support Unicode natively?
But in String.xml we have to edit it with UTF-8 ??
Any way to check the string's encoding? unicode or utf-8 ?....
Android does support Unicode.
Since you seem to be confused about the relationship between UTF-8 and Unicode, I recommend that you save yourself a lot of pain and just read The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets.
If you mean UTF-16 or UTF-8 - Android works with UTF-8
Android supports Unicode characters in UTF-8 encoding - but lacks proper fonts and a complex text rendering system do display many scripts and languages properly.