Browse Source

Merge pull request #714 from jplag/fix-API-example

Update README.md
Timur Sağlam 4 years ago
parent
commit
7669c5b7f0
1 changed files with 5 additions and 7 deletions
  1. 5 7
      README.md

+ 5 - 7
README.md

@@ -102,19 +102,17 @@ Clustering:
 The new API makes it easy to integrate JPlag's plagiarism detection into external Java projects:
 The new API makes it easy to integrate JPlag's plagiarism detection into external Java projects:
 
 
 ```java
 ```java
-Language language = LanguageLoader.getLanguage(Language.IDENTIFIER).orElseThrow();
-JPlagOptions options = new JPlagOptions(language, List.of("/path/to/rootDir"), List.of()).withBaseCodeSubmissionPath("template");
+Language language = new de.jplag.java.Language();
+Set<File> submissionDirectories = Set.of(new File("/path/to/rootDir"));
+File baseCode = new File("/path/to/baseCode");
+JPlagOptions options = new JPlagOptions(language, submissionDirectories, Set.of()).withBaseCodeSubmissionDirectory(baseCode);
 
 
 JPlag jplag = new JPlag(options);
 JPlag jplag = new JPlag(options);
-JPlagResult result = jplag.run();
-
-List<JPlagComparison> comparisons = result.getComparisons();
+JPlagResult result = jplag.run(); // Exception handling required here
 
 
 // Optional
 // Optional
 ReportObjectFactory reportObjectFactory = new ReportObjectFactory();
 ReportObjectFactory reportObjectFactory = new ReportObjectFactory();
 reportObjectFactory.createAndSaveReport(result, "/path/to/output");
 reportObjectFactory.createAndSaveReport(result, "/path/to/output");
-
-report.writeResult(result);
 ```
 ```
 
 
 ## Contributing
 ## Contributing