Convert to Comparable<T>

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Refactored Submission to use lambdas. Bump version.

Lambdas make the code a bit shorter without significantly compromising readability.
Overall a win.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Refactored FileSplitters to use functional Java 8 interfaces.

Added dependency on Apache Commons lang library to enable this refactoring.

Added tests for FileLineSplitter and FileCharSplitter.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Fixed many warnings in build.

Fixed Maven build as UTF-8 encoding, which removes a Maven warning and makes us truly
platform-independent.

Fix many generic-related warnings throughout the codebase, including many in the
Smith-Waterman algorithm - mostly caused by declaring variables or returns without
a generic.

Converted TokenListCloner to use Java 8, and added tests for it.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Substantial refactor of algorithm running code for improved speed

The earlier, naive SimilarityMatrix "fill the entire matrix" approach
was abandoned in favor of generating all valid pairs of 2 submissions,
and running a given algorithm on these pairs. The similarity matrix is
then generated from the results of this.

This is an improvement from O(S^2) to O(S!) where S is the number of
submissions being analyzed.

Small speed optimizations were made to SmithWaterman and TwoDimIntArray
as well. SmithWaterman makes fewer calls to create coordinates, and
uses a new method in TwoDimIntArray for finding the max of
predecessors, which uses a more efficient algorithm and removes the need
for an expensive list creation.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Small fix to the similarity matrix printer. Reorder operations in ChecksimRunner.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Fix to LineSimilarityChecker, previously was nonfunctional.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Refactored LineSimilarityChecker to remove code duplication

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Move file-related utility classes into edu.wpi.checksims.util.file

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Major optimizations to Smith-Waterman algorithm. Major bugfix in TokenListCloner

TokenListCloner, when it was refactored for Java 8, lost the ability to retain
the validity of a token across a clone, which caused nontermination of the
Smith-Waterman algorithm in any case with two matches of more than 5 tokens.

The Smith-Waterman algorithm and associated TwoDimIntArray have been
substantially refactored to optimize speed. The core loop of Smith-Waterman,
in particular, was profiled and optimized extensively (in particular, removing
redundant calls and replacing the sorting algorithm for predecessors).

On my system, 45 submissions of 600 tokens average are processed in 1m4s. This
should be more than fast enough for typical use.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Add result printer that only prints results over a certain threshold. Bump version.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Added ability to traverse subdirectories when creating a submission. Bump minor version.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Added assembly:single to Maven package goal

Project now produces jar with dependencies by default

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Add notion of a Submission Preprocessor, to mutate submissions before applying plagiarism detection.

Intended uses include removing given code which would be present in all assignments, or
applying simple preprocessing to tokens (e.g. lowercasing all letters).

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Added two preprocessors (Lower casing submissions for character and string tokens)

Also add test cases for PreprocessSubmissions.

Small change to equals() for Submissions, now checks token lists as well.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Added Javadoc comments and fixed warnings in ChecksimRunner and Submission

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Changes to Maven project to produce executable jar without dependencies

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Ensure all submissions processed are unique

Done without using Java Sets as the interface is too limiting in many cases.
Instead, add invariant that only unique elements are added to the list.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Simplify hashCode in Submission

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Smplify PreprocessSubmissions

Make tests accurate even if preprocessed submissions list has different element
ordering than original.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>