IranCahtBot
V.I.P
Posts: 27
Joined: Sat Feb 25, 2017 7:36 pm

Enumeration Recognize

Fri Jun 16, 2017 10:03 pm

Hello Dear Sir,

I am developing an application base on Persian language with using Oscova. My application gets an input message then it will be processed it by Oscova Bot.
In Persian language, each word may have two or three synonyms so I used “Enumeration Recognize” in my application but it didn’t work correctly.
I am going to show what I understand about “Enumeration Recognizer”, would you please correct me if I am wrong.

[Expression("I want to buy perfume with the scent of @smell")]

bot.CreateRecognizer("smell", new[] {"x", "y"});
enum PriorityTypes
{
[Synonyms("O","M","N")]
"x",
[Synonyms("P","Q")]
"y"
}
I think if Oscova receive a message such as “I want to buy perfume with the scent of O”, at first, the Oscova converts “O” to “x” and then recognize message.
If I understand well, would you please tell me, how I can use “enum PriorityTypes” in Recognizer?
I sincerely thank you for your help.

With regards
Ebrahimi

User avatar
Fantom
Help & Support
Posts: 320
Joined: Fri Oct 25, 2013 9:20 pm

Re: Enumeration Recognize

Fri Jun 16, 2017 10:23 pm

In your case if you assume Scent to be declared in an enumeration type then it would look like the following:

CSharp Code

enum Scent
{
	[Synonyms("O", "M", "N")]
	X,

	[Synonyms("P", "Q")]
	Y
}
You can then easily add the above enum to the Bot:

CSharp Code

bot.CreateRecognizer<Scent>("Scent");
Now whenever the user says O, M and N they will all be mapped to X

IranCahtBot
V.I.P
Posts: 27
Joined: Sat Feb 25, 2017 7:36 pm

Re: Enumeration Recognize

Sat Jun 17, 2017 12:46 am

Hello Dear FranzZ,
I appreciate the information you have provided me with and I appreciate the prompt reply.
With regards
Ebrahimi

IranCahtBot
V.I.P
Posts: 27
Joined: Sat Feb 25, 2017 7:36 pm

Re: Enumeration Recognize

Sat Jun 17, 2017 2:58 pm

Hello Dear FranzZ,
I appreciate you in advance for your attention to this matter.
In my application is needed to pass Customer's Message and some parameters to a dialogue. I want to use these parameters in the intents. Would you please help me how I can do that.
For example:
var bot = new OscovaBot();
bot.Dialogs.Add(new AppDialog());
bot.Trainer.StartTraining();

…….
evaluationResult = bot.Evaluate("Please cancel my appointment",CustomerID);

In the intent:
Expression ("Please cancel my appointment")]
public void CancelAppointment (Context context, Result result, CustomerID)
{
Search in appointment table in a DB by CustomerID and cancel the appointment;
Text = "Dear" + Customre's name + "your appointment was canceled"
result.SendResponse(Text);
}
I thank you very much for taking time to answer my question and help me.

With regards
Ebrahimi

User avatar
Fantom
Help & Support
Posts: 320
Joined: Fri Oct 25, 2013 9:20 pm

Re: Enumeration Recognize

Sat Jun 17, 2017 3:58 pm

I have answered this query here.

Return to “Feature Request and Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests