PyReprism 0.0.1__tar.gz → 0.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.
- {pyreprism-0.0.1 → pyreprism-0.0.2}/PKG-INFO +28 -4
- pyreprism-0.0.2/README.md +71 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/pyproject.toml +1 -1
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/python.py +2 -3
- pyreprism-0.0.2/src/PyReprism/utils/extension.py +149 -0
- pyreprism-0.0.1/README.md +0 -47
- pyreprism-0.0.1/src/PyReprism/utils/extension.py +0 -149
- {pyreprism-0.0.1 → pyreprism-0.0.2}/.flake8 +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/.gitignore +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/.readthedocs.yaml +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/LICENSE +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/pytest.ini +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/requirements.txt +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/__init__.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/__init__.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/_base.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/abap.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/actionscript.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/ada.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/apacheconf.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/apl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/applescript.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/arduino.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/arff.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/asciidoc.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/asm6502.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/aspnet.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/autohotkey.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/autoit.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/bash.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/basic.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/batch.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/bison.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/brainfuck.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/bro.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/c.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/clike.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/clojure.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/coffeescript.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/cpp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/crystal.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/csharp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/csp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/css.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/css_extras.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/d.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/dart.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/diff.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/django.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/docker.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/eiffel.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/elixir.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/erb.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/erlang.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/flow.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/fortran.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/fsharp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/gedcom.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/gherkin.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/git.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/glsl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/go.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/graphql.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/groovy.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/haml.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/handlebars.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/haskell.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/haxe.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/hpkp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/hsts.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/html.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/ichigojam.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/icon.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/inform7.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/ini.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/io.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/j.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/java.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/javascript.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/jolie.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/json.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/jsx.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/julia.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/keyman.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/kotlin.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/latex.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/less.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/liquid.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/livescript.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/lolcode.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/lua.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/makefile.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/markdown.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/markup.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/markup_templating.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/matlab.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/mel.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/mizar.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/monkey.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/n4js.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/nasm.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/nginx.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/nim.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/nix.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/nsis.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/objectivec.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/ocaml.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/opencl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/oz.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/parigp.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/parser.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/pascal.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/perl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/php.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/php_extras.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/plsql.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/powershell.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/processing.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/prolog.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/properties.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/protobuf.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/pug.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/puppet.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/pure.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/q.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/qore.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/r.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/reason.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/renpy.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/rest.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/rip.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/roboconf.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/ruby.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/rust.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/sas.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/sass.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/scala.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/scheme.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/scss.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/smalltalk.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/smarty.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/soy.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/stylus.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/swift.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/tcl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/textile.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/tsx.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/twig.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/typescript.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/vbnet.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/velocity.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/verilog.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/vhdl.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/vim.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/visual_basic.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/wasam.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/xeora.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/xojo.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/languages/yaml.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/utils/__init__.py +0 -0
- {pyreprism-0.0.1 → pyreprism-0.0.2}/src/PyReprism/utils/normalizer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: PyReprism
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Framework for Source Code Preprocessing
|
|
5
5
|
Project-URL: Homepage, https://github.com/unlv-evol/PyReprism
|
|
6
6
|
Project-URL: Issues, https://github.com/unlv-evol/PyReprism/issues
|
|
@@ -46,7 +46,7 @@ Requires-Dist: pytest-cov; extra == 'dev'
|
|
|
46
46
|
Description-Content-Type: text/markdown
|
|
47
47
|
|
|
48
48
|
[](https://opensource.org/licenses/MIT)
|
|
49
|
-
|
|
49
|
+

|
|
50
50
|
# PyReprism
|
|
51
51
|
|
|
52
52
|
PyReprism is a suite of essential methods designed for common preprocessing tasks in code clone detection research.
|
|
@@ -56,10 +56,28 @@ PyReprism is a suite of essential methods designed for common preprocessing task
|
|
|
56
56
|
pip install PyReprism
|
|
57
57
|
```
|
|
58
58
|
## Quick Usage
|
|
59
|
+
Use case 1: Removing comments
|
|
59
60
|
```python
|
|
60
61
|
|
|
61
62
|
from PyReprism.languages import Python
|
|
63
|
+
# from PyReprism.languages import Java
|
|
64
|
+
|
|
65
|
+
source = """
|
|
66
|
+
# single line comment
|
|
67
|
+
x = 5 + 6
|
|
68
|
+
'''
|
|
69
|
+
multiline
|
|
70
|
+
comment
|
|
71
|
+
'''
|
|
72
|
+
print(x)
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
source = Python.remove_comments(source)
|
|
76
|
+
```
|
|
62
77
|
|
|
78
|
+
Use case 2: Removing whitespaces
|
|
79
|
+
```python
|
|
80
|
+
from PyReprism.utils.normalizer import Normalizer
|
|
63
81
|
source = """
|
|
64
82
|
# single line comment
|
|
65
83
|
x = 5 + 6
|
|
@@ -70,11 +88,15 @@ comment
|
|
|
70
88
|
print(x)
|
|
71
89
|
"""
|
|
72
90
|
|
|
73
|
-
source =
|
|
91
|
+
source = Normalizer.remove_whitespaces(source)
|
|
74
92
|
```
|
|
75
|
-
|
|
93
|
+
|
|
94
|
+
Read the [docs]() for more usage examples. -- Coming soon!!
|
|
95
|
+
|
|
96
|
+
NB: The beta versions of PyReprism is still highly unstable, we are working 24/7 to ensure the tool is usable.
|
|
76
97
|
|
|
77
98
|
## How to Contribute
|
|
99
|
+
We invite you to help us build this tool and make it more extensive. Contribution is open to OSS community.
|
|
78
100
|
|
|
79
101
|
```shell
|
|
80
102
|
git clone https://github.com/unlv-evol/PyReprism.git
|
|
@@ -92,3 +114,5 @@ Then, install the requirements:
|
|
|
92
114
|
```
|
|
93
115
|
pip install -r requirements.txt
|
|
94
116
|
```
|
|
117
|
+
## Issues
|
|
118
|
+
If you experience any issue, feel free to report it here. We are developing the issue reporting guidelines which will be available soon.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[](https://opensource.org/licenses/MIT)
|
|
2
|
+

|
|
3
|
+
# PyReprism
|
|
4
|
+
|
|
5
|
+
PyReprism is a suite of essential methods designed for common preprocessing tasks in code clone detection research.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
```shell
|
|
9
|
+
pip install PyReprism
|
|
10
|
+
```
|
|
11
|
+
## Quick Usage
|
|
12
|
+
Use case 1: Removing comments
|
|
13
|
+
```python
|
|
14
|
+
|
|
15
|
+
from PyReprism.languages import Python
|
|
16
|
+
# from PyReprism.languages import Java
|
|
17
|
+
|
|
18
|
+
source = """
|
|
19
|
+
# single line comment
|
|
20
|
+
x = 5 + 6
|
|
21
|
+
'''
|
|
22
|
+
multiline
|
|
23
|
+
comment
|
|
24
|
+
'''
|
|
25
|
+
print(x)
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
source = Python.remove_comments(source)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Use case 2: Removing whitespaces
|
|
32
|
+
```python
|
|
33
|
+
from PyReprism.utils.normalizer import Normalizer
|
|
34
|
+
source = """
|
|
35
|
+
# single line comment
|
|
36
|
+
x = 5 + 6
|
|
37
|
+
'''
|
|
38
|
+
multiline
|
|
39
|
+
comment
|
|
40
|
+
'''
|
|
41
|
+
print(x)
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
source = Normalizer.remove_whitespaces(source)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Read the [docs]() for more usage examples. -- Coming soon!!
|
|
48
|
+
|
|
49
|
+
NB: The beta versions of PyReprism is still highly unstable, we are working 24/7 to ensure the tool is usable.
|
|
50
|
+
|
|
51
|
+
## How to Contribute
|
|
52
|
+
We invite you to help us build this tool and make it more extensive. Contribution is open to OSS community.
|
|
53
|
+
|
|
54
|
+
```shell
|
|
55
|
+
git clone https://github.com/unlv-evol/PyReprism.git
|
|
56
|
+
cd PyReprism
|
|
57
|
+
```
|
|
58
|
+
**(Optional)** It is suggested to make use of virtualenv. Therefore, before installing the requirements run:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
python3 -m venv venv
|
|
62
|
+
source venv/bin/activate
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then, install the requirements:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
pip install -r requirements.txt
|
|
69
|
+
```
|
|
70
|
+
## Issues
|
|
71
|
+
If you experience any issue, feel free to report it here. We are developing the issue reporting guidelines which will be available soon.
|
|
@@ -17,9 +17,8 @@ class Python:
|
|
|
17
17
|
|
|
18
18
|
@staticmethod
|
|
19
19
|
def comment_regex():
|
|
20
|
-
|
|
21
|
-
# pattern = re.compile(r'(?P<comment
|
|
22
|
-
pattern = re.compile(r'(?P<comment>#.*?$)|(?P<noncomment>\'(\\.|[^\\\'])*\'|"(\\.|[^\\"])*"|[^#\'"]+)',re.DOTALL | re.MULTILINE)
|
|
20
|
+
pattern = re.compile(r'(?P<comment>#.*?$)|'r'(?P<multilinecomment1>""".*?""")|'r'(?P<multilinecomment2>\'\'\'.*?\'\'\')|'r'(?P<noncomment>\'(\\.|[^\\\'])*\'|"(\\.|[^\\"])*"|.[^#\'"]*)',re.DOTALL | re.MULTILINE)
|
|
21
|
+
# pattern = re.compile(r'(?P<comment>#.*?$)|(?P<noncomment>\'(\\.|[^\\\'])*\'|"(\\.|[^\\"])*"|[^#\'"]+)',re.DOTALL | re.MULTILINE)
|
|
23
22
|
return pattern
|
|
24
23
|
|
|
25
24
|
@staticmethod
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
abap: str = ".abap"
|
|
2
|
+
actionscript: str = ".as"
|
|
3
|
+
ada: str = ".ada"
|
|
4
|
+
apacheconf: str = ".conf"
|
|
5
|
+
apl: str = ".apl"
|
|
6
|
+
applescript: str = ".applescript"
|
|
7
|
+
arduino: str = ".ino"
|
|
8
|
+
arff: str = ".arff"
|
|
9
|
+
asciidoc: str = ".adoc"
|
|
10
|
+
asm6502: str = ".asm"
|
|
11
|
+
aspnet: str = ".asp"
|
|
12
|
+
autohotkey: str = ".ahk"
|
|
13
|
+
autoit: str = ".au3"
|
|
14
|
+
bash: str = ".sh"
|
|
15
|
+
basic: str = ".bas"
|
|
16
|
+
batch: str = ".bat"
|
|
17
|
+
bison: str = ".y"
|
|
18
|
+
brainfuck: str = ".bf"
|
|
19
|
+
bro: str = ".bro"
|
|
20
|
+
c: str = ".c"
|
|
21
|
+
clike: str = ".c" # This is generic; specific languages like C or C++ should be used.
|
|
22
|
+
clojure: str = ".clj"
|
|
23
|
+
coffeescript: str = ".coffee"
|
|
24
|
+
cpp: str = ".cpp"
|
|
25
|
+
crystal: str = ".cr"
|
|
26
|
+
csharp: str = ".cs"
|
|
27
|
+
csp: str = ".csp"
|
|
28
|
+
css_extras: str = ".css"
|
|
29
|
+
css: str = ".css"
|
|
30
|
+
d: str = ".d"
|
|
31
|
+
dart: str = ".dart"
|
|
32
|
+
diff: str = ".diff"
|
|
33
|
+
django: str = ".py" # Django typically uses Python files
|
|
34
|
+
docker: str = "Dockerfile"
|
|
35
|
+
eiffel: str = ".e"
|
|
36
|
+
elixir: str = ".ex"
|
|
37
|
+
erb: str = ".erb"
|
|
38
|
+
erlang: str = ".erl"
|
|
39
|
+
flow: str = ".js" # Flow is a static type checker for JavaScript
|
|
40
|
+
fortran: str = ".f90"
|
|
41
|
+
fsharp: str = ".fs"
|
|
42
|
+
gedcom: str = ".ged"
|
|
43
|
+
gherkin: str = ".feature"
|
|
44
|
+
git: str = ".git"
|
|
45
|
+
glsl: str = ".glsl"
|
|
46
|
+
go: str = ".go"
|
|
47
|
+
graphql: str = ".graphql"
|
|
48
|
+
groovy: str = ".groovy"
|
|
49
|
+
haml: str = ".haml"
|
|
50
|
+
handlebars: str = ".hbs"
|
|
51
|
+
haskell: str = ".hs"
|
|
52
|
+
haxe: str = ".hx"
|
|
53
|
+
hpkp: str = ".hpkp"
|
|
54
|
+
hsts: str = ".hsts"
|
|
55
|
+
html: str = ".html"
|
|
56
|
+
http: str = ".http"
|
|
57
|
+
ichigojam: str = ".ijs"
|
|
58
|
+
icon: str = ".icon"
|
|
59
|
+
inform7: str = ".ni"
|
|
60
|
+
ini: str = ".ini"
|
|
61
|
+
io: str = ".io"
|
|
62
|
+
ipynb: str = ".ipynb"
|
|
63
|
+
j: str = ".ijs"
|
|
64
|
+
java: str = ".java"
|
|
65
|
+
javascript: str = ".js"
|
|
66
|
+
jolie: str = ".ol"
|
|
67
|
+
json: str = ".json"
|
|
68
|
+
jsx: str = ".jsx"
|
|
69
|
+
julia: str = ".jl"
|
|
70
|
+
keyman: str = ".kmn"
|
|
71
|
+
kotlin: str = ".kt"
|
|
72
|
+
latex: str = ".tex"
|
|
73
|
+
less: str = ".less"
|
|
74
|
+
liquid: str = ".liquid"
|
|
75
|
+
lisp: str = ".lisp"
|
|
76
|
+
livescript: str = ".ls"
|
|
77
|
+
lolcode: str = ".lol"
|
|
78
|
+
lua: str = ".lua"
|
|
79
|
+
makefile: str = "Makefile"
|
|
80
|
+
markdown: str = ".md"
|
|
81
|
+
markup_templating: str = ".xml"
|
|
82
|
+
markup: str = ".xml"
|
|
83
|
+
matlab: str = ".m"
|
|
84
|
+
mel: str = ".mel"
|
|
85
|
+
mizar: str = ".miz"
|
|
86
|
+
monkey: str = ".monkey"
|
|
87
|
+
n4js: str = ".n4js"
|
|
88
|
+
nasm: str = ".asm"
|
|
89
|
+
nginx: str = ".conf"
|
|
90
|
+
nim: str = ".nim"
|
|
91
|
+
nix: str = ".nix"
|
|
92
|
+
nsis: str = ".nsi"
|
|
93
|
+
objectivec: str = ".m"
|
|
94
|
+
ocaml: str = ".ml"
|
|
95
|
+
opencl: str = ".cl"
|
|
96
|
+
oz: str = ".oz"
|
|
97
|
+
parigp: str = ".gp"
|
|
98
|
+
parser: str = ".parser"
|
|
99
|
+
pascal: str = ".pas"
|
|
100
|
+
perl: str = ".pl"
|
|
101
|
+
php_extras: str = ".php"
|
|
102
|
+
php: str = ".php"
|
|
103
|
+
plsql: str = ".sql"
|
|
104
|
+
powershell: str = ".ps1"
|
|
105
|
+
processing: str = ".pde"
|
|
106
|
+
prolog: str = ".pl"
|
|
107
|
+
properties: str = ".properties"
|
|
108
|
+
protobuf: str = ".proto"
|
|
109
|
+
pug: str = ".pug"
|
|
110
|
+
puppet: str = ".pp"
|
|
111
|
+
pure: str = ".pure"
|
|
112
|
+
python: str = ".py"
|
|
113
|
+
q: str = ".q"
|
|
114
|
+
qore: str = ".q"
|
|
115
|
+
r: str = ".r"
|
|
116
|
+
reason: str = ".re"
|
|
117
|
+
renpy: str = ".rpy"
|
|
118
|
+
rest: str = ".rest"
|
|
119
|
+
rip: str = ".rip"
|
|
120
|
+
roboconf: str = ".graph"
|
|
121
|
+
ruby: str = ".rb"
|
|
122
|
+
rust: str = ".rs"
|
|
123
|
+
sas: str = ".sas"
|
|
124
|
+
sass: str = ".sass"
|
|
125
|
+
scala: str = ".scala"
|
|
126
|
+
scheme: str = ".scm"
|
|
127
|
+
scss: str = ".scss"
|
|
128
|
+
smalltalk: str = ".st"
|
|
129
|
+
smarty: str = ".tpl"
|
|
130
|
+
soy: str = ".soy"
|
|
131
|
+
stylus: str = ".styl"
|
|
132
|
+
swift: str = ".swift"
|
|
133
|
+
tcl: str = ".tcl"
|
|
134
|
+
textile: str = ".textile"
|
|
135
|
+
tsx: str = ".tsx"
|
|
136
|
+
twig: str = ".twig"
|
|
137
|
+
typescript: str = ".ts"
|
|
138
|
+
vbnet: str = ".vb"
|
|
139
|
+
velocity: str = ".vm"
|
|
140
|
+
verilog: str = ".v"
|
|
141
|
+
vhdl: str = ".vhdl"
|
|
142
|
+
vim: str = ".vim"
|
|
143
|
+
visual_basic: str = ".vb"
|
|
144
|
+
wasm: str = ".wasm"
|
|
145
|
+
wiki: str = ".wiki"
|
|
146
|
+
xeora: str = ".xeora"
|
|
147
|
+
xojo: str = ".xojo"
|
|
148
|
+
yaml: str = ".yaml"
|
|
149
|
+
yml: str = ".yml"
|
pyreprism-0.0.1/README.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
[](https://opensource.org/licenses/MIT)
|
|
2
|
-
|
|
3
|
-
# PyReprism
|
|
4
|
-
|
|
5
|
-
PyReprism is a suite of essential methods designed for common preprocessing tasks in code clone detection research.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
```shell
|
|
9
|
-
pip install PyReprism
|
|
10
|
-
```
|
|
11
|
-
## Quick Usage
|
|
12
|
-
```python
|
|
13
|
-
|
|
14
|
-
from PyReprism.languages import Python
|
|
15
|
-
|
|
16
|
-
source = """
|
|
17
|
-
# single line comment
|
|
18
|
-
x = 5 + 6
|
|
19
|
-
'''
|
|
20
|
-
multiline
|
|
21
|
-
comment
|
|
22
|
-
'''
|
|
23
|
-
print(x)
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
source =''.join(Python.remove_comments(source))
|
|
27
|
-
```
|
|
28
|
-
Read the [docs]() for more usage examples.
|
|
29
|
-
|
|
30
|
-
## How to Contribute
|
|
31
|
-
|
|
32
|
-
```shell
|
|
33
|
-
git clone https://github.com/unlv-evol/PyReprism.git
|
|
34
|
-
cd PyReprism
|
|
35
|
-
```
|
|
36
|
-
**(Optional)** It is suggested to make use of virtualenv. Therefore, before installing the requirements run:
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
python3 -m venv venv
|
|
40
|
-
source venv/bin/activate
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Then, install the requirements:
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
pip install -r requirements.txt
|
|
47
|
-
```
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
abap: str = "xxxxx"
|
|
2
|
-
actionscript: str = "xxxxx"
|
|
3
|
-
ada: str = ".ada"
|
|
4
|
-
apacheconf: str = "xxxxx"
|
|
5
|
-
apl: str = "xxxxx"
|
|
6
|
-
applescript: str = "xxxxx"
|
|
7
|
-
arduino: str = "xxxxx"
|
|
8
|
-
arff: str = "xxxxx"
|
|
9
|
-
asciidoc: str = "xxxxx"
|
|
10
|
-
asm6502: str = "xxxxx"
|
|
11
|
-
aspnet: str = ".asp"
|
|
12
|
-
autohotkey: str = "xxxxx"
|
|
13
|
-
autoit: str = "xxxxx"
|
|
14
|
-
bash: str = ".sh"
|
|
15
|
-
basic: str = "xxxxx"
|
|
16
|
-
batch: str = "xxxxx"
|
|
17
|
-
bison: str = "xxxxx"
|
|
18
|
-
brainfuck: str = "xxxxx"
|
|
19
|
-
bro: str = "xxxxx"
|
|
20
|
-
c: str = ".c"
|
|
21
|
-
clike: str = "xxxxx"
|
|
22
|
-
clojure: str = "xxxxx"
|
|
23
|
-
coffeescript: str = "xxxxx"
|
|
24
|
-
cpp: str = ".cpp"
|
|
25
|
-
crystal: str = "xxxxx"
|
|
26
|
-
csharp: str = ".csharp"
|
|
27
|
-
csp: str = "xxxxx"
|
|
28
|
-
css_extras: str = "xxxxx"
|
|
29
|
-
css: str = ".css"
|
|
30
|
-
d: str = "xxxxx"
|
|
31
|
-
dart: str = ".dart"
|
|
32
|
-
diff: str = ".diff"
|
|
33
|
-
django: str = "xxxxx"
|
|
34
|
-
docker: str = "xxxxx"
|
|
35
|
-
eiffel: str = "xxxxx"
|
|
36
|
-
elixir: str = "xxxxx"
|
|
37
|
-
erb: str = "xxxxx"
|
|
38
|
-
erlang: str = "xxxxx"
|
|
39
|
-
flow: str = "xxxxx"
|
|
40
|
-
fortran: str = "xxxxx"
|
|
41
|
-
fsharp: str = "xxxxx"
|
|
42
|
-
gedcom: str = "xxxxx"
|
|
43
|
-
gherkin: str = "xxxxx"
|
|
44
|
-
git: str = ".git"
|
|
45
|
-
glsl: str = "xxxxx"
|
|
46
|
-
go: str = ".go"
|
|
47
|
-
graphql: str = "xxxxx"
|
|
48
|
-
groovy: str = ".groovy"
|
|
49
|
-
haml: str = "xxxxx"
|
|
50
|
-
handlebars: str = "xxxxx"
|
|
51
|
-
haskell: str = "xxxxx"
|
|
52
|
-
haxe: str = "xxxxx"
|
|
53
|
-
hpkp: str = "xxxxx"
|
|
54
|
-
hsts: str = "xxxxx"
|
|
55
|
-
html: str = "xxxxx"
|
|
56
|
-
http: str = "xxxxx"
|
|
57
|
-
ichigojam: str = "xxxxx"
|
|
58
|
-
icon: str = "xxxxx"
|
|
59
|
-
inform7: str = "xxxxx"
|
|
60
|
-
ini: str = ".ini"
|
|
61
|
-
io: str = ".io"
|
|
62
|
-
ipynd: str = ".ipynd"
|
|
63
|
-
j: str = ".j"
|
|
64
|
-
java: str = ".java"
|
|
65
|
-
javascript: str = ".js"
|
|
66
|
-
jolie: str = "xxxxx"
|
|
67
|
-
json: str = ".json"
|
|
68
|
-
jsx: str = ".jsx"
|
|
69
|
-
julia: str = ".julia"
|
|
70
|
-
keyman: str = "xxxxx"
|
|
71
|
-
kotlin: str = ".kt"
|
|
72
|
-
latex: str = "xxxxx"
|
|
73
|
-
less: str = ".less"
|
|
74
|
-
liquid: str = "xxxxx"
|
|
75
|
-
lisp: str = "xxxxx"
|
|
76
|
-
livescript: str = "xxxxx"
|
|
77
|
-
lolcode: str = "xxxxx"
|
|
78
|
-
lua: str = "xxxxx"
|
|
79
|
-
makefile: str = "xxxxx"
|
|
80
|
-
markdown: str = ".md"
|
|
81
|
-
markup_templating: str = "xxxxx"
|
|
82
|
-
markup: str = ".xml"
|
|
83
|
-
matlab: str = "xxxxx"
|
|
84
|
-
mel: str = "xxxxx"
|
|
85
|
-
mizar: str = "xxxxx"
|
|
86
|
-
monkey: str = "xxxxx"
|
|
87
|
-
n4js: str = "xxxxx"
|
|
88
|
-
nasm: str = "xxxxx"
|
|
89
|
-
nginx: str = "xxxxx"
|
|
90
|
-
nim: str = "xxxxx"
|
|
91
|
-
nix: str = "xxxxx"
|
|
92
|
-
nsis: str = "xxxxx"
|
|
93
|
-
objectivec: str = "xxxxx"
|
|
94
|
-
ocaml: str = ".ocaml"
|
|
95
|
-
opencl: str = "xxxxx"
|
|
96
|
-
oz: str = "xxxxx"
|
|
97
|
-
parigp: str = "xxxxx"
|
|
98
|
-
parser: str = "xxxxx"
|
|
99
|
-
pascal: str = "xxxxx"
|
|
100
|
-
perl: str = ".pl"
|
|
101
|
-
php_extras: str = "xxxxx"
|
|
102
|
-
php: str = ".php"
|
|
103
|
-
plsql: str = "xxxxx"
|
|
104
|
-
powershell: str = "xxxxx"
|
|
105
|
-
processing: str = "xxxxx"
|
|
106
|
-
prolog: str = "xxxxx"
|
|
107
|
-
properties: str = ".properties"
|
|
108
|
-
protobuf: str = "xxxxx"
|
|
109
|
-
pug: str = "xxxxx"
|
|
110
|
-
puppet: str = "xxxxx"
|
|
111
|
-
pure: str = "xxxxx"
|
|
112
|
-
python: str = ".py"
|
|
113
|
-
q: str = "xxxxx"
|
|
114
|
-
qore: str = "xxxxx"
|
|
115
|
-
r: str = "xxxxx"
|
|
116
|
-
reason: str = "xxxxx"
|
|
117
|
-
renpy: str = "xxxxx"
|
|
118
|
-
rest: str = "xxxxx"
|
|
119
|
-
rip: str = "xxxxx"
|
|
120
|
-
roboconf: str = "xxxxx"
|
|
121
|
-
ruby: str = ".rb"
|
|
122
|
-
rust: str = ".rs"
|
|
123
|
-
sas: str = ".sas"
|
|
124
|
-
sass: str = ".sass"
|
|
125
|
-
scala: str = ".scala"
|
|
126
|
-
scheme: str = ".rkt"
|
|
127
|
-
scss: str = ".scss"
|
|
128
|
-
smalltalk: str = "xxxxx"
|
|
129
|
-
smarty: str = "xxxxx"
|
|
130
|
-
soy: str = "xxxxx"
|
|
131
|
-
stylus: str = ".stylus"
|
|
132
|
-
swift: str = ".swift"
|
|
133
|
-
tcl: str = "xxxxx"
|
|
134
|
-
textile: str = "xxxxx"
|
|
135
|
-
tsx: str = ".tsx"
|
|
136
|
-
twig: str = "xxxxx"
|
|
137
|
-
typescript: str = ".ts"
|
|
138
|
-
vbnet: str = "xxxxx"
|
|
139
|
-
velocity: str = "xxxxx"
|
|
140
|
-
verilog: str = "xxxxx"
|
|
141
|
-
vhdl: str = "xxxxx"
|
|
142
|
-
vim: str = ".vim"
|
|
143
|
-
visual_basic: str = ".vb"
|
|
144
|
-
wasm: str = "xxxxx"
|
|
145
|
-
wiki: str = "xxxxx"
|
|
146
|
-
xeora: str = "xxxxx"
|
|
147
|
-
xojo: str = "xxxxx"
|
|
148
|
-
yaml: str = ".yaml"
|
|
149
|
-
yml: str = ".yml"
|
|
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
|
|
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
|