diff --git a/README.md b/README.md index 769c3fe..973be17 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,12 @@ func main() { func Contains(sentence string) (bool, string) { o.Do(func() { + tok, err := tokenizer.NewKagomeTokenizer(norm.NFKC) + if err != nil { + panic(err) + } s = &shamoji.Serve{ - Tokenizer: tokenizer.NewKagomeSimpleTokenizer(norm.NFKC), + Tokenizer: tok, Filer: filter.NewCuckooFilter("涯に", "悔い"), } }) diff --git a/filter/go.mod b/filter/go.mod deleted file mode 100644 index ceef8ce..0000000 --- a/filter/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/osamingo/shamoji/filter - -go 1.15 - -require ( - github.com/irfansharif/cfilter v0.1.1 -) \ No newline at end of file diff --git a/filter/go.sum b/filter/go.sum deleted file mode 100644 index f0201c7..0000000 --- a/filter/go.sum +++ /dev/null @@ -1 +0,0 @@ -github.com/irfansharif/cfilter v0.1.1/go.mod h1:lev72lI5FgjU6ayV2obe0SxeiVJ20TTi9TKmkdPW3h8= diff --git a/go.mod b/go.mod index 5fb9744..a330621 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,10 @@ module github.com/osamingo/shamoji go 1.15 -require golang.org/x/sync v0.0.0-20201207232520-09787c993a3a +require ( + github.com/ikawaha/kagome-dict/ipa v1.0.2 + github.com/ikawaha/kagome/v2 v2.4.4 + github.com/irfansharif/cfilter v0.1.1 + golang.org/x/sync v0.0.0-20201207232520-09787c993a3a + golang.org/x/text v0.3.5 +) diff --git a/go.sum b/go.sum index 5f7eb37..a816bd5 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,15 @@ +github.com/ikawaha/kagome-dict v1.0.2 h1:RlrQcNm7AcgBrzBcZC+1sniAWxmOECdeJHpJ5G1XFlU= +github.com/ikawaha/kagome-dict v1.0.2/go.mod h1:JCwHr4WOrGRsC2cJU3751mJvL1hIAAZVeIrkl8n3jkk= +github.com/ikawaha/kagome-dict/ipa v1.0.2 h1:vBT1bXZbJpf1Ogw07GDlJmKQ5JyexeeIUJ5DkqcMNwo= +github.com/ikawaha/kagome-dict/ipa v1.0.2/go.mod h1:CmdUPFC1ISLK+ycFo8J6jYFVngDMuXhWtcdz39jni3A= +github.com/ikawaha/kagome-dict/uni v1.1.1/go.mod h1:iipUtdM9UhHIfaY7Hq1ITLVix5OBZf/FgxMYZpGe5fg= +github.com/ikawaha/kagome/v2 v2.4.4 h1:DAJDbjz6D5BtekIsow6laVRQ9y74CPKgNInR1l+q9B0= +github.com/ikawaha/kagome/v2 v2.4.4/go.mod h1:4yR0rtgtJwfOZsnxXx87R4i8An11v4Mj+V6dTcJmwr4= +github.com/irfansharif/cfilter v0.1.1 h1:jUBtJeleLcwXw+96rzfq6D9zNzO3Lbrt81YDF5lMM/o= +github.com/irfansharif/cfilter v0.1.1/go.mod h1:lev72lI5FgjU6ayV2obe0SxeiVJ20TTi9TKmkdPW3h8= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/tokenizer/go.mod b/tokenizer/go.mod deleted file mode 100644 index 2130f5b..0000000 --- a/tokenizer/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/osamingo/shamoji/tokenizer - -go 1.15 - -require ( - github.com/ikawaha/kagome-dict/ipa v1.0.2 - github.com/ikawaha/kagome/v2 v2.4.4 -) \ No newline at end of file diff --git a/tokenizer/go.sum b/tokenizer/go.sum deleted file mode 100644 index 52ff4bc..0000000 --- a/tokenizer/go.sum +++ /dev/null @@ -1,6 +0,0 @@ -github.com/ikawaha/kagome-dict v1.0.2/go.mod h1:JCwHr4WOrGRsC2cJU3751mJvL1hIAAZVeIrkl8n3jkk= -github.com/ikawaha/kagome-dict/ipa v1.0.2/go.mod h1:CmdUPFC1ISLK+ycFo8J6jYFVngDMuXhWtcdz39jni3A= -github.com/ikawaha/kagome-dict/uni v1.1.1/go.mod h1:iipUtdM9UhHIfaY7Hq1ITLVix5OBZf/FgxMYZpGe5fg= -github.com/ikawaha/kagome/v2 v2.4.4/go.mod h1:4yR0rtgtJwfOZsnxXx87R4i8An11v4Mj+V6dTcJmwr4= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=