diff --git a/archlinuxcn/rime-lmdg/PKGBUILD b/archlinuxcn/rime-lmdg/PKGBUILD index 29a5634f4b2c..f9d01ece24fc 100644 --- a/archlinuxcn/rime-lmdg/PKGBUILD +++ b/archlinuxcn/rime-lmdg/PKGBUILD @@ -1,31 +1,28 @@ # Maintainer: ZeekoZhu pkgbase=rime-lmdg -pkgname=("${pkgbase}-config") -pkgver=3n2 +pkgname=("${pkgbase}" + "${pkgbase}-config") +_release_tag=LTS +pkgver=lts pkgrel=1 -pkgdesc='RIME-LMDG万象语言模型,基于32GB超大规模语料的RIME中文语言模型' +epoch=1 +pkgdesc='万象语言模型,基于32GB超大规模语料的RIME中文语言模型' arch=(any) url="https://github.com/amzxyz/RIME-LMDG" -source=("lmdg.yaml") +source=("lmdg.yaml" + "wanxiang-zh-hans.gram::${url}/releases/download/${_release_tag}/wanxiang-lts-zh-hans.gram") license=('CC-BY-4.0') -sha256sums=('3248db66344b91bc175da4306cb27926abff4aad74b59a8ea20ad85ed6676e10' - 'f50506698265ea5fab415752dbab5d3f0f87815f9d7860a8f044a926348a845f') -optdepends=('librime: Rime Input Method Engine') +sha256sums=('93b605fd11281ae248eed0648629ee23312fc56edd0911aa855bdee7b0c294c4' + 'b8a755d7fdc568a275d2457019cc56086d69138e9f415352976664a8bc835b55') -_variants=(m1) -for _variant in "${_variants[@]}"; do - pkgname+=("${pkgbase}-${_variant}") - - source+=("https://github.com/amzxyz/RIME-LMDG/releases/download/v${pkgver}/amz-v${pkgver}${_variant}-zh-hans.gram") - - eval 'package_rime-lmdg-'"${_variant}"'() { - provides=("'${pkgbase}=${pkgver}'") - pkgdesc="RIME-LMDG万象语言模型(3-gram/'"${_variants#m}"'00M)" - optdepends+=("'${pkgbase}'-config: default patch configurations") - install -Dm664 "${srcdir}"/*'"${_variant}"'-zh-hans.gram -t "${pkgdir}"/usr/share/rime-data/ - }' -done +package_rime-lmdg() { + provides=("${pkgbase}=${pkgver}") + replaces=('rime-lmdg-m1') + optdepends=('librime: Rime Input Method Engine' + "${pkgbase}-config: default patch configurations") + install -Dm664 "${srcdir}"/wanxiang-zh-hans.gram -t "${pkgdir}"/usr/share/rime-data/ +} package_rime-lmdg-config() { depends=("${pkgbase}") diff --git a/archlinuxcn/rime-lmdg/lilac.py b/archlinuxcn/rime-lmdg/lilac.py new file mode 100644 index 000000000000..a88cdada818a --- /dev/null +++ b/archlinuxcn/rime-lmdg/lilac.py @@ -0,0 +1,11 @@ +#!/usr/bin/python3 +def pre_build(): + _release_tag = _G.newver + + for line in edit_file("PKGBUILD"): + if line.startswith("_release_tag="): + line = f"_release_tag={_release_tag}" + print(line) + + pkgver = _release_tag.lstrip("v").replace("-", "_").lower() + update_pkgver_and_pkgrel(pkgver) diff --git a/archlinuxcn/rime-lmdg/lilac.yaml b/archlinuxcn/rime-lmdg/lilac.yaml index 648b45ff918b..b3b7d1c2e095 100644 --- a/archlinuxcn/rime-lmdg/lilac.yaml +++ b/archlinuxcn/rime-lmdg/lilac.yaml @@ -1,9 +1,6 @@ maintainers: - github: everyx -pre_build_script: | - update_pkgver_and_pkgrel(_G.newver) - post_build_script: | git_pkgbuild_commit() @@ -11,4 +8,3 @@ update_on: - source: github github: amzxyz/RIME-LMDG use_latest_release: true - prefix: v diff --git a/archlinuxcn/rime-lmdg/lmdg.yaml b/archlinuxcn/rime-lmdg/lmdg.yaml index a6be2e401735..f80b974f00ba 100644 --- a/archlinuxcn/rime-lmdg/lmdg.yaml +++ b/archlinuxcn/rime-lmdg/lmdg.yaml @@ -1,8 +1,8 @@ -n3m1-zh-hans: +zh-hans: grammar: collocation_max_length: 5 collocation_min_length: 2 - language: amz-v2n3m1-zh-hans + language: wanxiang-zh-hans translator/contextual_suggestions: true translator/max_homophones: 7 translator/max_homographs: 7 diff --git a/archlinuxcn/rime-lmdg/package.list b/archlinuxcn/rime-lmdg/package.list deleted file mode 100644 index 1efe0b3bf376..000000000000 --- a/archlinuxcn/rime-lmdg/package.list +++ /dev/null @@ -1,2 +0,0 @@ -rime-lmdg-config -rime-lmdg-m1