Skip to content

Commit

Permalink
Changed default values of mergeBuffer and seperatingThreshold
Browse files Browse the repository at this point in the history
  • Loading branch information
uuqjz committed Aug 20, 2023
1 parent 181e74f commit 594bb4e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cli/src/main/java/de/jplag/cli/CliOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ public static class Merging {
@Option(names = {"--match-merging"}, description = "Enables match merging (default: false)%n")
public boolean enabled;

@Option(names = {"--merge-buffer"}, description = "Defines how low the length of a match can be, to be considered (default: 0)%n")
@Option(names = {"--merge-buffer"}, description = "Defines how low the length of a match can be, to be considered (default: 2)%n")
public int mergeBuffer;

@Option(names = {
"--seperating-threshold"}, description = "Defines how many token there can be between two neighboring matches (default: 0)%n")
"--seperating-threshold"}, description = "Defines how many token there can be between two neighboring matches (default: 6)%n")
public int seperatingThreshold;

}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/de/jplag/merging/MatchMerging.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* to as left and right and neighboring matches as upper and lower. When neighboring matches get merged they become one
* and the tokens separating them get removed from the submission clone. MergeBuffer describes how short a match can be
* and SeperatingThreshold describes how many tokens can be between two neighboring matches. Both are set in
* {@link JPlagOptions} as {@link MergingParameters} and default to (0,0).
* {@link JPlagOptions} as {@link MergingParameters} and default to (2,6).
*/
public class MatchMerging {
private JPlagOptions options;
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/de/jplag/merging/MergingParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

/**
* Collection of parameters that describe how a match merging should be performed.
* @param mergeBuffer describes how short a match can be, to be considered (Defaults to 0).
* @param seperatingThreshold describes how many tokens can be between to neighboring matches (Defaults to 0).
* @param mergeBuffer describes how short a match can be, to be considered (Defaults to 2).
* @param seperatingThreshold describes how many tokens can be between to neighboring matches (Defaults to 6).
*/
public record MergingParameters(boolean enabled, int mergeBuffer, int seperatingThreshold) {

/**
* The default values of MergingParameters are false for the enable-switch, which deactivate MatchMerging, while
* mergeBuffer and seperatingThreshold default to (0,0), which in testing yielded the best results.
* mergeBuffer and seperatingThreshold default to (2,6), which in testing yielded the best results.
*/
public MergingParameters() {
this(false, 0, 0);
this(false, 2, 6);
}

/**
Expand Down

0 comments on commit 594bb4e

Please sign in to comment.