Skip to content

Add comprehensive documentation to ranking module - #126

Merged
unclesp1d3r merged 2 commits into
ranking-systemfrom
copilot/sub-pr-125
Jan 18, 2026
Merged

unclesp1d3r merged 2 commits into
ranking-systemfrom
copilot/sub-pr-125

Conversation

Copilot AI commented Jan 18, 2026 •

Copy link
Copy Markdown
Contributor

The ranking module lacked documentation explaining its purpose, scoring algorithm, and API usage, making it difficult for users to understand how to configure and use the ranking system.

Changes

  • Module-level documentation: Explains the scoring algorithm (score = section_weight + semantic_boost - noise_penalty), provides usage examples with both default and custom configuration, and clarifies the relationship between RankingConfig and RankingEngine

  • RankingConfig documentation: Documents the purpose of each field (section_weights, tag_boosts, noise_penalty_multiplier) with expected value ranges (typically 0-200) and their influence on scoring behavior

  • RankingEngine documentation: Documents the engine's scoring workflow, debug mode behavior (controls whether per-component scoring details are populated), and all public methods including parameter semantics and mutability

Example Usage

use stringy::classification::{RankingEngine, RankingConfig};

// Customize scoring behavior
let mut config = RankingConfig::default();
config.noise_penalty_multiplier = 150; // Increase noise penalties
let engine = RankingEngine::with_config(config, true); // Enable debug mode

// Score and rank strings
engine.calculate_score(&mut found_string, Some(&section_info));
engine.rank_strings(&mut strings); // Sorted by score descending

The documentation now explains that when debug_mode is enabled, calculate_score populates section_weight, semantic_boost, and noise_penalty fields on each FoundString for transparency. When disabled, only the aggregate score is computed.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI mentioned this pull request Jan 18, 2026
@coderabbitai

coderabbitai Bot commented Jan 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: unclesp1d3r <251112+unclesp1d3r@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new ranking system for string classification Add comprehensive documentation to ranking module Jan 18, 2026
Copilot AI requested a review from unclesp1d3r January 18, 2026 06:46
@unclesp1d3r
unclesp1d3r marked this pull request as ready for review January 18, 2026 06:46
@unclesp1d3r
unclesp1d3r merged commit 2ec2dc3 into ranking-system Jan 18, 2026
2 checks passed
@unclesp1d3r
unclesp1d3r deleted the copilot/sub-pr-125 branch January 18, 2026 06:47
unclesp1d3r added a commit that referenced this pull request Jan 18, 2026
* feat(ranking): add ranking configuration and engine

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>

* feat(ranking): mark RankingConfig and RankingEngine as non_exhaustive

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>

* Add comprehensive documentation to ranking module (#126)

* Initial plan

* docs: add comprehensive documentation to ranking module

Co-authored-by: unclesp1d3r <251112+unclesp1d3r@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: unclesp1d3r <251112+unclesp1d3r@users.noreply.github.com>

* fix(ranking): change rank_strings to use stable sort

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>

---------

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
unclesp1d3r added a commit that referenced this pull request Feb 25, 2026
* feat(ranking): add ranking configuration and engine

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>

* feat(ranking): mark RankingConfig and RankingEngine as non_exhaustive

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>

* Add comprehensive documentation to ranking module (#126)

* Initial plan

* docs: add comprehensive documentation to ranking module

Co-authored-by: unclesp1d3r <251112+unclesp1d3r@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: unclesp1d3r <251112+unclesp1d3r@users.noreply.github.com>

* fix(ranking): change rank_strings to use stable sort

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>

---------

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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