Codebase list golang-github-jdkato-prose / 163a841
chore: fix Travis CI Joseph Kato 7 years ago
3 changed file(s) with 5 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
11 go:
22 - 1.7
33 - 1.8
4 matrix:
5 include:
6 - os: linux
7 env: ARCH="i686"
8 - os: linux
9 env: ARCH="x86_64"
10 - os: osx
11 env: ARCH="x86_64"
12 osx_image: xcode8
134 install:
145 - make setup
156 - make build
1717 go build ${LDFLAGS} -o bin/prose.exe ./cmd/prose
1818
1919 test-tokenize:
20 python3 scripts/treebank_words.py
2120 go test -v ./tokenize
2221
2322 test: test-tokenize
4140 ./tokenize ./tag
4241
4342 setup:
43 go get -u github.com/alecthomas/gometalinter
4444 go get -u github.com/jteeuwen/go-bindata/...
4545 go-bindata -ignore=\\.DS_Store -pkg="model" -o internal/model/model.go internal/model/
4646 gometalinter --install
00 import json
1 import pathlib
1 import os
22
33 from nltk.tokenize import TreebankWordTokenizer, sent_tokenize
44
55 if __name__ == '__main__':
66 t = TreebankWordTokenizer()
7 with open(pathlib.PurePath('testdata', 'tokenize.json')) as d:
7 with open(os.path.join('testdata', 'tokenize.json')) as d:
88 data = json.load(d)
99
1010 words = []
1414 sents.append(s)
1515 words.append(t.tokenize(s))
1616
17 with open(pathlib.PurePath('testdata', 'treebank_words.json'), 'w') as f:
17 with open(os.path.join('testdata', 'treebank_words.json'), 'w') as f:
1818 json.dump(words, f, indent=4)
1919
20 with open(pathlib.PurePath('testdata', 'treebank_sents.json'), 'w') as f:
20 with open(os.path.join('testdata', 'treebank_sents.json'), 'w') as f:
2121 json.dump(sents, f, indent=4)