There is such a non-standard question. Let's just say, you need some kind of library or method, the principle for creating, let's say, chat bot. There is an input line and there is a base of ready-made templates in which the blanks are defined. The input text is compared with the base of the templates and if there are matches, it returns some result.
For example, the input string "Hello, how are you?"
The database has such templates
[ {id: 0, text: "Привет, как дела?"}, {id: 1, text: "Здравствуй, как дела?"}, {id: 2, text: "Братан, ты как?"}, {id: 3, text: "Добрый день, как вы?"}, {id: 4, text: "Здарова, как жизнь?"} ... ] After comparing the input string, we should get {id: 1} , but of course it is quite simple to implement. If you look at the 5 records in the database are almost similar and they could somehow be merged and instead of the text, write which regex check, so that we get the input text and check the database records until the regular expression is true . But what if you need to create 10,000 templates? Writing regular expressions in this case would not be very good.
Here I also need to make something on similarity of more simplified regular expressions. For example, if someone is familiar with the service iii.ru, then such a function is implemented there, but they say that everything works for them on AI, and I somehow cannot create AI. There is also the site Flow.ai where this whole thing is very simple done, I don’t know how they have implemented it.
For example, I want like this
There is a pattern: {Привет, Добрый день, Здравствуй, Хеллов}, как [ {у вас, у тебя, ты},[не обязательно]] [{дела, жизнь, всё}, [не обязательно]]?
And this template is suitable for such lines:
Hi, how are you?
Hello how are you?
Hello, how are you?
Good afternoon, how are you?
Hello, how is life?
etc.
I think I didn’t explain the essence of the question well enough, but I hope someone will understand and be able to help with something.