csim 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {csim-2.0.0/csim.egg-info → csim-2.0.2}/PKG-INFO +1 -1
- {csim-2.0.0 → csim-2.0.2}/csim/utils.py +15 -8
- {csim-2.0.0 → csim-2.0.2/csim.egg-info}/PKG-INFO +1 -1
- {csim-2.0.0 → csim-2.0.2}/setup.py +1 -1
- {csim-2.0.0 → csim-2.0.2}/LICENSE +0 -0
- {csim-2.0.0 → csim-2.0.2}/MANIFEST.in +0 -0
- {csim-2.0.0 → csim-2.0.2}/README.md +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/CodeSimilarity.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/DataStructures.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/Visitors.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/__init__.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/CodeSimilarity.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/DataStructures.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/Visitors.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/__init__.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/main.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/utils.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Lexer.interp +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Lexer.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Lexer.tokens +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Parser.interp +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Parser.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Parser.tokens +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14ParserBase.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14ParserVisitor.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/__init__.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14Lexer.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14Parser.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14ParserBase.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14ParserVisitor.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/__init__.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/utils.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/transformGrammar.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/cpp/utils.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Lexer.interp +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Lexer.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Lexer.tokens +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Parser.interp +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Parser.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Parser.tokens +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/Java20ParserVisitor.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/__init__.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/Java20Lexer.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/Java20Parser.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/Java20ParserVisitor.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/__init__.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/utils.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/java/utils.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/language/__init__.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/language/__pycache__/__init__.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/language/__pycache__/lexer.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/language/__pycache__/parser.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/language/lexer.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/language/parser.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/main.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/processing/__init__.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/processing/__pycache__/__init__.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/processing/__pycache__/distance_metrics.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/processing/__pycache__/tree_processing.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/processing/distance_metrics.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/processing/tree_processing.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexer.interp +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexer.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexer.tokens +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexerBase.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParser.interp +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParser.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParser.tokens +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParserVisitor.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/__init__.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonLexer.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonLexerBase.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonParser.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonParserVisitor.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/__init__.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/utils.cpython-314.pyc +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim/python/utils.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim.egg-info/SOURCES.txt +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim.egg-info/dependency_links.txt +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim.egg-info/entry_points.txt +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim.egg-info/requires.txt +0 -0
- {csim-2.0.0 → csim-2.0.2}/csim.egg-info/top_level.txt +0 -0
- {csim-2.0.0 → csim-2.0.2}/setup.cfg +0 -0
- {csim-2.0.0 → csim-2.0.2}/test/test_cli.py +0 -0
- {csim-2.0.0 → csim-2.0.2}/test/test_module.py +0 -0
|
@@ -210,9 +210,11 @@ def report_pairwise_similarity(file_names, file_contents, lang, ted_algorithm):
|
|
|
210
210
|
return "\n".join(results)
|
|
211
211
|
|
|
212
212
|
|
|
213
|
-
def get_output_by_group(file_names, groups, similarity_indices, threshold):
|
|
213
|
+
def get_output_by_group(file_names, groups, similarity_indices, threshold, printable_output=True):
|
|
214
214
|
result = []
|
|
215
|
-
|
|
215
|
+
similarity_groups = []
|
|
216
|
+
similarity_groups_avg = []
|
|
217
|
+
unique_groups = []
|
|
216
218
|
|
|
217
219
|
result.append(f"Threshold: {threshold}")
|
|
218
220
|
result.append(f"Total files processed: {len(file_names)}")
|
|
@@ -228,19 +230,24 @@ def get_output_by_group(file_names, groups, similarity_indices, threshold):
|
|
|
228
230
|
)
|
|
229
231
|
result.extend([file_names[file] for file in file_group])
|
|
230
232
|
groups_cnt += 1
|
|
233
|
+
similarity_groups_avg.append(avg_similarity)
|
|
234
|
+
similarity_groups.append([file_names[file] for file in file_group])
|
|
231
235
|
else:
|
|
232
|
-
|
|
236
|
+
unique_groups.append(file_names[file_group[0]])
|
|
233
237
|
|
|
234
|
-
if
|
|
238
|
+
if unique_groups:
|
|
235
239
|
result.append(f"Unique Files (similarity below threshold):")
|
|
236
|
-
for file in
|
|
240
|
+
for file in unique_groups:
|
|
237
241
|
result.append(file)
|
|
238
242
|
|
|
239
|
-
|
|
243
|
+
if printable_output:
|
|
244
|
+
return "\n".join(result)
|
|
245
|
+
|
|
246
|
+
return similarity_groups, similarity_groups_avg, unique_groups
|
|
240
247
|
|
|
241
248
|
|
|
242
249
|
def group_by_exhaustive_search(
|
|
243
|
-
file_names, file_contents, lang, threshold, ted_algorithm
|
|
250
|
+
file_names, file_contents, lang, threshold, ted_algorithm, printable_output=True
|
|
244
251
|
):
|
|
245
252
|
|
|
246
253
|
file_number = len(file_names)
|
|
@@ -274,4 +281,4 @@ def group_by_exhaustive_search(
|
|
|
274
281
|
|
|
275
282
|
groups = list(groups.values())
|
|
276
283
|
|
|
277
|
-
return get_output_by_group(file_names, groups, similarity_indices, threshold)
|
|
284
|
+
return get_output_by_group(file_names, groups, similarity_indices, threshold, printable_output)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|