自然语言处理库不同语言源代码的预处理

sourc的Python项目详细描述


灵魂

https://img.shields.io/pypi/v/sourcy.svghttps://img.shields.io/travis/SasCezar/sourcy.svgDocumentation Status

一个库,用于对不同编程语言的源代码进行类似NLP的预处理。 架构遵循spaCy中的一个。在

特点

  • 基于语法的分析
  • 多语言支持

用法

要在项目中使用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)

学分

此包是用Cookiecutteraudreyr/cookiecutter-pypackage项目模板创建的。在

历史

  • PyPI的第一个版本。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何获取所有链接并使用SeleniumWebDriver逐个单击这些链接   java中数组列表的arraylist移位元素   java如何存储具有不同类型参数的元素   java不能使用List<Future<?>>当从不同位置调用时,在方法参数中   java我应该如何修复代码以避免测试代码出错?   安卓 PreferenceFragment java。lang.RuntimeException   java在运行emulator时发现错误   java取消多个AsyncTask回调的有效方法是什么?如果中途满足条件,这些回调将在将来返回?   有没有办法在运行时将方法动态分配给Java类?   java如何将propertyfile与GlassFish一起使用   如何在PHP中使用bcrypt对密码进行哈希处理?   Java和UDP web服务器   java JPA允许EntityListeners执行JPA操作吗?   java执行do while语句时不会产生错误   java无法在edittext中显示数据库中的数据   java Tomcat中活动会话的数量   java在何处使用@SuppressWarnings(“requestfactory”)   netty连接中的java HornetQ异常