Skip to content

Conversation

@mircealungu
Copy link
Member

Summary

  • Adds user_mwe_override table to store user overrides for incorrect MWE groupings
  • Indexed by sentence_hash + mwe_expression for robustness to re-ordering/re-tokenization
  • Adds /disable_mwe_grouping endpoint
  • Returns disabled_mwe_groups when loading article content
  • Includes article_id in context_identifier for article fragments

Migration

  • 26-01-05--add_user_mwe_override.sql

Files Changed

  • zeeguu/core/model/user_mwe_override.py - New model
  • zeeguu/api/endpoints/translation.py - New endpoint
  • zeeguu/core/model/user_article.py - Return disabled groups
  • zeeguu/core/model/article.py - Include article_id in context

Frontend PR

Requires corresponding frontend changes: zeeguu/web#858

Test plan

  • Run migration
  • Translate an MWE in an article
  • Call /disable_mwe_grouping endpoint
  • Reload article - verify disabled_mwe_groups is returned
  • Verify MWE is no longer grouped

🤖 Generated with Claude Code

- Add user_mwe_override table (indexed by sentence_hash + mwe_expression)
- Add UserMweOverride model with hash computation and normalization
- Add /disable_mwe_grouping endpoint to store overrides
- Include article_id in context_identifier for article fragments
- Return disabled_mwe_groups when loading article content
- Handle preferred_bookmark_id FK constraint on bookmark deletion

Users can now disable incorrectly detected MWE groupings. Overrides
are stored by sentence hash (robust to re-ordering) and MWE expression
(robust to re-tokenization).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

ArchLens - No architecturally relevant changes to the existing views

@mircealungu mircealungu merged commit 7b56af0 into master Jan 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants