Merge pull request #1814 from return42/fix-typos

[fix] typos / reported by @kianmeng in searx PR-3366
This commit is contained in:
Alexandre Flament 2022-09-28 09:22:02 +02:00 committed by GitHub
commit a3148e5115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 96 additions and 96 deletions

View file

@ -275,12 +275,12 @@ def is_engine_active(engine: Engine):
def register_engine(engine: Engine):
if engine.name in engines:
logger.error('Engine config error: ambigious name: {0}'.format(engine.name))
logger.error('Engine config error: ambiguous name: {0}'.format(engine.name))
sys.exit(1)
engines[engine.name] = engine
if engine.shortcut in engine_shortcuts:
logger.error('Engine config error: ambigious shortcut: {0}'.format(engine.shortcut))
logger.error('Engine config error: ambiguous shortcut: {0}'.format(engine.shortcut))
sys.exit(1)
engine_shortcuts[engine.shortcut] = engine.name

View file

@ -79,7 +79,7 @@ def response(resp):
# * book / performing art / film / television / media franchise / concert tour / playwright
# * prepared food
# * website / software / os / programming language / file format / software engineer
# * compagny
# * company
content = ''
heading = search_res.get('Heading', '')

View file

@ -40,7 +40,7 @@ def response(resp):
search_res = loads(resp.text)
# check if items are recieved
# check if items are received
if 'items' not in search_res:
return []

View file

@ -326,14 +326,14 @@ def response(resp):
# google *sections*
if extract_text(eval_xpath(result, g_section_with_header)):
logger.debug("ingoring <g-section-with-header>")
logger.debug("ignoring <g-section-with-header>")
continue
try:
title_tag = eval_xpath_getindex(result, title_xpath, 0, default=None)
if title_tag is None:
# this not one of the common google results *section*
logger.debug('ingoring item from the result_xpath list: missing title')
logger.debug('ignoring item from the result_xpath list: missing title')
continue
title = extract_text(title_tag)
url = eval_xpath_getindex(result, href_xpath, 0, None)
@ -341,7 +341,7 @@ def response(resp):
continue
content = extract_text(eval_xpath_getindex(result, content_xpath, 0, default=None), allow_none=True)
if content is None:
logger.debug('ingoring item from the result_xpath list: missing content of title "%s"', title)
logger.debug('ignoring item from the result_xpath list: missing content of title "%s"', title)
continue
logger.debug('add link to results: %s', title)

View file

@ -141,7 +141,7 @@ def response(resp):
padding = (4 - (len(jslog) % 4)) * "="
jslog = b64decode(jslog + padding)
except binascii.Error:
# URL cant be read, skip this result
# URL can't be read, skip this result
continue
# now we have : b'[null, ... null,"https://www.cnn.com/.../index.html"]'

View file

@ -150,7 +150,7 @@ def response(resp):
# ignore google *sections*
if extract_text(eval_xpath(result, g_section_with_header)):
logger.debug("ingoring <g-section-with-header>")
logger.debug("ignoring <g-section-with-header>")
continue
# ingnore articles without an image id / e.g. news articles

View file

@ -70,7 +70,7 @@ def response(resp):
elif properties.get('osm_type') == 'R':
osm_type = 'relation'
else:
# continue if invalide osm-type
# continue if invalid osm-type
continue
url = result_base_url.format(osm_type=osm_type, osm_id=properties.get('osm_id'))

View file

@ -209,7 +209,7 @@ def _fetch_supported_languages(resp):
# native name, the English name of the writing script used by the language,
# or occasionally something else entirely.
# this cases are so special they need to be hardcoded, a couple of them are mispellings
# this cases are so special they need to be hardcoded, a couple of them are misspellings
language_names = {
'english_uk': 'en-GB',
'fantizhengwen': ['zh-TW', 'zh-HK'],

View file

@ -50,7 +50,7 @@ WIKIDATA_PROPERTIES = {
# SERVICE wikibase:label: https://en.wikibooks.org/wiki/SPARQL/SERVICE_-_Label#Manual_Label_SERVICE
# https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Precision,_Units_and_Coordinates
# https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Data_model
# optmization:
# optimization:
# * https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/query_optimization
# * https://github.com/blazegraph/database/wiki/QueryHints
QUERY_TEMPLATE = """
@ -386,7 +386,7 @@ def get_attributes(language):
add_amount('P2046') # area
add_amount('P281') # postal code
add_label('P38') # currency
add_amount('P2048') # heigth (building)
add_amount('P2048') # height (building)
# Media
for p in [

View file

@ -50,7 +50,7 @@ def request(query, params):
# replace private user area characters to make text legible
def replace_pua_chars(text):
pua_chars = {
'\uf522': '\u2192', # rigth arrow
'\uf522': '\u2192', # right arrow
'\uf7b1': '\u2115', # set of natural numbers
'\uf7b4': '\u211a', # set of rational numbers
'\uf7b5': '\u211d', # set of real numbers

View file

@ -53,7 +53,7 @@ Replacements are:
0: none, 1: moderate, 2:strict
If not supported, the URL paramter is an empty string.
If not supported, the URL parameter is an empty string.
"""
@ -114,7 +114,7 @@ time_range_support = False
time_range_url = '&hours={time_range_val}'
'''Time range URL parameter in the in :py:obj:`search_url`. If no time range is
requested by the user, the URL paramter is an empty string. The
requested by the user, the URL parameter is an empty string. The
``{time_range_val}`` replacement is taken from the :py:obj:`time_range_map`.
.. code:: yaml