diff --git a/.travis.yml b/.travis.yml index 04abaf6..78683d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: go go: - - "1.10" - - "1.11" + - "1.12.x" + - "1.13.x" - tip services: @@ -13,20 +13,22 @@ addons: packages: - docker-ce +env: + - GO111MODULE=on + before_install: - - go get github.com/golang/dep/... - go get golang.org/x/lint/golint - go get github.com/mattn/goveralls install: - - $GOPATH/bin/dep ensure + - go mod vendor script: - - make test - - make lint + - go test -cover -b `go list ./...` + - golint `go list ./...` after_script: | - if [[ $TRAVIS_GO_VERSION == 1.11* ]] && [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then + if [[ $TRAVIS_GO_VERSION == 1.13* ]] && [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then goveralls -repotoken ${COVERALLS_TOKEN} echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker build -t ynqa/wego:latest . diff --git a/Dockerfile b/Dockerfile index 39aa4a7..0574a3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN dep ensure -v -vendor-only RUN go build -v -o wego . FROM busybox -COPY --from=builder /go/src/github.com/ynqa/wego/wego /usr/local/bin/wego +COPY --from=builder /go/src/github.com/ynqa/wego/pkg/wego /usr/local/bin/wego ENTRYPOINT ["wego"] CMD ["help"] diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 4731be8..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,328 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:1c8ee7543ae60103ae543f79e6044d768e6de6cfaa245c53e45f3681c7f682a0" - name = "github.com/awalterschulze/gographviz" - packages = [ - ".", - "ast", - "internal/errors", - "internal/lexer", - "internal/parser", - "internal/token", - ] - pruneopts = "" - revision = "c84395e536e1a1199093a4e6253d1bee99e4cd2a" - version = "v2.0" - -[[projects]] - digest = "1:6469c328b65de06b5e6c69f55d55599d00c67917909dfb705033b9b7c7fd66b9" - name = "github.com/chewxy/hm" - packages = ["."] - pruneopts = "" - revision = "61efb3290a086d1335e8954b3734c102126818ba" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:3971d043d2f7216722fe46cb9e042f6affe19b663b2ccafff6e06bd2e1d84588" - name = "github.com/chewxy/lingo" - packages = [ - ".", - "corpus", - "treebank", - ] - pruneopts = "" - revision = "8f8059f5438926f7f50e8c62135b0af85376aeca" - -[[projects]] - digest = "1:44bfa822819c2707ebc72916d24145494c778af59e91a5aa138606776fe6052b" - name = "github.com/chewxy/math32" - packages = ["."] - pruneopts = "" - revision = "d1e7b22839c693f54edf7811dd9487623abf2cd2" - version = "v1.0.0" - -[[projects]] - digest = "1:9f1e571696860f2b4f8a241b43ce91c6085e7aaed849ccca53f590a4dc7b95bd" - name = "github.com/fsnotify/fsnotify" - packages = ["."] - pruneopts = "" - revision = "629574ca2a5df945712d3079857300b5e4da0236" - version = "v1.4.2" - -[[projects]] - branch = "master" - digest = "1:147d671753effde6d3bcd58fc74c1d67d740196c84c280c762a5417319499972" - name = "github.com/hashicorp/hcl" - packages = [ - ".", - "hcl/ast", - "hcl/parser", - "hcl/scanner", - "hcl/strconv", - "hcl/token", - "json/parser", - "json/scanner", - "json/token", - ] - pruneopts = "" - revision = "23c074d0eceb2b8a5bfdbb271ab780cde70f05a8" - -[[projects]] - digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" - name = "github.com/inconshreveable/mousetrap" - packages = ["."] - pruneopts = "" - revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" - version = "v1.0" - -[[projects]] - branch = "master" - digest = "1:cf63454c1e81409484ded047413228de0f7a3031f0fcd36d4e1db7620c3c7d1b" - name = "github.com/leesper/go_rng" - packages = ["."] - pruneopts = "" - revision = "5344a9259b21627d94279721ab1f27eb029194e7" - -[[projects]] - digest = "1:739b2038a38cebb50e922d18f4b042c042256320fea2db094814aeef8891e0c1" - name = "github.com/magiconair/properties" - packages = ["."] - pruneopts = "" - revision = "d419a98cdbed11a922bf76f257b7c4be79b50e73" - version = "v1.7.4" - -[[projects]] - digest = "1:81e673df85e765593a863f67cba4544cf40e8919590f04d67664940786c2b61a" - name = "github.com/mattn/go-runewidth" - packages = ["."] - pruneopts = "" - revision = "9e777a8366cce605130a531d2cd6363d07ad7317" - version = "v0.0.2" - -[[projects]] - branch = "master" - digest = "1:30a2adc78c422ebd23aac9cfece529954d5eacf9ddbe37345f2a17439f8fa849" - name = "github.com/mitchellh/mapstructure" - packages = ["."] - pruneopts = "" - revision = "06020f85339e21b2478f756a78e295255ffa4d6a" - -[[projects]] - branch = "master" - digest = "1:fcb36be3abd0dc761d26591aed850a4b970deea9e095c783788cebf6ccf1267b" - name = "github.com/olekukonko/tablewriter" - packages = ["."] - pruneopts = "" - revision = "65fec0d89a572b4367094e2058d3ebe667de3b60" - -[[projects]] - digest = "1:9c740db1f7015dffa093aa5c70862d277fe49f5e92b56ca5d0d69ef0e37c01db" - name = "github.com/pelletier/go-toml" - packages = ["."] - pruneopts = "" - revision = "16398bac157da96aa88f98a2df640c7f32af1da2" - version = "v1.0.1" - -[[projects]] - digest = "1:4aee2a94909f9d05d53281e22268c629f6eba9ddc179fdbcd6466de5a998e01e" - name = "github.com/peterh/liner" - packages = ["."] - pruneopts = "" - revision = "5a0dfa99e2aa1d433a9642e863da51402e609376" - version = "v1.1.0" - -[[projects]] - digest = "1:7365acd48986e205ccb8652cc746f09c8b7876030d53710ea6ef7d0bd0dcd7ca" - name = "github.com/pkg/errors" - packages = ["."] - pruneopts = "" - revision = "645ef00459ed84a119197bfb8d8205042c6df63d" - version = "v0.8.0" - -[[projects]] - digest = "1:d1c1e5f4064b332bd90bba7bc2ab403c0afd7b36d34b7875877a45c78d24f5c1" - name = "github.com/spf13/afero" - packages = [ - ".", - "mem", - ] - pruneopts = "" - revision = "8d919cbe7e2627e417f3e45c3c0e489a5b7e2536" - version = "v1.0.0" - -[[projects]] - digest = "1:6ff9b74bfea2625f805edec59395dc37e4a06458dd3c14e3372337e3d35a2ed6" - name = "github.com/spf13/cast" - packages = ["."] - pruneopts = "" - revision = "acbeb36b902d72a7a4c18e8f3241075e7ab763e4" - version = "v1.1.0" - -[[projects]] - digest = "1:2208a80fc3259291e43b30f42f844d18f4218036dff510f42c653ec9890d460a" - name = "github.com/spf13/cobra" - packages = ["."] - pruneopts = "" - revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" - version = "v0.0.1" - -[[projects]] - branch = "master" - digest = "1:5cb42b990db5dc48b8bc23b6ee77b260713ba3244ca495cd1ed89533dc482a49" - name = "github.com/spf13/jwalterweatherman" - packages = ["."] - pruneopts = "" - revision = "12bd96e66386c1960ab0f74ced1362f66f552f7b" - -[[projects]] - digest = "1:261bc565833ef4f02121450d74eb88d5ae4bd74bfe5d0e862cddb8550ec35000" - name = "github.com/spf13/pflag" - packages = ["."] - pruneopts = "" - revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" - version = "v1.0.0" - -[[projects]] - digest = "1:59354ad53dfe6ed1b941844cb029cd37c0377598eec3a0d49c03aee2375ef9c4" - name = "github.com/spf13/viper" - packages = ["."] - pruneopts = "" - revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:f11510bf901cb0a8a23376c2be679083fe34f0b49af7e12fbe9ad5a78531c990" - name = "github.com/xtgo/set" - packages = ["."] - pruneopts = "" - revision = "4431f6b51265b1e0b76af4dafc09d6f12c2bdcd0" - -[[projects]] - branch = "master" - digest = "1:134679482ac3fd5ecd60c1412510d52272e29e1085bf2dd2d7e79e2d1d38acc0" - name = "golang.org/x/sys" - packages = ["unix"] - pruneopts = "" - revision = "83801418e1b59fb1880e363299581ee543af32ca" - -[[projects]] - branch = "master" - digest = "1:9f9562b058a594dae0c8e2388c1a802664111736845bc08885246f0e4bf99bdd" - name = "golang.org/x/text" - packages = [ - "internal/gen", - "internal/triegen", - "internal/ucd", - "transform", - "unicode/cldr", - "unicode/norm", - ] - pruneopts = "" - revision = "e19ae1496984b1c655b8044a65c0300a3c878dd3" - -[[projects]] - branch = "master" - digest = "1:8f50bd9851c444ca9c217adf861f4c79e99061d6a529e57bafd2e8144a170e4a" - name = "gonum.org/v1/gonum" - packages = [ - "blas", - "blas/blas64", - "blas/gonum", - "floats", - "graph", - "graph/internal/linear", - "graph/internal/ordered", - "graph/internal/set", - "graph/topo", - "graph/traverse", - "internal/asm/c128", - "internal/asm/f32", - "internal/asm/f64", - "internal/math32", - "lapack", - "lapack/gonum", - "lapack/lapack64", - "mat", - ] - pruneopts = "" - revision = "cd47c93d54483f54eed45cc1e2e1264d267f326c" - -[[projects]] - digest = "1:0b6bc675e713ed14b49106a6332b66c693e70c116d02209457564a68b032a075" - name = "gopkg.in/cheggaaa/pb.v1" - packages = ["."] - pruneopts = "" - revision = "18d384da9bdc1e5a08fc2a62a494c321d9ae74ea" - version = "v1.0.19" - -[[projects]] - branch = "v2" - digest = "1:f769ed60e075e4221612c2f4162fccc9d3795ef358fa463425e3b3d7a5debb27" - name = "gopkg.in/yaml.v2" - packages = ["."] - pruneopts = "" - revision = "287cf08546ab5e7e37d55a84f7ed3fd1db036de5" - -[[projects]] - digest = "1:26d2fe2bb4b4b7bdf1b8ae1b6f76535f69569cc2d2eafacf34b196895161a8a5" - name = "gorgonia.org/cu" - packages = ["."] - pruneopts = "" - revision = "32f165836e285c14a4f78c455872d069e0cc5a7d" - version = "v0.8.0" - -[[projects]] - digest = "1:28cb119d50a971910199ad65ca835c96ea142961296181aad4ea8e88c3759e12" - name = "gorgonia.org/gorgonia" - packages = ["."] - pruneopts = "" - revision = "55787bbd182f3d621f26c0a85e7de2e6a28ba5eb" - version = "v0.8.0" - -[[projects]] - digest = "1:e9b9b85cc2ea057c57940153daf24f6ffe0831c081cdc04f91b5b545ebe52210" - name = "gorgonia.org/tensor" - packages = [ - ".", - "internal/execution", - "internal/storage", - ] - pruneopts = "" - revision = "863b76853934d224104ae8cc08f2d27202521242" - version = "v0.8.0" - -[[projects]] - branch = "master" - digest = "1:56036c6ea3474d2088a8778156e08aebb909a6b5ea269deabbe9907b84ccbefe" - name = "gorgonia.org/vecf32" - packages = ["."] - pruneopts = "" - revision = "9c61466a81d94e61358d0a8cf77e5d76ff5de655" - -[[projects]] - branch = "master" - digest = "1:ed3279740b1f34e3de46b1073723aab5417557e8a993bfab58736cb9852a49c3" - name = "gorgonia.org/vecf64" - packages = ["."] - pruneopts = "" - revision = "92cacded62a76710546770b2b86b1ca82ff76614" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/chewxy/lingo/corpus", - "github.com/olekukonko/tablewriter", - "github.com/peterh/liner", - "github.com/pkg/errors", - "github.com/spf13/cobra", - "github.com/spf13/pflag", - "github.com/spf13/viper", - "gopkg.in/cheggaaa/pb.v1", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 5c49d27..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,31 +0,0 @@ -[[constraint]] - branch = "master" - name = "github.com/chewxy/lingo" - -[[constraint]] - branch = "master" - name = "github.com/olekukonko/tablewriter" - -[[constraint]] - name = "github.com/pkg/errors" - version = "0.8.0" - -[[constraint]] - name = "github.com/spf13/cobra" - version = "0.0.1" - -[[constraint]] - name = "github.com/spf13/pflag" - version = "1.0.0" - -[[constraint]] - name = "github.com/spf13/viper" - version = "1.0.0" - -[[constraint]] - name = "gopkg.in/cheggaaa/pb.v1" - version = "1.0.18" - -[[constraint]] - name = "github.com/peterh/liner" - version = "1.1.0" diff --git a/LICENSE b/LICENSE index d645695..261eeb9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/Makefile b/Makefile deleted file mode 100644 index 7fb1f14..0000000 --- a/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -.PHONY: build -build: - go build - -.PHONY: clean-vendor -clean-vendor: - rm -rf vendor/ - -.PHONY: clean-example -clean-example: - rm -rf example/*.txt - -.PHONY: clean -clean: clean-example clean-vendor - -.PHONY: ensure -ensure: - dep ensure -vendor-only - -.PHONY: fmt -fmt: - go fmt `go list ./...` - -.PHONY: lint -lint: - golint `go list ./...` - -.PHONY: test -test: - go test -cover -v `go list ./...` diff --git a/README.md b/README.md index 7f87f1d..f487f8d 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,8 @@ package main import ( "os" - "github.com/ynqa/wego/builder" - "github.com/ynqa/wego/model/word2vec" + "github.com/ynqa/wego/pkg/builder" + "github.com/ynqa/wego/pkg/model/word2vec" ) func main() { diff --git a/cmd/glove.go b/cmd/glove.go index b46bdde..917fd57 100644 --- a/cmd/glove.go +++ b/cmd/glove.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "os" @@ -22,9 +22,9 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ynqa/wego/builder" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/validate" + "github.com/ynqa/wego/pkg/builder" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/validate" ) var gloveCmd = &cobra.Command{ diff --git a/cmd/glove_test.go b/cmd/glove_test.go index 36bb718..67255be 100644 --- a/cmd/glove_test.go +++ b/cmd/glove_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "testing" diff --git a/cmd/lexvec.go b/cmd/lexvec.go index 24a5f15..4d3e3d8 100644 --- a/cmd/lexvec.go +++ b/cmd/lexvec.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "os" @@ -22,9 +22,9 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ynqa/wego/builder" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/validate" + "github.com/ynqa/wego/pkg/builder" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/validate" ) var lexvecCmd = &cobra.Command{ diff --git a/cmd/repl.go b/cmd/repl.go index 2d67453..744c02f 100644 --- a/cmd/repl.go +++ b/cmd/repl.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "os" @@ -20,8 +20,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/repl" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/repl" ) var replCmd = &cobra.Command{ diff --git a/cmd/repl_test.go b/cmd/repl_test.go index 92e71b8..55a9be5 100644 --- a/cmd/repl_test.go +++ b/cmd/repl_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "testing" diff --git a/cmd/root.go b/cmd/root.go index e1fc503..736215a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "github.com/pkg/errors" @@ -20,7 +20,7 @@ import ( "github.com/spf13/pflag" "github.com/spf13/viper" - "github.com/ynqa/wego/config" + "github.com/ynqa/wego/pkg/config" ) // RootCmd is the root command for word embedding. diff --git a/cmd/root_test.go b/cmd/root_test.go index 3c3a386..f425d2d 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "testing" diff --git a/cmd/search.go b/cmd/search.go index 5a2f4ce..0510f43 100644 --- a/cmd/search.go +++ b/cmd/search.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "os" @@ -21,8 +21,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/search" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/search" ) var searchCmd = &cobra.Command{ diff --git a/cmd/search_test.go b/cmd/search_test.go index 4f2672a..681ba43 100644 --- a/cmd/search_test.go +++ b/cmd/search_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "testing" diff --git a/wego.go b/cmd/wego.go similarity index 89% rename from wego.go rename to cmd/wego.go index f906cb0..488a35c 100644 --- a/wego.go +++ b/cmd/wego.go @@ -16,12 +16,10 @@ package main import ( "os" - - "github.com/ynqa/wego/cmd" ) func main() { - if err := cmd.RootCmd.Execute(); err != nil { + if err := RootCmd.Execute(); err != nil { os.Exit(1) } } diff --git a/cmd/word2vec.go b/cmd/word2vec.go index a23dff1..e48f37b 100644 --- a/cmd/word2vec.go +++ b/cmd/word2vec.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "os" @@ -22,9 +22,9 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/ynqa/wego/builder" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/validate" + "github.com/ynqa/wego/pkg/builder" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/validate" ) var word2vecCmd = &cobra.Command{ diff --git a/cmd/word2vec_test.go b/cmd/word2vec_test.go index c0544ca..89c604a 100644 --- a/cmd/word2vec_test.go +++ b/cmd/word2vec_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package main import ( "testing" diff --git a/example/glove/glove.go b/examples/glove/glove.go similarity index 92% rename from example/glove/glove.go rename to examples/glove/glove.go index 8440b3f..0117fd2 100644 --- a/example/glove/glove.go +++ b/examples/glove/glove.go @@ -17,8 +17,8 @@ package main import ( "os" - "github.com/ynqa/wego/builder" - "github.com/ynqa/wego/model/glove" + "github.com/ynqa/wego/pkg/builder" + "github.com/ynqa/wego/pkg/model/glove" ) func main() { diff --git a/example/lexvec/lexvec.go b/examples/lexvec/lexvec.go similarity index 93% rename from example/lexvec/lexvec.go rename to examples/lexvec/lexvec.go index 2371dfd..755f2e5 100644 --- a/example/lexvec/lexvec.go +++ b/examples/lexvec/lexvec.go @@ -17,8 +17,8 @@ package main import ( "os" - "github.com/ynqa/wego/builder" - "github.com/ynqa/wego/corpus" + "github.com/ynqa/wego/pkg/builder" + "github.com/ynqa/wego/pkg/corpus" ) func main() { diff --git a/example/word2vec/word2vec.go b/examples/word2vec/word2vec.go similarity index 93% rename from example/word2vec/word2vec.go rename to examples/word2vec/word2vec.go index ea80970..d0d04c0 100644 --- a/example/word2vec/word2vec.go +++ b/examples/word2vec/word2vec.go @@ -17,8 +17,8 @@ package main import ( "os" - "github.com/ynqa/wego/builder" - "github.com/ynqa/wego/model/word2vec" + "github.com/ynqa/wego/pkg/builder" + "github.com/ynqa/wego/pkg/model/word2vec" ) func main() { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b3e5466 --- /dev/null +++ b/go.mod @@ -0,0 +1,37 @@ +module github.com/ynqa/wego + +go 1.13 + +require ( + github.com/awalterschulze/gographviz v0.0.0-20170410065617-c84395e536e1 // indirect + github.com/chewxy/hm v1.0.0 // indirect + github.com/chewxy/lingo v0.0.0-20180424035724-8f8059f54389 + github.com/chewxy/math32 v1.0.0 // indirect + github.com/fsnotify/fsnotify v1.4.2 // indirect + github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/leesper/go_rng v0.0.0-20171009123644-5344a9259b21 // indirect + github.com/magiconair/properties v1.7.4 // indirect + github.com/mitchellh/mapstructure v0.0.0-20171017171808-06020f85339e // indirect + github.com/olekukonko/tablewriter v0.0.0-20171203151007-65fec0d89a57 + github.com/pelletier/go-toml v1.0.1 // indirect + github.com/peterh/liner v1.1.0 + github.com/pkg/errors v0.8.0 + github.com/spf13/afero v1.0.0 // indirect + github.com/spf13/cast v1.1.0 // indirect + github.com/spf13/cobra v0.0.1 + github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386 // indirect + github.com/spf13/pflag v1.0.0 + github.com/spf13/viper v1.0.0 + github.com/stretchr/testify v1.4.0 // indirect + github.com/xtgo/set v0.0.0-20151204082305-4431f6b51265 // indirect + golang.org/x/sys v0.0.0-20171222143536-83801418e1b5 // indirect + golang.org/x/text v0.3.1-0.20171227012246-e19ae1496984 // indirect + gonum.org/v1/gonum v0.0.0-20171227085449-cd47c93d5448 // indirect + gopkg.in/cheggaaa/pb.v1 v1.0.19 + gorgonia.org/cu v0.8.0 // indirect + gorgonia.org/gorgonia v0.8.0 // indirect + gorgonia.org/tensor v0.8.0 // indirect + gorgonia.org/vecf32 v0.7.1-0.20171210012140-9c61466a81d9 // indirect + gorgonia.org/vecf64 v0.7.1-0.20171210012113-92cacded62a7 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..6cfe2af --- /dev/null +++ b/go.sum @@ -0,0 +1,60 @@ +github.com/awalterschulze/gographviz v0.0.0-20170410065617-c84395e536e1 h1:r2lcIqPAm8+z4sEiWTJW3JR3/tc9WWH95hZFXLd2Y0g= +github.com/awalterschulze/gographviz v0.0.0-20170410065617-c84395e536e1/go.mod h1:GEV5wmg4YquNw7v1kkyoX9etIk8yVmXj+AkDHuuETHs= +github.com/chewxy/hm v1.0.0/go.mod h1:qg9YI4q6Fkj/whwHR1D+bOGeF7SniIP40VweVepLjg0= +github.com/chewxy/lingo v0.0.0-20180424035724-8f8059f54389/go.mod h1:q5CiNpjdywd0YKLC4xgjZEWe02MRmIfpmpt4aZRf9jg= +github.com/chewxy/math32 v1.0.0/go.mod h1:Miac6hA1ohdDUTagnvJy/q+aNnEk16qWUdb8ZVhvCN0= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.2 h1:v5tKwtf2hNhBV24eNYfQ5UmvFOGlOCmRqk7/P1olxtk= +github.com/fsnotify/fsnotify v1.4.2/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb h1:1OvvPvZkn/yCQ3xBcM8y4020wdkMXPHLB4+NfoGWh4U= +github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/leesper/go_rng v0.0.0-20171009123644-5344a9259b21/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U= +github.com/magiconair/properties v1.7.4 h1:UVo0TkHGd4lQSN1dVDzs9URCIgReuSIcCXpAVB9nZ80= +github.com/magiconair/properties v1.7.4/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mitchellh/mapstructure v0.0.0-20171017171808-06020f85339e h1:PtGHLB3CX3TFPcksODQMxncoeQKWwCgTg0bJ40VLJP4= +github.com/mitchellh/mapstructure v0.0.0-20171017171808-06020f85339e/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/olekukonko/tablewriter v0.0.0-20171203151007-65fec0d89a57/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/pelletier/go-toml v1.0.1 h1:0nx4vKBl23+hEaCOV1mFhKS9vhhBtFYWC7rQY0vJAyE= +github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterh/liner v1.1.0 h1:f+aAedNJA6uk7+6rXsYBnhdo4Xux7ESLe+kcuVUF5os= +github.com/peterh/liner v1.1.0/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/afero v1.0.0 h1:Z005C09nPzwTTsDRJCQBVnpTU0bjTr/NhyWLj1nSPP4= +github.com/spf13/afero v1.0.0/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.1.0 h1:0Rhw4d6C8J9VPu6cjZLIhZ8+aAOHcDvGeKn+cq5Aq3k= +github.com/spf13/cast v1.1.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386 h1:zBoLErXXAvWnNsu+pWkRYl6Cx1KXmIfAVsIuYkPN6aY= +github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.0.0 h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I= +github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/xtgo/set v0.0.0-20151204082305-4431f6b51265 h1:86yslOGLdMhh3xJR1+1UleoyTbyzmBWAGDdw0qPg1HI= +github.com/xtgo/set v0.0.0-20151204082305-4431f6b51265/go.mod h1:d3NHzGzSa0NmB2NhFyECA+QdRp29oEn2xbT+TpeFoM8= +golang.org/x/sys v0.0.0-20171222143536-83801418e1b5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.1-0.20171227012246-e19ae1496984 h1:4S3Dic2vY09agWhKAjYa6buMB7HsLkVrliEHZclmmSU= +golang.org/x/text v0.3.1-0.20171227012246-e19ae1496984/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gonum.org/v1/gonum v0.0.0-20171227085449-cd47c93d5448 h1:sTUWU+bhQAWFzZe659aEHnUcwkw6x/chMg4u1+SFSoo= +gonum.org/v1/gonum v0.0.0-20171227085449-cd47c93d5448/go.mod h1:cucAdkem48eM79EG1fdGOGASXorNZIYAO9duTse+1cI= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.19/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/yaml.v2 v2.0.0-20171116090243-287cf08546ab h1:yZ6iByf7GKeJ3gsd1Dr/xaj1DyJ//wxKX1Cdh8LhoAw= +gopkg.in/yaml.v2 v2.0.0-20171116090243-287cf08546ab/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gorgonia.org/cu v0.8.0 h1:XpTkl5IpMlTPNJl6pKQPEXVV/9TnEtiRB7j1gGkrzCI= +gorgonia.org/cu v0.8.0/go.mod h1:RPEPIfaxxqUmeRe7T1T8a0NER+KxBI2McoLEXhP1Vd8= +gorgonia.org/gorgonia v0.8.0/go.mod h1:qucT7YHm/2OuSHWEw/6Je/LQ5htRJNQJ1+qpB58fY8c= +gorgonia.org/tensor v0.8.0 h1:+JDsIEnx+wQVf9brvrYyU+/uZit2PnzP9Dt4CWNeirQ= +gorgonia.org/tensor v0.8.0/go.mod h1:05Y4laKuVlj4qFoZIZW1q/9n1jZkgDBOLmKXZdBLG1w= +gorgonia.org/vecf32 v0.7.1-0.20171210012140-9c61466a81d9 h1:L4MiT1K2R1dTZEgy9Qo7cbPz3vnYlCXBplZvmdPi4Ko= +gorgonia.org/vecf32 v0.7.1-0.20171210012140-9c61466a81d9/go.mod h1:iHG+kvTMqGYA0SgahfO2k62WRnxmHsqAREGbayRDzy8= +gorgonia.org/vecf64 v0.7.1-0.20171210012113-92cacded62a7 h1:UX4nbW/6w1hRHsWVpYJZjqjlbSvql5ynxioh1z/KLTI= +gorgonia.org/vecf64 v0.7.1-0.20171210012113-92cacded62a7/go.mod h1:1y4pmcSd+wh3phG+InwWQjYrqwyrtN9h27WLFVQfV1Q= diff --git a/builder/glove.go b/pkg/builder/glove.go similarity index 98% rename from builder/glove.go rename to pkg/builder/glove.go index 2ad5f91..0340ff5 100644 --- a/builder/glove.go +++ b/pkg/builder/glove.go @@ -18,9 +18,9 @@ import ( "github.com/pkg/errors" "github.com/spf13/viper" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/model" - "github.com/ynqa/wego/model/glove" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/model" + "github.com/ynqa/wego/pkg/model/glove" ) // GloveBuilder manages the members to build Model interface. diff --git a/builder/glove_test.go b/pkg/builder/glove_test.go similarity index 98% rename from builder/glove_test.go rename to pkg/builder/glove_test.go index 7b7df17..0fb114a 100644 --- a/builder/glove_test.go +++ b/pkg/builder/glove_test.go @@ -17,7 +17,7 @@ package builder import ( "testing" - "github.com/ynqa/wego/model/glove" + "github.com/ynqa/wego/pkg/model/glove" ) func TestGloveDimension(t *testing.T) { diff --git a/builder/lexvec.go b/pkg/builder/lexvec.go similarity index 97% rename from builder/lexvec.go rename to pkg/builder/lexvec.go index 3fbc631..d48c9c8 100644 --- a/builder/lexvec.go +++ b/pkg/builder/lexvec.go @@ -18,10 +18,10 @@ import ( "github.com/pkg/errors" "github.com/spf13/viper" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/corpus" - "github.com/ynqa/wego/model" - "github.com/ynqa/wego/model/lexvec" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/corpus" + "github.com/ynqa/wego/pkg/model" + "github.com/ynqa/wego/pkg/model/lexvec" ) // LexvecBuilder manages the members to build Model interface. diff --git a/builder/word2vec.go b/pkg/builder/word2vec.go similarity index 98% rename from builder/word2vec.go rename to pkg/builder/word2vec.go index 24f8f2f..a6b5fe6 100644 --- a/builder/word2vec.go +++ b/pkg/builder/word2vec.go @@ -18,9 +18,9 @@ import ( "github.com/pkg/errors" "github.com/spf13/viper" - "github.com/ynqa/wego/config" - "github.com/ynqa/wego/model" - "github.com/ynqa/wego/model/word2vec" + "github.com/ynqa/wego/pkg/config" + "github.com/ynqa/wego/pkg/model" + "github.com/ynqa/wego/pkg/model/word2vec" ) // Word2vecBuilder manages the members to build Model interface. diff --git a/builder/word2vec_test.go b/pkg/builder/word2vec_test.go similarity index 99% rename from builder/word2vec_test.go rename to pkg/builder/word2vec_test.go index 9b38e33..1efa3a3 100644 --- a/builder/word2vec_test.go +++ b/pkg/builder/word2vec_test.go @@ -15,7 +15,7 @@ package builder import ( - "github.com/ynqa/wego/model/word2vec" + "github.com/ynqa/wego/pkg/model/word2vec" "testing" ) diff --git a/co/co.go b/pkg/co/co.go similarity index 100% rename from co/co.go rename to pkg/co/co.go diff --git a/config/config.go b/pkg/config/config.go similarity index 95% rename from config/config.go rename to pkg/config/config.go index 83cc449..0a4d5c9 100644 --- a/config/config.go +++ b/pkg/config/config.go @@ -17,10 +17,10 @@ package config import ( "runtime" - "github.com/ynqa/wego/corpus" - "github.com/ynqa/wego/model" - "github.com/ynqa/wego/model/glove" - "github.com/ynqa/wego/model/word2vec" + "github.com/ynqa/wego/pkg/corpus" + "github.com/ynqa/wego/pkg/model" + "github.com/ynqa/wego/pkg/model/glove" + "github.com/ynqa/wego/pkg/model/word2vec" ) // Config is enum of the common config. diff --git a/config/config_test.go b/pkg/config/config_test.go similarity index 100% rename from config/config_test.go rename to pkg/config/config_test.go diff --git a/corpus/core.go b/pkg/corpus/core.go similarity index 98% rename from corpus/core.go rename to pkg/corpus/core.go index bcfc55b..2325e16 100644 --- a/corpus/core.go +++ b/pkg/corpus/core.go @@ -23,7 +23,7 @@ import ( "github.com/chewxy/lingo/corpus" "github.com/pkg/errors" - "github.com/ynqa/wego/timer" + "github.com/ynqa/wego/pkg/timer" ) type core struct { diff --git a/corpus/count_model.go b/pkg/corpus/count_model.go similarity index 99% rename from corpus/count_model.go rename to pkg/corpus/count_model.go index b18be20..b9cb42e 100644 --- a/corpus/count_model.go +++ b/pkg/corpus/count_model.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "gopkg.in/cheggaaa/pb.v1" - "github.com/ynqa/wego/co" + "github.com/ynqa/wego/pkg/co" ) // CountModelCorpus stores corpus and co-occurrence values between words. diff --git a/corpus/testing.go b/pkg/corpus/testing.go similarity index 100% rename from corpus/testing.go rename to pkg/corpus/testing.go diff --git a/corpus/word2vec.go b/pkg/corpus/word2vec.go similarity index 97% rename from corpus/word2vec.go rename to pkg/corpus/word2vec.go index 8c65c41..453b12f 100644 --- a/corpus/word2vec.go +++ b/pkg/corpus/word2vec.go @@ -15,7 +15,7 @@ package corpus import ( - "github.com/ynqa/wego/node" + "github.com/ynqa/wego/pkg/node" ) // Word2vecCorpus stores corpus. diff --git a/corpus/word2vec_test.go b/pkg/corpus/word2vec_test.go similarity index 97% rename from corpus/word2vec_test.go rename to pkg/corpus/word2vec_test.go index 0fc3b5b..8c0d0c9 100644 --- a/corpus/word2vec_test.go +++ b/pkg/corpus/word2vec_test.go @@ -19,7 +19,7 @@ import ( "strconv" "testing" - "github.com/ynqa/wego/node" + "github.com/ynqa/wego/pkg/node" ) func TestGetPath(t *testing.T) { diff --git a/model/README.md b/pkg/model/README.md similarity index 100% rename from model/README.md rename to pkg/model/README.md diff --git a/model/glove/adagrad.go b/pkg/model/glove/adagrad.go similarity index 100% rename from model/glove/adagrad.go rename to pkg/model/glove/adagrad.go diff --git a/model/glove/adagrad_test.go b/pkg/model/glove/adagrad_test.go similarity index 100% rename from model/glove/adagrad_test.go rename to pkg/model/glove/adagrad_test.go diff --git a/model/glove/glove.go b/pkg/model/glove/glove.go similarity index 98% rename from model/glove/glove.go rename to pkg/model/glove/glove.go index fbc92bf..ee0715e 100644 --- a/model/glove/glove.go +++ b/pkg/model/glove/glove.go @@ -28,8 +28,8 @@ import ( "github.com/pkg/errors" "gopkg.in/cheggaaa/pb.v1" - "github.com/ynqa/wego/corpus" - "github.com/ynqa/wego/model" + "github.com/ynqa/wego/pkg/corpus" + "github.com/ynqa/wego/pkg/model" ) type GloveOption struct { diff --git a/model/glove/sgd.go b/pkg/model/glove/sgd.go similarity index 100% rename from model/glove/sgd.go rename to pkg/model/glove/sgd.go diff --git a/model/glove/sgd_test.go b/pkg/model/glove/sgd_test.go similarity index 100% rename from model/glove/sgd_test.go rename to pkg/model/glove/sgd_test.go diff --git a/model/glove/solver.go b/pkg/model/glove/solver.go similarity index 100% rename from model/glove/solver.go rename to pkg/model/glove/solver.go diff --git a/model/lexvec/lexvec.go b/pkg/model/lexvec/lexvec.go similarity index 98% rename from model/lexvec/lexvec.go rename to pkg/model/lexvec/lexvec.go index 689f57a..9f3d3b3 100644 --- a/model/lexvec/lexvec.go +++ b/pkg/model/lexvec/lexvec.go @@ -29,9 +29,9 @@ import ( "github.com/pkg/errors" "gopkg.in/cheggaaa/pb.v1" - "github.com/ynqa/wego/co" - "github.com/ynqa/wego/corpus" - "github.com/ynqa/wego/model" + "github.com/ynqa/wego/pkg/co" + "github.com/ynqa/wego/pkg/corpus" + "github.com/ynqa/wego/pkg/model" ) type LexvecOption struct { diff --git a/model/model.go b/pkg/model/model.go similarity index 100% rename from model/model.go rename to pkg/model/model.go diff --git a/model/option.go b/pkg/model/option.go similarity index 100% rename from model/option.go rename to pkg/model/option.go diff --git a/model/util.go b/pkg/model/util.go similarity index 100% rename from model/util.go rename to pkg/model/util.go diff --git a/model/util_test.go b/pkg/model/util_test.go similarity index 100% rename from model/util_test.go rename to pkg/model/util_test.go diff --git a/model/word2vec/cbow.go b/pkg/model/word2vec/cbow.go similarity index 98% rename from model/word2vec/cbow.go rename to pkg/model/word2vec/cbow.go index b2e0e90..2b3626d 100644 --- a/model/word2vec/cbow.go +++ b/pkg/model/word2vec/cbow.go @@ -15,7 +15,7 @@ package word2vec import ( - "github.com/ynqa/wego/model" + "github.com/ynqa/wego/pkg/model" ) // Cbow behaviors as one of Word2vec solver. diff --git a/model/word2vec/hs.go b/pkg/model/word2vec/hs.go similarity index 96% rename from model/word2vec/hs.go rename to pkg/model/word2vec/hs.go index 5abe603..d153494 100644 --- a/model/word2vec/hs.go +++ b/pkg/model/word2vec/hs.go @@ -15,8 +15,8 @@ package word2vec import ( - "github.com/ynqa/wego/corpus" - "github.com/ynqa/wego/node" + "github.com/ynqa/wego/pkg/corpus" + "github.com/ynqa/wego/pkg/node" "github.com/pkg/errors" ) diff --git a/model/word2vec/hs_test.go b/pkg/model/word2vec/hs_test.go similarity index 97% rename from model/word2vec/hs_test.go rename to pkg/model/word2vec/hs_test.go index 236d9d5..6c23640 100644 --- a/model/word2vec/hs_test.go +++ b/pkg/model/word2vec/hs_test.go @@ -17,7 +17,7 @@ package word2vec import ( "testing" - "github.com/ynqa/wego/corpus" + "github.com/ynqa/wego/pkg/corpus" ) func TestNewHierarchicalSoftmax(t *testing.T) { diff --git a/model/word2vec/model.go b/pkg/model/word2vec/model.go similarity index 100% rename from model/word2vec/model.go rename to pkg/model/word2vec/model.go diff --git a/model/word2vec/ns.go b/pkg/model/word2vec/ns.go similarity index 97% rename from model/word2vec/ns.go rename to pkg/model/word2vec/ns.go index 58f9157..b97d15b 100644 --- a/model/word2vec/ns.go +++ b/pkg/model/word2vec/ns.go @@ -15,8 +15,8 @@ package word2vec import ( - "github.com/ynqa/wego/corpus" - "github.com/ynqa/wego/model" + "github.com/ynqa/wego/pkg/corpus" + "github.com/ynqa/wego/pkg/model" ) // NegativeSampling is a piece of Word2Vec optimizer. diff --git a/model/word2vec/ns_test.go b/pkg/model/word2vec/ns_test.go similarity index 97% rename from model/word2vec/ns_test.go rename to pkg/model/word2vec/ns_test.go index 2397efb..029c2be 100644 --- a/model/word2vec/ns_test.go +++ b/pkg/model/word2vec/ns_test.go @@ -17,7 +17,7 @@ package word2vec import ( "testing" - "github.com/ynqa/wego/corpus" + "github.com/ynqa/wego/pkg/corpus" ) func TestNewNegativeSampling(t *testing.T) { diff --git a/model/word2vec/opt.go b/pkg/model/word2vec/opt.go similarity index 97% rename from model/word2vec/opt.go rename to pkg/model/word2vec/opt.go index 1ce0dc4..8fd5354 100644 --- a/model/word2vec/opt.go +++ b/pkg/model/word2vec/opt.go @@ -15,7 +15,7 @@ package word2vec import ( - "github.com/ynqa/wego/corpus" + "github.com/ynqa/wego/pkg/corpus" ) // Optimizer is the interface to initialize after scanning corpus once, and update the word vector. diff --git a/model/word2vec/sigmoid_table.go b/pkg/model/word2vec/sigmoid_table.go similarity index 100% rename from model/word2vec/sigmoid_table.go rename to pkg/model/word2vec/sigmoid_table.go diff --git a/model/word2vec/sigmoid_table_test.go b/pkg/model/word2vec/sigmoid_table_test.go similarity index 100% rename from model/word2vec/sigmoid_table_test.go rename to pkg/model/word2vec/sigmoid_table_test.go diff --git a/model/word2vec/skipgram.go b/pkg/model/word2vec/skipgram.go similarity index 98% rename from model/word2vec/skipgram.go rename to pkg/model/word2vec/skipgram.go index 7fc5da3..0a44b46 100644 --- a/model/word2vec/skipgram.go +++ b/pkg/model/word2vec/skipgram.go @@ -15,7 +15,7 @@ package word2vec import ( - "github.com/ynqa/wego/model" + "github.com/ynqa/wego/pkg/model" ) // SkipGram behaviors as one of Word2vec solver. diff --git a/model/word2vec/word2vec.go b/pkg/model/word2vec/word2vec.go similarity index 98% rename from model/word2vec/word2vec.go rename to pkg/model/word2vec/word2vec.go index 4099706..edaf8c3 100644 --- a/model/word2vec/word2vec.go +++ b/pkg/model/word2vec/word2vec.go @@ -29,8 +29,8 @@ import ( "github.com/pkg/errors" "gopkg.in/cheggaaa/pb.v1" - "github.com/ynqa/wego/corpus" - "github.com/ynqa/wego/model" + "github.com/ynqa/wego/pkg/corpus" + "github.com/ynqa/wego/pkg/model" ) type Word2vecOption struct { diff --git a/node/node.go b/pkg/node/node.go similarity index 100% rename from node/node.go rename to pkg/node/node.go diff --git a/repl/README.md b/pkg/repl/README.md similarity index 100% rename from repl/README.md rename to pkg/repl/README.md diff --git a/repl/op.go b/pkg/repl/op.go similarity index 100% rename from repl/op.go rename to pkg/repl/op.go diff --git a/repl/repl.go b/pkg/repl/repl.go similarity index 99% rename from repl/repl.go rename to pkg/repl/repl.go index 6c8baae..8d211ec 100644 --- a/repl/repl.go +++ b/pkg/repl/repl.go @@ -24,7 +24,7 @@ import ( "github.com/peterh/liner" "github.com/pkg/errors" - "github.com/ynqa/wego/search" + "github.com/ynqa/wego/pkg/search" ) type Repl struct { diff --git a/search/README.md b/pkg/search/README.md similarity index 100% rename from search/README.md rename to pkg/search/README.md diff --git a/search/describer.go b/pkg/search/describer.go similarity index 100% rename from search/describer.go rename to pkg/search/describer.go diff --git a/search/describer_test.go b/pkg/search/describer_test.go similarity index 100% rename from search/describer_test.go rename to pkg/search/describer_test.go diff --git a/search/neighbor.go b/pkg/search/neighbor.go similarity index 100% rename from search/neighbor.go rename to pkg/search/neighbor.go diff --git a/search/neighbor_test.go b/pkg/search/neighbor_test.go similarity index 100% rename from search/neighbor_test.go rename to pkg/search/neighbor_test.go diff --git a/search/parser.go b/pkg/search/parser.go similarity index 100% rename from search/parser.go rename to pkg/search/parser.go diff --git a/search/parser_test.go b/pkg/search/parser_test.go similarity index 100% rename from search/parser_test.go rename to pkg/search/parser_test.go diff --git a/search/search.go b/pkg/search/search.go similarity index 100% rename from search/search.go rename to pkg/search/search.go diff --git a/search/search_test.go b/pkg/search/search_test.go similarity index 100% rename from search/search_test.go rename to pkg/search/search_test.go diff --git a/search/testing.go b/pkg/search/testing.go similarity index 100% rename from search/testing.go rename to pkg/search/testing.go diff --git a/search/util.go b/pkg/search/util.go similarity index 100% rename from search/util.go rename to pkg/search/util.go diff --git a/search/util_test.go b/pkg/search/util_test.go similarity index 100% rename from search/util_test.go rename to pkg/search/util_test.go diff --git a/timer/timer.go b/pkg/timer/timer.go similarity index 100% rename from timer/timer.go rename to pkg/timer/timer.go diff --git a/validate/validate.go b/pkg/validate/validate.go similarity index 100% rename from validate/validate.go rename to pkg/validate/validate.go diff --git a/validate/validate_test.go b/pkg/validate/validate_test.go similarity index 100% rename from validate/validate_test.go rename to pkg/validate/validate_test.go diff --git a/demo.sh b/scripts/demo.sh similarity index 100% rename from demo.sh rename to scripts/demo.sh diff --git a/e2e.sh b/scripts/e2e.sh similarity index 100% rename from e2e.sh rename to scripts/e2e.sh