mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 10:32:21 +02:00
Merge pull request #827 from davidar/spell
[enh] show spelling corrections
This commit is contained in:
commit
b1d49bacb0
5 changed files with 23 additions and 0 deletions
|
@ -112,6 +112,7 @@ title_xpath = './/h3'
|
|||
content_xpath = './/span[@class="st"]'
|
||||
content_misc_xpath = './/div[@class="f slp"]'
|
||||
suggestion_xpath = '//p[@class="_Bmc"]'
|
||||
spelling_suggestion_xpath = '//a[@class="spell"]'
|
||||
|
||||
# map : detail location
|
||||
map_address_xpath = './/div[@class="s"]//table//td[2]/span/text()'
|
||||
|
@ -275,6 +276,9 @@ def response(resp):
|
|||
# append suggestion
|
||||
results.append({'suggestion': extract_text(suggestion)})
|
||||
|
||||
for correction in dom.xpath(spelling_suggestion_xpath):
|
||||
results.append({'correction': extract_text(correction)})
|
||||
|
||||
# return results
|
||||
return results
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue