summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 199f4f329cd391f8445fd009111b4bb7d2854cb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: taotieren <cadmin@taotieren.com>

pkgname=python-pycorrector-git
pkgver=0.4.8.r12.g9069caa
pkgrel=1
pkgdesc='pycorrector is a toolkit for text error correction. 文本纠错,Kenlm,ConvSeq2Seq,BERT,MacBERT,ELECTRA,ERNIE,Transformer,T5等模型实现,开箱即用。 '
url='https://github.com/shibing624/pycorrector'
license=('Apache-2.0')
arch=(any)
_pydeps=(jieba
        numpy
        six
        loguru)
depends=(python
        pypinyin
#         kenlm
         "${_pydeps[@]/#/python-}")
checkdepends=(python-pytest)
makedepends=(git
            python-{build,installer}
             python-setuptools
             python-wheel)
optdepends=('kenlm: Faster and Smaller Language Model Queries')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

pkgver() {
    cd "$pkgname"
    git describe --long --tags | sed 's/v//g;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "$pkgname"
    python -m build -wn
}

# check() {
#     cd "$pkgname"
#     PYTHONPATH=lib pytest tests
# }

package() {
    cd "$pkgname"
    python -m installer -d "$pkgdir" dist/*.whl
}