Repository navigation
Extract ngram calculation and index-definition planning - #60
Merged
Merged
Conversation
dblock
force-pushed
the
dblock/maintainability
branch
from
October 17, 2026 03:43
9f57409 to
55acc5a
Compare
Danger ReportNo issues found. |
Closed
Follow the maintainability direction proposed by @tomasc in mongoid#40 without changing model APIs, locale storage, scoring, or Mongoid driver hooks. Co-authored-by: Tomas Celizna <tomas.celizna@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dblock
force-pushed
the
dblock/maintainability
branch
from
October 17, 2026 11:24
55acc5a to
1607fe0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow the maintainability direction of @tomasc’s #40 with a focused, behavior-preserving refactor on current master.
Extract ngram normalization, sampling, and scoring into a persistence-independent helper with named steps. Keep the public model all_ngrams method as its delegating entry point. Extract compound search-key construction and obsolete-index selection into a pure definition planner; keep driver operations and Mongoid hooks in place. Preserve shared-model filter unions, locale-tagged storage, arrays, Unicode alphabets, bulk inserts, timeout options, and criteria support.
Add unit specs runnable without MongoDB and a model-entry-point delegation regression. Exact outputs for 9,984 input/configuration combinations match the pre-refactor baseline. All 143 examples pass locally. No migration or index rebuild is required.
Credit to @tomasc for the original extraction proposal, recorded in the commit coauthor. Supersedes the remaining refactoring scope of #40 without introducing its obsolete compatibility or storage changes.
Prepared by an AI on behalf of @dblock.