Answer the question
In order to leave comments, you need to log in
How to determine the category of the request?
I am doing a project, the essence of which is as follows: there is an input field, a request is entered into it and the necessary tools / answers are issued for it.
For example:
{query} => {result / tool}
"2 + 2" => (calculator application or response is returned)
"png to jpg" => (image converter is returned)
PS "convert to jpg" field is the
"insanity" button " => (definition from a dictionary is given)
How it should roughly work: the request from input is sent to the python server, where it is processed somehow and the script determines which tool / module is best suited, then the request is sent to the selected module, where it is processed again and returns a response, which in turn is displayed on the screen.
That is, we have a modules folder, which contains the math, converter, dictionary folders; each subfolder (modules/math/, modules/converter, etc.) contains the necessary scripts that receive a specific request, such as a mathematical expression, and return a response.
There is also the main script, which decides which module / modules will give the best response to the request.
And actually questions: As far as I correctly represent as such things have to work? How can you implement such a classification that will occur in the main script? Where can I read about how to design such systems? And perhaps there is some other useful literature that will help in creating such a project, I would also like to know about its existence.
Answer the question
In order to leave comments, you need to log in
First of all, you need to understand RegEx regular expressions. Here is a kind of sensible article in Russian:
https://tproger.ru/translations/regular-expression...
But in English in more depth:
https://docs.python.org/3/howto/regex.html
When you figure out regular expressions , consider that the parser is already 90% ready.
You described your task in such detail, but forgot to write (or I didn’t notice) that it should turn out like this? Is this a site? or client application? If an application, then on what platforms and what frameworks (Gtk, Qt, etc.)? Write in the comments.
And there is no need for designing, write in one file, too small a task.
In general, design skills are obtained not from knowledge, but from experience. Therefore, in order to learn how to design, you need to do a lot of work, and not read books / articles.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question