11# Usage
22
3- plagcheck provides the following classes:
3+ plagcheck provides the following classes & methods :
44
55### check(files, lang, user_id)
66
@@ -16,29 +16,33 @@ plagcheck provides the following classes:
1616""" Usage example"""
1717import os
1818import pprint
19- from plagcheck import plagcheck
19+ from plagcheck.plagcheck import check, insights, share_scores
2020
2121from dotenv import load_dotenv
2222load_dotenv()
2323
24- language = " python "
24+ language = " java "
2525userid = os.environ[" USER_ID" ]
2626
2727
28- moss = plagcheck. check(language, userid)
28+ moss = check(language, userid)
2929
30- moss.addFilesByWildCard(" testfiles/test_python*.py " )
30+ moss.addFilesByWildCard(" testfiles/test_java*.java " )
3131
3232# or moss.addFile("testfiles/test_python.py")
3333
3434moss.submit()
3535
3636print (moss.getHomePage())
37- pprint.pprint(moss.getResults())
38- # print frequency of each shared solution
39- pprint.pprint(moss.getShareScores())
37+
38+ result = moss.getResults()
39+
40+ pprint.pprint(result)
41+
4042# print potential distributor-culprit relationships
41- pprint.pprint(moss.getInsights())
43+ pprint.pprint(insights(result))
44+ # print frequency of each shared solution
45+ pprint.pprint(share_scores(result))
4246
4347```
4448
@@ -72,18 +76,6 @@ c.getHomePage()
7276``` python
7377
7478c.getResults()
75- """
76- [
77- {
78- "file1":"filename1.py",
79- "file2":"filename2.py",
80- "percentage": 34,
81- "no_of_lines_matched": 3,
82- "lines_matched":[["2-3", "10-11"]]
83- },
84- ....
85- ]
86- """
8779
8880```
8981
@@ -162,14 +154,16 @@ program code that also appears in the base file is not counted in matches.
162154code for an assignment. Multiple Base files are allowed.
163155- You should use a base file if it is convenient; base files improve results, but are not usually necessary for obtaining useful information.
164156
165- ### 7. getShareScores()
166- ** Parameters** : ` None ` <br >
157+ <hr >
158+
159+ ### share_scores()
160+ ** Parameters** : ` Moss Results ` (returned by ` getResults() ` ) <br >
167161** Return Type** : ` Dict ` <br >
168162** Description** : Share Score is a utility which returns frequency of every individual file.<br >
169163** Demo** :
170164``` python
171165
172- c.getShareScores( )
166+ print (share_scores(moss_data) )
173167
174168# Will return
175169"""
@@ -179,4 +173,15 @@ c.getShareScores()
179173"""
180174```
181175Share Score is basically the frequency of each file appearing in Moss Results.
182- i.e Higher the frequency, the more is that solution "shared" by different files.
176+ i.e Higher the frequency, the more is that solution "shared" by different files.
177+
178+ ### insights()
179+ ** Parameters** : ` Moss Results ` (returned by ` getResults() ` ) <br >
180+ ** Return Type** : ` Dict ` <br >
181+ ** Description** : See [ Insights] ( /insights ) .<br >
182+ ** Demo** :
183+ ``` python
184+
185+ print (insights(moss_data))
186+
187+ ```
0 commit comments