Skip to content

fix minimum counts - #116

Open
jamesmoore wants to merge 4 commits into
mainfrom
fix-min-counts
Open

fix minimum counts#116
jamesmoore wants to merge 4 commits into
mainfrom
fix-min-counts

Conversation

@jamesmoore

@jamesmoore jamesmoore commented Aug 30, 2026

Copy link
Copy Markdown
Owner
  • Simplify factory logic and make it more consistent.
  • Add comment to readme explaining a strategy for including other character counts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new IsAutogram console output introduces unwanted side effects and GetStatedFrequency still mis-parses singular “colon” without an additional replacement.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adjusts handling of “extended-name” punctuation invariants (notably : and =) so their minimum counts and sentence parsing behave correctly when those invariants don’t appear in the numeric-letter list.

Changes:

  • Extend stated-frequency parsing to recognize colons and equals, and allow :/= as the counted “character” token.
  • Add :/= extended-name mappings in CharExtensions for rendering count list entries.
  • Fix invariant-to-variable baseline propagation by indexing variableNumericCounts using MinimumCount (instead of BaselineCount + 1).
File summaries
File Description
Autogram/Extensions/StringExtensions.cs Adds parsing support for :/= and adds a mismatch diagnostic line in IsAutogram.
Autogram/CharExtensions.cs Adds extended-name/plural-name mappings for : and =.
Autogram/AutogramConfigFactory.cs Uses MinimumCount when adding invariant cardinal contributions into variable baselines.
Review details

Suppressed comments (1)

Autogram/Extensions/StringExtensions.cs:25

  • GetStatedFrequency converts extended names into punctuation so the regex captures the right character. Currently only "colons" is replaced; a singular "colon" (e.g. "one colon") will be mis-parsed as the letter 'c' because the regex captures only the first character after the number word.
            lower = lower.Replace("colons", ":'s");
            lower = lower.Replace("equals", "='s");
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Autogram/Extensions/StringExtensions.cs
Comment thread Autogram/Extensions/StringExtensions.cs Outdated
jamesmoore and others added 3 commits August 30, 2026 07:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The factory logic still risks unclear failures (including potential out-of-range indexing) and the changed minimum-count behavior isn’t protected by a regression test case for configurations where MinimumCount differs from BaselineCount + 1.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment on lines +36 to 37
if (!wordToNumber.TryGetValue(wordNumber, out int declaredCount))
throw new InvalidOperationException();
Comment on lines 82 to +83
// add the cardinals of the invariants into the variant baseline.
var numericCount3 = variableNumericCounts[letter.Index][letter.BaselineCount + 1];
var numericCount3 = variableNumericCounts[letter.Index][letter.MinimumCount];

// add the cardinals of the invariants into the variant baseline.
var numericCount3 = variableNumericCounts[letter.Index][letter.BaselineCount + 1];
var numericCount3 = variableNumericCounts[letter.Index][letter.MinimumCount];
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