mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-06 15:02:20 +02:00
Avoid invented publication windows on corrected version lookups
This commit is contained in:
@@ -3496,7 +3496,7 @@ def preserve_requested_web_recency(name, args, *, user_text='', prior_search_int
|
||||
requested_window = requested_search_publication_window(user)
|
||||
if requested_window:
|
||||
normalized['time_filter'] = requested_window
|
||||
elif reference_lookup_without_date_window(user):
|
||||
elif reference_lookup_without_date_window(user, query):
|
||||
# A model-generated publication cutoff must not hide still-current
|
||||
# reference pages when the user did not ask for recent publications.
|
||||
normalized.pop('time_filter', None)
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import re
|
||||
|
||||
|
||||
def reference_lookup_without_date_window(text: str) -> bool:
|
||||
def reference_lookup_without_date_window(text: str, query_hint: str = '') -> bool:
|
||||
"""Current reference information need not have been published recently."""
|
||||
reference = re.search(
|
||||
r'\b(?:documentation|docs|manuals?|guides?|reference|installation|configuration)\b'
|
||||
r'|\bprivacy\s+(?:features|settings|protections)\b', text, re.I,
|
||||
r'\b(?:documentation|docs|manuals?|guides?|reference|installation|configuration|versions?|releases?)\b'
|
||||
r'|\bprivacy\s+(?:features|settings|protections)\b', text + ' ' + query_hint, re.I,
|
||||
)
|
||||
publication = re.search(
|
||||
r'\b(?:published|publication|announced|released|news|headlines|recent|today|yesterday)\b'
|
||||
|
||||
Reference in New Issue
Block a user