.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.query.QueryPartParser Class Reference
+ Inheritance diagram for searx.query.QueryPartParser:
+ Collaboration diagram for searx.query.QueryPartParser:

Public Member Functions

 __init__ (self, raw_text_query, enable_autocomplete)
 
 __call__ (self, raw_value)
 

Static Public Member Functions

 check (raw_value)
 

Public Attributes

 raw_text_query = raw_text_query
 
 enable_autocomplete = enable_autocomplete
 

Protected Member Functions

 _add_autocomplete (self, value)
 

Static Private Attributes

str __slots__ = "raw_text_query", "enable_autocomplete"
 

Detailed Description

Definition at line 16 of file query.py.

Constructor & Destructor Documentation

◆ __init__()

searx.query.QueryPartParser.__init__ ( self,
raw_text_query,
enable_autocomplete )

Definition at line 25 of file query.py.

25 def __init__(self, raw_text_query, enable_autocomplete):
26 self.raw_text_query = raw_text_query
27 self.enable_autocomplete = enable_autocomplete
28

Member Function Documentation

◆ __call__()

searx.query.QueryPartParser.__call__ ( self,
raw_value )
Try to parse raw_value: set the self.raw_text_query properties

return True if raw_value has been parsed

self.raw_text_query.autocomplete_list is also modified
if self.enable_autocomplete is True

Reimplemented in searx.query.BangParser, searx.query.ExternalBangParser, searx.query.FeelingLuckyParser, searx.query.LanguageParser, and searx.query.TimeoutParser.

Definition at line 30 of file query.py.

30 def __call__(self, raw_value):
31 """Try to parse raw_value: set the self.raw_text_query properties
32
33 return True if raw_value has been parsed
34
35 self.raw_text_query.autocomplete_list is also modified
36 if self.enable_autocomplete is True
37 """
38

◆ _add_autocomplete()

searx.query.QueryPartParser._add_autocomplete ( self,
value )
protected

Definition at line 39 of file query.py.

39 def _add_autocomplete(self, value):
40 if value not in self.raw_text_query.autocomplete_list:
41 self.raw_text_query.autocomplete_list.append(value)
42
43

Referenced by searx.query.BangParser._autocomplete(), searx.query.ExternalBangParser._autocomplete(), searx.query.LanguageParser._autocomplete(), and searx.query.TimeoutParser._autocomplete().

+ Here is the caller graph for this function:

◆ check()

searx.query.QueryPartParser.check ( raw_value)
static
Check if raw_value can be parsed

Reimplemented in searx.query.BangParser, searx.query.ExternalBangParser, searx.query.FeelingLuckyParser, searx.query.LanguageParser, and searx.query.TimeoutParser.

Definition at line 22 of file query.py.

22 def check(raw_value):
23 """Check if raw_value can be parsed"""
24

Member Data Documentation

◆ __slots__

str searx.query.QueryPartParser.__slots__ = "raw_text_query", "enable_autocomplete"
staticprivate

Definition at line 18 of file query.py.

◆ enable_autocomplete

searx.query.QueryPartParser.enable_autocomplete = enable_autocomplete

◆ raw_text_query


The documentation for this class was generated from the following file: