-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathenchant2.yaml
113 lines (98 loc) · 2.61 KB
/
enchant2.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package:
name: enchant2
version: 2.8.2
epoch: 3
description: enchant spellchecking library
copyright:
- license: LGPL-2.1-only
environment:
contents:
packages:
- autoconf
- automake
- build-base
- busybox
- ca-certificates-bundle
- coreutils
- glib-dev
- groff
- hunspell-dev
- libtool
- patch
- pkgconf-dev
- vala
pipeline:
- uses: git-checkout
with:
repository: https://github.com/AbiWord/enchant
tag: v${{package.version}}
expected-commit: 2e2739acea4926ae2584823b5f75480243b191df
- runs: ./bootstrap
- uses: autoconf/configure
with:
opts: |
--with-hunspell \
--enable-relocatable
- uses: autoconf/make
- uses: autoconf/make-install
- uses: strip
subpackages:
- name: enchant2-dev
pipeline:
- uses: split/dev
test:
pipeline:
- uses: test/pkgconf
- uses: test/tw/ldd-check
- name: enchant2-doc
description: enchant2 docs
pipeline:
- uses: split/manpages
test:
pipeline:
- uses: test/docs
update:
enabled: true
git:
strip-prefix: v
test:
environment:
contents:
packages:
- enchant2-dev
- hunspell-dev
- hunspell-dictionaries-all
- py3-pip
- python3
pipeline:
- runs: |
pip3 install spello pyenchant
enchant-2 -v
enchant-2 -h
enchant-lsmod-2 -v
enchant-lsmod-2 -h
- runs: |
python -c '
import enchant
from spello.model import SpellCorrectionModel
d = enchant.Dict("en_US")
word = "recieve"
assert not d.check(word), f"{word} should be misspelled"
suggestions = d.suggest(word)
expected_suggestions = ["receive", "relieve", "reverie"]
assert set(expected_suggestions).issubset(set(suggestions)), f"Suggestions for {word} are incorrect. Got: {suggestions}"
sp = SpellCorrectionModel(language="en")
sp.train(["I want to play cricket", "this is a text corpus"])
sentence = "i wnt to plai kricket"
correction = sp.spell_correct(sentence)
expected_correction = {
"original_text": "i wnt to plai kricket",
"spell_corrected_text": "i want to play cricket",
"correction_dict": {
"wnt": "want",
"plai": "play",
"kricket": "cricket"
}
}
assert correction == expected_correction, f"Correction for {sentence} is incorrect. Expected: {expected_correction}, but got: {correction}"'
- uses: test/tw/ldd-check