fix(memory): tighten initial similarity tresholds#18666
fix(memory): tighten initial similarity tresholds#18666nijel wants to merge 1 commit intoWeblateOrg:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e29999eb21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Tightens Translation Memory pg_trgm similarity thresholds—especially for short/common strings—to reduce overly broad fuzzy scans and mitigate slow PostgreSQL queries/backlogs (related to #18611).
Changes:
- Adjusts
threshold_to_similarity()to be stricter for short strings and treatsthreshold >= 100as exact (1.0). - Adds
minimum_similarity()and updateslookup()to stop backoff earlier based on string length. - Updates/extends unit tests to cover the new similarity policy and lookup behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
weblate/memory/models.py |
Introduces stricter similarity thresholds for short strings and a new minimum backoff floor used by lookup(). |
weblate/memory/tests.py |
Updates expected similarity values and adds tests asserting the new minimum/backoff behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
With the fallback in place, we no longer need broad matches by default, we can get to them if no actual matches are there.
With the fallback in place, we no longer need broad matches by default, we can get to them if no actual matches are there.
This might be actually the solution for #18611.