自然语言处理库不同语言源代码的预处理
sourc的Python项目详细描述
灵魂
一个库,用于对不同编程语言的源代码进行类似NLP的预处理。 架构遵循spaCy中的一个。在
- 自由软件:GNU通用公共许可证v3
- 文档:https://sourcy.readthedocs.io。在
特点
- 基于语法的分析
- 多语言支持
用法
要在项目中使用sourCy:
importsourcycode=""" # This function computes the factor of the argument passed def print_factors(x): print("The factors of",x,"are:") for i in range(1, x + 1): if x % i == 0: print(i) num = 320 print_factors(num) """# Creates a pipeline to process source codescp=sourcy.load("python")# Process the code and create a document with the tokens and the annotationdoc=scp(code)fortokenindoc:print(token.token,token.annotation,token.block)
学分
此包是用Cookiecutter和audreyr/cookiecutter-pypackage项目模板创建的。在
历史
- PyPI的第一个版本。在
- 项目
标签: