Skip to content

Conversation

@jqnatividad
Copy link
Collaborator

Implementing all the strategies listed here
https://en.wikipedia.org/wiki/Ranking

Before, we were only doing Standard Competition Ranking/("min" ranking in R).

Use R naming convention for the different strategies.

@jqnatividad jqnatividad requested a review from Copilot October 27, 2025 15:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements comprehensive ranking strategies for frequency tables, expanding beyond the previous single "min" strategy to include all standard ranking methods (min, max, dense, ordinal, and average) as defined in the Wikipedia ranking article. The implementation follows R's naming conventions for these strategies.

Key Changes:

  • Added --rank-strategy flag with five options: min, max, dense, ordinal, and average
  • Changed rank data type from u32 to f64 to support fractional ranks (average strategy)
  • Updated rank formatting logic to display integers when possible, decimals when needed

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/cmd/frequency.rs Core implementation of RankStrategy enum, ranking algorithms for each strategy, and rank formatting logic
src/cmd/schema.rs Added default RankStrategy::Min to schema command integration
tests/test_frequency.rs Comprehensive test suite covering all ranking strategies, edge cases, and JSON output validation

jqnatividad and others added 3 commits October 27, 2025 11:39
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jqnatividad jqnatividad merged commit 7f83691 into master Oct 27, 2025
12 of 13 checks passed
@jqnatividad jqnatividad deleted the frequency-rank-ties-strategy branch October 27, 2025 15:56
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