Aiml emoji support - chatbot

How to use pandorabots emoji.set and emojinormal.txt to support emoji in aiml?
<category>
<pattern><set>emoji</set></pattern>
<template>🇦🇩</template>
</category>
Whats wrong with it?

I figured out how to do this you have to put emoji in hex code instead of raw emoji inside template like this.
<category>
<pattern>_ watch # movies # pc #</pattern>
<template>Sometimes 😁.</template>
</category>
It will generate output like this
Human: do u watch movies in ur pc
Robot: Sometimes 😁.

Related

Pronouncing German words in English

i'm using Google TTS to generate audio files in my native language German.
Unfortunately there are some Words like f.e. "laser" that are pronounced as a German word, but i want it to be pronounced as the English one.
Is there any way in SSML to make it possible or do i have to generate separate audio files and cut them together?
Thanks for your answer!
Try:
<?xml version="1.0"?>
<speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
http://www.w3.org/TR/speech-synthesis11/synthesis.xsd"
xml:lang="en-US">
The French word for cat is <w xml:lang="fr">chat</w>.
He prefers to eat pasta that is <lang xml:lang="it">al dente</lang>.
</speak>
Check out the following link:
https://www.w3.org/TR/speech-synthesis11/#edef_lang

Own Emoji Keyboard - Listing all unicode Emojis

i want to create an own emoji-keyboard for an universal app. I need this for the reason of usage on desktop.
So i searched a lot but didnt found something helpfull. I want to show up all possible Emojis.
But i dont really want to use a file or something where i have to manage all the unicodes of the emojis - i want something like an Enumeration (like Symbols in c#)
Is there something like that? I also searched for a method of listing all keys of a font or something what would help.
You can find all official unicode characters in the latest database from unicode.org (http://www.unicode.org/Public/UCD/latest/ucd/). The file UnicodeData.txt contains all unicode characters including their names and properties.
Unfortunately, the file is not an c++ or c# enumeration but only a text file, so you have to write your own parser for this (but the file format can be easily parsed and is documented).

Creating a new Keyboard in Android

I am trying to create a non-roman keyboard for Android. Non-roman meaning that the characters will be different symbols (for Tibetan) which are not supported by Android.
My question: is it possible to create a keyboard which will be supported all through Android? In the way that if I switch to this keyboard will allow me to write in this particular language in any application or write notes, etc.
In iOS it is possible but I haven't seen it in Android.
I was looking at http://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615 where they define the keys:
<Row>
<Key android:codes="49" android:keyLabel="1" android:keyEdgeFlags="left"/>
<Key android:codes="50" android:keyLabel="2"/>
<Key android:codes="51" android:keyLabel="3"/>
<Key android:codes="52" android:keyLabel="4"/>
<Key android:codes="53" android:keyLabel="5"/>
</Row>
How can I define the keys if they are not Roman characters? Also I should be able to connect some font type where the characters are defined, where I do that?
Thanks
Yes, you can make your own keyboard application the system default, there are lots of applications doing exactly this already, like Swype or Swiftkey.
Here is a guide for this. The most relevant part is the manifest file, which tells Android that your application provides a keyboard service, and you can set it as your own keyboard in the Settings.
Update:
The android:codes XML attribute, according to the documentation means:
The unicode value or comma-separated values that this key outputs.
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
May be an integer value, such as "100".
So you should use the Unicode character option. For example, the Hungarian letter ő could be achieved by \\u0151. For finding out the Unicode characters you need, you could use this online service.

How can I spell check for multiple languages in emacs?

I write mostly my documentation in HTML using emacs as my main editor. Emacs let you interactively spell-check the current buffer with the command ispell-buffer.
Since I switch between a number of languages, I have an HTML comment at the end of the file specifying the main dictionary and personal dictionary for that file, E.g. for Norwegian (norsk) I use the following pair of dictionaries:
<!-- Local IspellDict: norsk -->
<!-- Local IspellPersDict: ~/.aspell/personal.dict -->
This works great.
However, sometimes I have a paragraph in another language (e.g. English) embedded in an otherwise Norwegian document. Example:
<p xml:lang="en">This paragraph is in English.</p>
The spell-checker naturally flag all the words in such a paragraph as misspellings (since the dictionary only contain Norwegian words).
To avoid this, I've tried to add a "british" dictionary to the document, like this:
<!-- Local IspellDict: british -->
<!-- Local IspellDict: norsk -->
<!-- Local IspellPersDict: ~/.aspell/personal.dict -->
Unfortunately, this does not work. The "british" dictionary is simply ignored.
My prefered solution would to load an additional dictionary and use this, toghether with the primary dictionary, for spell-checking. Is this possible?
However, I am also interested in a solution that let me mark paragraphs for not being spell checked. It is not ideal, but it would stop valid English words from being flagged as misspellings.
PS: I have also looked at the answer to this question: Multilingual spell checking with language detection, but it is much broader and does not address the specific use emacs ispell for doing the spell-check.
Try ispell-multi and flyspell-xml-lang http://www.dur.ac.uk/p.j.heslin/Software/Emacs/
You can spawn multiple instances of ispell, and use the xml:lang tag to decide which language to check for.

Problems with UTF-8 chars (iOS, NSString)

when I parse XML document I get strings like that: "večinoma sončno " How do I replace č with correct values? Do I have to manually replace them one by one, or is there better way.
Thanks!
They're HTML Entities, it's not to do with UTF-8. This question and it's answers might help you: HTML character decoding in Objective-C / Cocoa Touch