What is CEYD Language?
[wbcr_snippet id=”9710″ title=”sweetalert”]
CEYD language (Cenker.com Artificial Intelligence Language), is a scripting language which enables voice-driven chat robot assistant to understand commands (questions) and answers them accordingly (response) Users can write and develop this scripting language so that they can use the compiled script in various platform afterwards.
CEYD language functions are written inside pure text formatted answers and these functions determine how a robot or chatbot should respond to the question. Writing CEYD functions inside answers is not required. They are used for functionality and productivity of the answer.
What is CEYD-A
CEYD-A is the official assistant of CEYD language. It is currently supported in the Android platform and can be downloaded from Google Play Store. It has more than 4 million users in Turkey and will spread worldwide soon
English version of CEYD-A is also available and can be downloaded from https://play.google.com/store/apps/details?id=com.cenker.ceydasistan.app.en&hl=en_US
Do you support API for developers?
As of August 2017, CEYD-A contains more than 300.000 commands created by 200.000 developers. These developers generally create commands orally using CEYD-A application. Commands can also be created in written form for more complicated usage. You may assume CEYD-A as a voice-enabled semantic search engine which answers your questions. So the use of this API is to get the answer to your question.
-
Web API
http://docs.ceyda.apiary.io/#reference/0/questions-collection
Sample usage of this API
You can set the following POST parameters as
123456"username": "test","token": "aaa28b4089101057d2b026adf9c68da1","question": "bayram ne zaman","lang": "tr-TR"When you call this service, you can expect the following response
12345"username": "test","question": "bayram ne zaman","answer": "Zafer Bayramı 30 Ağustos 2017,Çarşamba"Is this service free ?
You can use this service freely provided that your quota will not be exceeded. This quota will be announced in the coming days.
What is my token for my account ?
Please login https://beta.ceyd-a.com/ . After login, you will see your username and token info as well as your current quota. Your login information is the same as your CEYD-A account. You can take free support from https://en.ceyd-a.com
-
Offline Library
For offline usage, you may use CEYD Java library in your code project. CEYD Java library is referenced at: Using CEYD-A Services in Java Projects
How can I create my own custom commands ?
Commands can be created at https://kodla.ceyd-a.com
Is there an editor with syntax highlighter feature for CEYD-A?
You can use the online editor in https://kodla.ceyd-a.com or NotePad ++ with CEYD support to write code having a larger number of lines.
The online editor also has features like code completion, error handling, run selected lines.
https://github.com/cenkersisman/CEYD-A#code-syntax-highlighting-for-notepad
Where can I find a command sample which fetches data from a remote web service ?
https://en.ceyd-a.com/c/2016/10/12/json-web-servislerinden-bilgi-cekme/
Where can I find more command samples ?
https://en.ceyd-a.com/c/category/ozel-komutlar/
CEYD Structure
What is Command?
We can define a command as a chain of question and its answers.
Commands can be defined at https://kodla.ceyd-a.com
As CEYD language is free to use and develop, creating your custom commands is FREE. Developing your commands are encouraged Note that, after entering this site, English language selection is automatically chosen, otherwise you can also click on English link manually. After the new command is submitted, it is automatically loaded by the user’s device provided that CEYD-A on the device has the same login information.
Question Words
Question words can be used to help CEYD-A finds its correct command. The words in question words are matched in the sentence spoken. If a spoken sentence contains the question word, the command is executed.
Words or sentences are separated by | sign like: Good morning|Hello|Hi
Question Patterns
This is not a required field. If used, it will define the parameters of the question. You can use regex to assign groups.
For instance, if you write,
{ANY}make sum of ({NUM1}) and ({NUM2}){ANY}
and you say to make the sum of 4 and 3, 4 and 3 will be treated as decimal groups. You can use these groups in the response area as {NUM1} and {NUM2}, In other words, groups behave like parameters for responses.
Example 1:
1 2 3 4 5 6 |
WORDS: make sum of PATTERN: {ANY}make sum of ({NUM1}) and ({NUM2}){ANY} RESPONSE: Do you want me to add {NUM1} to {NUM2}. I will. |
1 2 3 |
{!EVAL 4 + 3!} |
Example 2:
(Modified version using CEYD functions inside answer)
1 2 3 4 5 |
WORDS: make sum of PATTERN: {ANY}make sum of ({NUM1}) and ({NUM2}){ANY} RESPONSE: Sum of {NUM1} and {NUM2} is {!EVAL {NUM1}+{NUM2}!} |
Response
It is the response of the command. They must be separated by | signs
No, I am not a student|I am a robot not human
Also, CEYD functions can be embedded in the answer. The parameter passed from the question may also be used in the sentence.
I do not know what $1 is|Unfortunately I do not have any information about $1
CEYD functions are encapsulated in {! and !}
CEYD functions are
RET, IF, SET, GET, EVAL, FOR functions
RET function returns the result of a command.
IF function compares two values and returns a value or execute a block of command depending on the comparison.
SET function assigns a value to a variable. This value is stored in memory even if the device is restarted.
GET function returns the variable value.
EVAL makes mathematical function and returns its value
FOR is a control flow statement for specifying iteration, which allows code to be executed repeatedly. Some examples provided that temperature and cloudy commands are created before:
1 2 3 |
{!RET How are you!} |
1 2 3 4 |
RESPONSE: It is {!RET what is temperature!} outside.|It is % {!RET cloud percentage!} percent cloudy outside. |
1 2 3 |
Television means {!RET what is television!} I guess. |
1 2 3 |
{!SET $temp={!RET what is temperature!}!}It is {!GET $temp!} degree.I think {!IF $temp<=18??it is cold::it is hot!} |
To give a little more complicated example, let’s write a currency calculator.
1 2 3 4 5 6 |
WORDS: dollars in euros,10 PATTERN: how much ({PAR1}) (dollar|euro){ANY} RESPONSE: $1 euro is {!EVAL {PAR1}*{!RET euro!}/{!RET dollar!}!} dollars |
1 2 3 |
5 euro is {!EVAL 5*{!RET euro!}/{!RET dollar!}!} dollars |
As we know, the question is in regex format template. The pattern is separated by () groups, they are referred to as the response parameters $1 $2 so on. The $1 in the answer corresponds to ({PAR1}) group in the pattern. So when how much 5 euros in dollars? is spelt
({PAR1}) is the first group. The second group is dollar or euro.
The answer template will be finally transformed into something like
5 dollars is 4.59 Euros.
The answer will be formed and will be reflected on the screen and also will be spoken by CEYD-A.
(OPTIONAL) Action/Add Action
You can use this step if you want to add an alternative question sentence to a command already defined. Let’s say you will define a new command B which will behave the same as command A, then you can write command A in this area. This is not required. Because it is an obsolete feature. You can perform actions in Response area as well.
Here are the main commands of the CEYD which can be used with RET functions. This PDF file will be updated daily