Skip to content

Commit 383fdf2

Browse files
committed
bindings for enchant v2
Fork v1 bindings and target v2 for this repo
1 parent 5092263 commit 383fdf2

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
FROM golang:stretch
1+
FROM golang:bullseye
22

33
RUN apt-get update && apt-get upgrade -y
44

5-
RUN apt-get install -y libenchant-dev
5+
RUN apt-get install -y enchant-2 libenchant-2-dev
66

7-
RUN mkdir /app
7+
WORKDIR /root
88

9-
ADD . /app/
10-
11-
WORKDIR /app
9+
ADD go.mod /root/
10+
ADD *.go /root/
1211

1312
CMD ["go", "test", "-v", "--cover"]

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
.PHONY: test
22
test:
3-
docker build --rm -t goenchant-test .
4-
docker run --rm -ti goenchant-test
3+
docker build --rm -t goenchant2-test .
4+
docker run --rm -it goenchant2-test
5+
6+
.PHONY: bench
7+
bench:
8+
docker build --rm -t goenchant2-test .
9+
docker run --rm -it goenchant2-test go test --bench=.

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
# goenchant
1+
# goenchant2
22

3-
This package provides bindings for the enchant spell checking library.
3+
This package provides bindings for the enchant v2 spell checking library.
4+
5+
See https://github.com/danielx/enchant for bindings for v1
46

57
## Prerequisites
68

7-
You need to have `libenchant` version 1.6 and its development files
9+
You need to have `enchant` version 2 and its development files
810
installed to use this package. Additionally you need to install the
911
dictionaries (hunspell, aspell etc.) you would like to use.
1012

1113
### Example
1214
```
13-
sudo apt-get install enchant libenchant-dev hunspell-en
15+
sudo apt-get install enchant-2 libenchant-2-dev hunspell-en-us
1416
```
1517

1618
## Install
1719

1820
```
19-
go get github.com/danielx/enchant
21+
go get github.com/danielx/enchant2
2022
```
2123

2224
## Running tests
@@ -33,7 +35,7 @@ make test
3335

3436
## Docs
3537

36-
https://godoc.org/github.com/danielx/enchant
38+
https://godoc.org/github.com/danielx/enchant2
3739

3840
## Usage
3941

@@ -44,7 +46,7 @@ import (
4446
"fmt"
4547
"os"
4648

47-
"github.com/danielx/enchant"
49+
"github.com/danielx/enchant2"
4850
)
4951

5052
func main() {

enchant.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
package enchant
33

44
/*
5-
#cgo LDFLAGS: -lenchant
5+
#cgo LDFLAGS: -lenchant-2
66
#include <stdlib.h>
7-
#include <enchant/enchant.h>
7+
#include <enchant-2/enchant.h>
88
99
static char* getString(char **c, int i) {
1010
return c[i];

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/danielx/enchant
1+
module github.com/danielx/enchant2
22

33
go 1.15

0 commit comments

Comments
 (0)