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.
Files changed (85) hide show
  1. {csim-2.0.0/csim.egg-info → csim-2.0.2}/PKG-INFO +1 -1
  2. {csim-2.0.0 → csim-2.0.2}/csim/utils.py +15 -8
  3. {csim-2.0.0 → csim-2.0.2/csim.egg-info}/PKG-INFO +1 -1
  4. {csim-2.0.0 → csim-2.0.2}/setup.py +1 -1
  5. {csim-2.0.0 → csim-2.0.2}/LICENSE +0 -0
  6. {csim-2.0.0 → csim-2.0.2}/MANIFEST.in +0 -0
  7. {csim-2.0.0 → csim-2.0.2}/README.md +0 -0
  8. {csim-2.0.0 → csim-2.0.2}/csim/CodeSimilarity.py +0 -0
  9. {csim-2.0.0 → csim-2.0.2}/csim/DataStructures.py +0 -0
  10. {csim-2.0.0 → csim-2.0.2}/csim/Visitors.py +0 -0
  11. {csim-2.0.0 → csim-2.0.2}/csim/__init__.py +0 -0
  12. {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/CodeSimilarity.cpython-314.pyc +0 -0
  13. {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/DataStructures.cpython-314.pyc +0 -0
  14. {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/Visitors.cpython-314.pyc +0 -0
  15. {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/__init__.cpython-314.pyc +0 -0
  16. {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/main.cpython-314.pyc +0 -0
  17. {csim-2.0.0 → csim-2.0.2}/csim/__pycache__/utils.cpython-314.pyc +0 -0
  18. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Lexer.interp +0 -0
  19. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Lexer.py +0 -0
  20. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Lexer.tokens +0 -0
  21. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Parser.interp +0 -0
  22. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Parser.py +0 -0
  23. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14Parser.tokens +0 -0
  24. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14ParserBase.py +0 -0
  25. {csim-2.0.0 → csim-2.0.2}/csim/cpp/CPP14ParserVisitor.py +0 -0
  26. {csim-2.0.0 → csim-2.0.2}/csim/cpp/__init__.py +0 -0
  27. {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14Lexer.cpython-314.pyc +0 -0
  28. {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14Parser.cpython-314.pyc +0 -0
  29. {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14ParserBase.cpython-314.pyc +0 -0
  30. {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/CPP14ParserVisitor.cpython-314.pyc +0 -0
  31. {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/__init__.cpython-314.pyc +0 -0
  32. {csim-2.0.0 → csim-2.0.2}/csim/cpp/__pycache__/utils.cpython-314.pyc +0 -0
  33. {csim-2.0.0 → csim-2.0.2}/csim/cpp/transformGrammar.py +0 -0
  34. {csim-2.0.0 → csim-2.0.2}/csim/cpp/utils.py +0 -0
  35. {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Lexer.interp +0 -0
  36. {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Lexer.py +0 -0
  37. {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Lexer.tokens +0 -0
  38. {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Parser.interp +0 -0
  39. {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Parser.py +0 -0
  40. {csim-2.0.0 → csim-2.0.2}/csim/java/Java20Parser.tokens +0 -0
  41. {csim-2.0.0 → csim-2.0.2}/csim/java/Java20ParserVisitor.py +0 -0
  42. {csim-2.0.0 → csim-2.0.2}/csim/java/__init__.py +0 -0
  43. {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/Java20Lexer.cpython-314.pyc +0 -0
  44. {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/Java20Parser.cpython-314.pyc +0 -0
  45. {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/Java20ParserVisitor.cpython-314.pyc +0 -0
  46. {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/__init__.cpython-314.pyc +0 -0
  47. {csim-2.0.0 → csim-2.0.2}/csim/java/__pycache__/utils.cpython-314.pyc +0 -0
  48. {csim-2.0.0 → csim-2.0.2}/csim/java/utils.py +0 -0
  49. {csim-2.0.0 → csim-2.0.2}/csim/language/__init__.py +0 -0
  50. {csim-2.0.0 → csim-2.0.2}/csim/language/__pycache__/__init__.cpython-314.pyc +0 -0
  51. {csim-2.0.0 → csim-2.0.2}/csim/language/__pycache__/lexer.cpython-314.pyc +0 -0
  52. {csim-2.0.0 → csim-2.0.2}/csim/language/__pycache__/parser.cpython-314.pyc +0 -0
  53. {csim-2.0.0 → csim-2.0.2}/csim/language/lexer.py +0 -0
  54. {csim-2.0.0 → csim-2.0.2}/csim/language/parser.py +0 -0
  55. {csim-2.0.0 → csim-2.0.2}/csim/main.py +0 -0
  56. {csim-2.0.0 → csim-2.0.2}/csim/processing/__init__.py +0 -0
  57. {csim-2.0.0 → csim-2.0.2}/csim/processing/__pycache__/__init__.cpython-314.pyc +0 -0
  58. {csim-2.0.0 → csim-2.0.2}/csim/processing/__pycache__/distance_metrics.cpython-314.pyc +0 -0
  59. {csim-2.0.0 → csim-2.0.2}/csim/processing/__pycache__/tree_processing.cpython-314.pyc +0 -0
  60. {csim-2.0.0 → csim-2.0.2}/csim/processing/distance_metrics.py +0 -0
  61. {csim-2.0.0 → csim-2.0.2}/csim/processing/tree_processing.py +0 -0
  62. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexer.interp +0 -0
  63. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexer.py +0 -0
  64. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexer.tokens +0 -0
  65. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonLexerBase.py +0 -0
  66. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParser.interp +0 -0
  67. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParser.py +0 -0
  68. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParser.tokens +0 -0
  69. {csim-2.0.0 → csim-2.0.2}/csim/python/PythonParserVisitor.py +0 -0
  70. {csim-2.0.0 → csim-2.0.2}/csim/python/__init__.py +0 -0
  71. {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonLexer.cpython-314.pyc +0 -0
  72. {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonLexerBase.cpython-314.pyc +0 -0
  73. {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonParser.cpython-314.pyc +0 -0
  74. {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/PythonParserVisitor.cpython-314.pyc +0 -0
  75. {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/__init__.cpython-314.pyc +0 -0
  76. {csim-2.0.0 → csim-2.0.2}/csim/python/__pycache__/utils.cpython-314.pyc +0 -0
  77. {csim-2.0.0 → csim-2.0.2}/csim/python/utils.py +0 -0
  78. {csim-2.0.0 → csim-2.0.2}/csim.egg-info/SOURCES.txt +0 -0
  79. {csim-2.0.0 → csim-2.0.2}/csim.egg-info/dependency_links.txt +0 -0
  80. {csim-2.0.0 → csim-2.0.2}/csim.egg-info/entry_points.txt +0 -0
  81. {csim-2.0.0 → csim-2.0.2}/csim.egg-info/requires.txt +0 -0
  82. {csim-2.0.0 → csim-2.0.2}/csim.egg-info/top_level.txt +0 -0
  83. {csim-2.0.0 → csim-2.0.2}/setup.cfg +0 -0
  84. {csim-2.0.0 → csim-2.0.2}/test/test_cli.py +0 -0
  85. {csim-2.0.0 → csim-2.0.2}/test/test_module.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csim
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Code Similarity (csim) is a method designed to detect similarity between source codes
5
5
  Home-page: https://github.com/EdsonEddy/csim
6
6
  Author: Eddy Lecoña
@@ -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
- unique_files = []
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
- unique_files.append(file_names[file_group[0]])
236
+ unique_groups.append(file_names[file_group[0]])
233
237
 
234
- if unique_files:
238
+ if unique_groups:
235
239
  result.append(f"Unique Files (similarity below threshold):")
236
- for file in unique_files:
240
+ for file in unique_groups:
237
241
  result.append(file)
238
242
 
239
- return "\n".join(result)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csim
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Code Similarity (csim) is a method designed to detect similarity between source codes
5
5
  Home-page: https://github.com/EdsonEddy/csim
6
6
  Author: Eddy Lecoña
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="csim",
5
- version="2.0.0",
5
+ version="2.0.2",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "antlr4-python3-runtime==4.13.2",
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