I have expressions like this:
(cat OR cat OR kitten OR kitten) AND (dog OR dog) NOT (blueberry OR firefly)
Does anyone have ideas on how to make tables to save them?
Before I get a request to use parentheses, I limited the use of operators to avoid ambiguous situations. Thus, only ANDs and NOT or only ORs are stored in this form:
id | name 1 | AND 2 | OR 3 | NOT
keywords
id | keyword 1 | cat 2 | dog 3 | firefly
expressions
id | operator | keywordId 1 | 0 | 1 1 | 1 | 2 1 | 3 | 3
which was: cat AND dog NOT firefly
But now I'm really puzzled ...
, "". NULL- , ( )?
(, ), , , .
/ :
cat cats OR dog dogs OR AND pigeon firefly OR NOT
, , .
, (, A-Z) AND, OR, NOT:
cat A cats B dog C dogs : DAB+CD+& pigeon A firefly : AB+~
.
, . :
-
Cat Dog Firefly --- --- ------ 1 2 4
, . , , . :
5 = 101 = , , .
id | locationName | options --------------------------- 1 | loc 1 | 5 2 | loc 2 | 2 3 | loc 3 | 7 4 | loc 4 | 6
, , . :
, , , :
2 options = 2
2,3 4.
, , :
6 options = 6
3 4
5 = 5
1 3.
:
4 | = 4
4 options = 0
, , , , , , , - . , , , .
( ) ( ) ( OR firefly)
NOT, ( ).
, . . .. :
Id | | 1 | 2 | 1 | 2
, 1, keyword2, expression1 expression2 NULL, 0, 1 2 0, 1, 2 . 1 , . , .
, . , , , , (CAT AND CATS) DOG CAT AND (CATS AND DOG). , .
, . , .
Source: https://habr.com/ru/post/1746401/More articles:Spiral neural networks - machine-learningJava output source in pdf with syntax enabled - javaAm I writing an assembly or NASM? - assemblyThe most effective way to test links is c #What is the best way to tell if the mouse is above the shape or not? - c #Are conditional subqueries optimized if the condition is false? - performanceHow to add an event handler to an event by name? - c #Does NavigationHandler.handleNavigation () clear a flash? - javaScrolling up a page after ASP.Net Ajax Async-Postback without jQuery - asp.netInstalling a different version of the merge module depending on the processor architecture - installerAll Articles