I
I
Ilya2017-04-28 20:36:05
Node.js
Ilya, 2017-04-28 20:36:05

How to process messages to the bot?

It's not just about a command like / cmd1 [arg]
Namely, about human text recognition, like: "When will Vova be on duty?" or "Who is on duty the day after tomorrow?".
The essence of the requests: to find out information about the duty, that is, the text should contain the Person (Name or "I") and possibly the date.
If there are libraries for this? (so as not to write on regular expressions).
There should also be an option that the question is generally leftist and he should also determine this.
Or is there something better than regular expressions that doesn't exist? After all, words can be rearranged, and you never know all the options in advance.
What needs to be done:

  1. Make sure that the message about duty
  2. Get the date and parse it into a JS-readable form, Unix or similar (if any)
  3. Get the name and translate it into the nominative case or remove the ending altogether so that you can easily find the name in the database (if any)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2017-08-28
@Mr_Epic

There are natural language processing tools for this, for example: API.AI .
Here is an example article about a bot: https://habrahabr.ru/company/ruvds/blog/336088/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question