-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/normalization option #1479
Conversation
…o feature/normalizationOption
# Conflicts: # cli/src/main/java/de/jplag/cli/CliOptions.java # languages/java/src/main/java/de/jplag/java/JavaLanguage.java
Since the README and wiki contains the help text, this PR should probably updates those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor issues here.
GreedyStringTiling coreAlgorithm = new GreedyStringTiling(options); | ||
ComparisonStrategy comparisonStrategy = new ParallelComparisonStrategy(options, coreAlgorithm); | ||
// Parse and validate submissions. | ||
SubmissionSetBuilder builder = new SubmissionSetBuilder(options); | ||
SubmissionSet submissionSet = builder.buildSubmissionSet(); | ||
if (options.normalize() && options.language().supportsNormalization()) { | ||
submissionSet.normalizeSubmissions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for now, when we enable it for EMF, we need a language method that can be called for the normalization.
# Conflicts: # core/src/main/java/de/jplag/JPlag.java # core/src/main/java/de/jplag/options/JPlagOptions.java
@TwoOfTwelve Do you want to make the changes regarding the language interface in this PR, or should I merge? |
I would like to do the changes to the Language interface here. I should get this done today. |
@tsaglam I have implemented a rough solution. Please take a look at it. I know it is still lacking all documentation, but I would like to know what you think before putting any more time into this. Basically, in langauge-api/standardOptions the StandardOptionsLanguage and the NormalizatbleLanguage classes contain a bunch of ungly code. Also there will be runtime exceptions if the interface is used without the abstract class. I think it is worth it, because it is the most flexible solution and also gives us an infrastructure for more options shared between languages. |
Agreed, that is not ideal from my point of view.
I do not think so, as it introduces a lot of complexity just to prematurely plan for future use cases. List<Token> parse(Set<File> files, boolean normalizationRequested) throws ParsingException;
default List<Token> parse(Set<File> files) throws ParsingException {
parse(files, false);
} This is minimally invasive and should not be API breaking through the default option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the minor issue we discussed regarding the language interface. Coverage is fine in this PR.
… parse(Set, boolean) function.
@TwoOfTwelve now you know why I was thinking about replacing as much code as possible in the Scala module with Java code! :D Coverage is fine for me, spotless needs a minor fix. |
Quality Gate failed for 'JPlag Plagiarism Detector'Failed conditions |
Implemented the cli (and JPlag) option to enable normalization.
If normalization is enabled, but not supported for the selected language JPlag immediately throws an exception.
The help text also shows, if normalization is supported for a language:
(relates to #1028)