Frequency Analysis Clean-Up #2607
Draft
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.



This PR works towards #2595, thus refactoring the frequency analysis functionality. The main changes include moving frequency analysis classes to a new package, introducing a new options structure for frequency analysis, updating the CLI to support these options, and refactoring the application of frequency-based weighting to matches.
Frequency Analysis Refactor and Improvements:
de.jplag.highlightextractionpackage to a newde.jplag.frequencypackage, improving code organization and modularity.FrequencyAnalysisOptionsrecord to encapsulate all frequency analysis settings, replacing individual parameters and simplifying configuration.FrequencyAnalysisclass with a static method to apply frequency-based weighting to matches, centralizing the logic for frequency analysis.MatchFrequencyEvaluatorclass to compute match frequencies based on the selected strategy.CLI Integration and Option Handling:
JPlagOptionsBuilderandCliOptions) to use the newFrequencyAnalysisOptionsstructure, including an option to enable/disable frequency analysis and select strategies via command-line arguments.FrequencyStrategyPicocliBindingsto support command-line completion and conversion for frequency strategies.Core Logic and API Updates:
JPlagclass to use the new frequency analysis API, applying frequency weighting only if enabled in the options.FrequencyDeterminationto return the frequency map directly, simplifying its usage.