11 Star 37 Fork 10

Gitee 极速下载 / pkuseg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/lancopku/PKUSeg-python
克隆/下载
setup.py 1.82 KB
一键复制 编辑 原始数据 按行查看 历史
luoruixuan 提交于 2020-06-21 16:52 . fix cython import
import setuptools
import os
from distutils.extension import Extension
import numpy as np
def is_source_release(path):
return os.path.exists(os.path.join(path, "PKG-INFO"))
def setup_package():
root = os.path.abspath(os.path.dirname(__file__))
long_description = "pkuseg-python"
extensions = [
Extension(
"pkuseg.inference",
["pkuseg/inference.pyx"],
include_dirs=[np.get_include()],
language="c++"
),
Extension(
"pkuseg.feature_extractor",
["pkuseg/feature_extractor.pyx"],
include_dirs=[np.get_include()],
),
Extension(
"pkuseg.postag.feature_extractor",
["pkuseg/postag/feature_extractor.pyx"],
include_dirs=[np.get_include()],
),
]
if not is_source_release(root):
from Cython.Build import cythonize
extensions = cythonize(extensions, annotate=True)
setuptools.setup(
name="pkuseg",
version="0.0.25",
author="Lanco",
author_email="luoruixuan97@pku.edu.cn",
description="A small package for Chinese word segmentation",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/lancopku/pkuseg-python",
packages=setuptools.find_packages(),
package_data={"": ["*.txt*", "*.pkl", "*.npz", "*.pyx", "*.pxd"]},
classifiers=[
"Programming Language :: Python :: 3",
"License :: Other/Proprietary License",
"Operating System :: OS Independent",
],
install_requires=["cython", "numpy>=1.16.0"],
setup_requires=["cython", "numpy>=1.16.0"],
ext_modules=extensions,
zip_safe=False,
)
if __name__ == "__main__":
setup_package()
Python
1
https://gitee.com/mirrors/pkuseg.git
git@gitee.com:mirrors/pkuseg.git
mirrors
pkuseg
pkuseg
master

搜索帮助