Feat: Implement hybrid staged algorithm for smart title uppercase/acronym handling#60
Feat: Implement hybrid staged algorithm for smart title uppercase/acronym handling#60arran4 wants to merge 6 commits into
Conversation
…onym handling - Add `SMART_TITLE_ALGORITHMS.md` outlining the core ambiguity between screaming-case and acronyms. - Evaluate multiple algorithm families (Ratio, Whole-source, Provenance, Structural, Lexical, Explicit Mode, Multi-signal). - Implement a Staged Hybrid algorithm that uses global shape, structural isolation, and caller-provided predicates to accurately normalize or preserve uppercase words. - Deprecate `OptionSmartTitleThreshold` in favor of new options `OptionSmartTitleUpperMode` and `OptionSmartTitleAcronymPredicate`. - Retain backward compatibility by honoring the ratio threshold if explicitly set. - Include executable tests (`smart_title_algorithms_test.go`) and benchmarks (`smart_title_bench_test.go`) comparing the evaluated algorithms on various inputs. - Ensure safe type extraction and accommodate numeric types during `globalScreaming` detection. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Addressed PR feedback by refactoring the tests to use an array of structs rather than slices of strings and maps, ensuring a more idiomatic Go testing approach. Outputs are still logged to easily review algorithm variations. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
| func TestSmartTitleAlgorithms(t *testing.T) { | ||
| tests := []struct { | ||
| input string | ||
| expected map[string]string // Example of asserting expected outputs if desired, or just log |
There was a problem hiding this comment.
@jules I expect the matrix to be provided here.
There was a problem hiding this comment.
I've added the full input-to-expected output matrix inline in the tests as requested, so the expectations are fully explicitly captured and verifiable.
Addressed PR feedback by populating the expected outputs for all algorithms inline in `TestSmartTitleAlgorithms`. This provides a complete and explicitly verifiable matrix for how each algorithm behaves across various inputs. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
|
There was a problem hiding this comment.
@jules if this is test data is shoudl be go:embed and in testdata/ can you ensure that there is a name string and a description for each one
There was a problem hiding this comment.
@jules if this is test data is shoudl be go:embed and in
testdata/can you ensure that there is a name string and a description for each one
There was a problem hiding this comment.
I've moved the test matrix into testdata/smart_title_algorithms_matrix.json, giving each entry a name and description, and I'm loading it dynamically in the test via go:embed as requested. I've also resolved a struct name conflict with another test file.
Added |
…Threshold Added //nolint:staticcheck directives around the usage of the deprecated `OptionSmartTitleThreshold` in default lists to silence staticcheck warnings in `permutations.go`, `types.go`, and tests. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
Moved the Smart Title algorithms test matrix out of inline code and into a dedicated `testdata/smart_title_algorithms_matrix.json` file. Each test case now explicitly defines a `name` and `description` as requested by PR feedback, and the file is loaded via `go:embed`. Additionally resolved a struct naming collision that caused test failures. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
@jules do not solve lint / formatting issues with |
I've removed the |
Addressed PR feedback by removing the usage of `//nolint:staticcheck`. Instead of ignoring the deprecation warnings, the `OptionSmartTitleThreshold` option was safely removed from the `defaults` slice across `permutations.go` and `types.go`, relying entirely on the new logic built for the default Smart Title behavior. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
Implemented the requested multiple distinct algorithms to handle uppercase/acronym ambiguity in Smart Title formatting. The Staged Hybrid algorithm was chosen as the default for its deterministic and robust behavior, while the ratio threshold remains available as a deprecated fallback. Tests and benchmarks are provided to compare the strategies.
PR created automatically by Jules for task 14578529994752622307 started by @arran4