-
Notifications
You must be signed in to change notification settings - Fork 332
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
Add parse and compare hooks #1291
Add parse and compare hooks #1291
Conversation
48ecef4
to
b72c61f
Compare
b72c61f
to
38babe6
Compare
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.
I've made a short code review and supplied some suggestions, feel free to comment on them :)
core/src/main/java/de/jplag/strategy/AbstractComparisonStrategy.java
Outdated
Show resolved
Hide resolved
d838320
to
40364e7
Compare
@dfuchss Thank you for the review! I've applied most of your suggestions and replied to your comments if I did not. |
@olmokramer thanks a lot. EDIT: I've retriggered SonarCloud .. let's wait for the results :) |
@dfuchss thanks. I've now added some test cases for all the hooks as well. |
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.
Thanks for the tests. I've one minor suggestion regarding them.
06c8f73
to
1ed2cc6
Compare
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.
I think the idea and realization is good.
Maybe you can add some docs to the public methods/fields you've created.
Afterwards, let's wait for the review of @tsaglam :)
Some tests seem to fail :) |
1ed2cc6
to
0be6f36
Compare
@dfuchss Thanks again for the reviews. I have added documentation for the new fields on the
Whoops, shouldn't have copy-pasted that test... Fixed now :) |
0be6f36
to
c8b2379
Compare
Sorry for my absence, I was out of office. I will take a look at it as soon as I can find the time! |
This adds 4 hooks that can be set on the `JPlagOptions` class: - A pre-parsing stage hook, which is called before all submissions are parsed. It is called with the list with all submission paths eligible for the comparison, i.e. all paths that are not filtered out by `SubmissionSetBuilder.isExcludedEntry`. - A post-parsing hook per submission, which is called after the submission has been parsed. It is called with the `Submission` object that has been parsed. - A pre-comparing stage hook, which is called before the comparisons are started. It is called with a list of all comparison tuples. - A post-comparing hook, which is called after each comparison. It is called with the `SubmissionTuple` that has just been compared.
c8b2379
to
55624bd
Compare
[JPlag Plagiarism Detector] Kudos, SonarCloud Quality Gate passed! |
@tsaglam Have you already had a chance to take a look at this? |
Sorry, I am currently swamped and probably will be until the end of November. |
Thank you for your response and good luck with your work the upcoming month :-) |
@olmokramer
I have implemented a suggestion on how we could handle the hooks in the feature/hooks branch. Please take a look on that an tell me what you think. In particular if it fulfills all your requirements. Right now it is still in a rough state and I only implemented one hook as an example. If you like the idea, I would leave it up to you how we proceed. If you want you can change your implementation (or make a new one), or I could finish my changes on feature/hooks. I am sorry for any inconvenience this might cause you. We do appreciate your work, we are just trying to keep our architecture as clean as possible. |
@TwoOfTwelve thank you for the review! This is exactly the kind of feedback I was looking for :) I agree with the points you brought up and that the current implementation is not necessarily the best for the JPlag architecture. I'm also on a quite tight schedule, so I don't know when I will have time to take a look at your suggested implementation. We are running a build of our fork with this PR, so there's no real rush from our side to get this in. I'd rather get it done in a way that is maintainable and sustainable. I'll try to make some time next week, though, to take a look. Our requirements are not very complex. In particular, we need to be able to
Thanks again for you consideration. |
Superseded by #1433. Let us know if additional requirements come up. |
This adds 4 hooks that can be set on the
JPlagOptions
class:SubmissionSetBuilder.isExcludedEntry
.Submission
object that has been parsed.SubmissionTuple
that has just been compared.The default for each hook is to do nothing.
For some background, we are using JPlag for plagiarism checking and want to be able to track the progress of the plagiarism check (e.g. the percentage of submissions that have already been parsed, or the amount of pairs that have already been compared). With these hooks we can implement that, but simultaneously they might be used for other unforeseen use cases.
Looking forward to feedback on the concept and the implementation.