Skip to content

Commit

Permalink
Merge ce6b912 into c712299
Browse files Browse the repository at this point in the history
  • Loading branch information
hotoo committed Apr 11, 2021
2 parents c712299 + ce6b912 commit 408fce4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 93 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/node.js.yml
Expand Up @@ -25,7 +25,13 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
- run: npm run test-npm && cat coverage/lcov.info | coveralls
- run: npm run test-npm
- run: npm run test-cli
- run: npm run benchmark

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

23 changes: 3 additions & 20 deletions Makefile
@@ -1,27 +1,13 @@
version = $(shell cat package.json | grep version | awk -F'"' '{print $$4}')

install:
@spm install
@npm install

build:
@spm build

publish:
@npm publish
@git tag $(version)
@git push origin $(version)

build-doc: clean build
@spm doc build

watch:
@spm doc watch

publish-doc: clean build-doc
@ghp-import _site
@git push origin gh-pages

clean:
@rm -fr _site

Expand All @@ -32,7 +18,7 @@ benchmark:
@node tests/benchmark.test.js

test-cli:
@mocha -R spec --timeout 5000 tests/cli.test.js
@./node_modules/.bin/mocha -R spec --timeout 5000 tests/cli.test.js

test-npm:
@./node_modules/.bin/istanbul cover \
Expand All @@ -45,16 +31,13 @@ test-npm:
./tests/test.js


test-spm:
@spm test

lint:
@./node_modules/eslint/bin/eslint.js ./lib/ ./bin/ ./tests/

test: lint test-npm test-cli benchmark

output = _site/coverage.html
coverage: build-doc
coverage:
@rm -fr _site/src-cov
@jscoverage --encoding=utf8 src _site/src-cov
@mocha-browser ${runner}?cov -S -R html-cov > ${output}
Expand Down Expand Up @@ -83,4 +66,4 @@ dict-node:
infrequent:
@node ./tools/infrequent.js > ./tools/zi/infrequent.js

.PHONY: build-doc publish-doc server clean test coverage test-spm test-npm test-cli lint benchmark
.PHONY: server clean test coverage test-npm test-cli lint benchmark
4 changes: 2 additions & 2 deletions data/dict-zi.js
Expand Up @@ -27867,7 +27867,7 @@ dict[0x2145e] = "suì"; /* ᑞ */
dict[0x2145f] = "wō"; /* ᑟ */
dict[0x21462] = "dié"; /* ᑢ */
dict[0x21463] = "kū"; /* ᑣ */
dict[0x21464] = "luǒ,yíng "; /* ᑤ */
dict[0x21464] = "luǒ,yíng"; /* ᑤ */
dict[0x2146f] = "jiǎn"; /* ᑯ */
dict[0x21476] = "jiǎng"; /* ᑶ */
dict[0x2147b] = "zhuì"; /* ᑻ */
Expand Down Expand Up @@ -30976,7 +30976,7 @@ dict[0x23aaf] = "tóng"; /* 㪯 */
dict[0x23ab6] = "shǎn"; /* 㪶 */
dict[0x23ab8] = "gù"; /* 㪸 */
dict[0x23ab9] = "què"; /* 㪹 */
dict[0x23aba] = "hú "; /* 㪺 */
dict[0x23aba] = "hú"; /* 㪺 */
dict[0x23ac0] = "gǔ"; /* 㫀 */
dict[0x23ac5] = "hú"; /* 㫅 */
dict[0x23ac6] = "shēng"; /* 㫆 */
Expand Down
38 changes: 19 additions & 19 deletions data/phrases-dict.js
Expand Up @@ -17531,7 +17531,7 @@ module.exports = {
"暗绿稀红": [["àn"], ["lǜ"], ["xī"], ["hóng"]],
"暗射地图": [["àn"], ["shè"], ["dì"], ["tú"]],
"暗室不欺": [["àn"], ["shì"], ["bù"], ["qī"]],
"昂昂自若": [["áng"], ["áng"], ["zì"], ["roò"]],
"昂昂自若": [["áng"], ["áng"], ["zì"], ["ruò"]],
"暗中摸索": [["àn"], ["zhōng"], ["mō"], ["suǒ"]],
"昂藏七尺": [["áng"], ["cáng"], ["qī"], ["chǐ"]],
"昂然自若": [["áng"], ["rán"], ["zì"], ["ruò"]],
Expand Down Expand Up @@ -18455,7 +18455,7 @@ module.exports = {
"别动队": [["bié"], ["dòng"], ["duì"]],
"别风淮雨": [["bié"], ["fēng"], ["huái"], ["yǔ"]],
"别鹤孤鸾": [["bié"], ["hè"], ["gū"], ["luán"]],
"别鹤离鸾": [["bié"], ["hè"], ["lí"], ["láun"]],
"别鹤离鸾": [["bié"], ["hè"], ["lí"], ["luán"]],
"别籍异财": [["bié"], ["jí"], ["yì"], ["cái"]],
"别籍异居": [["bié"], ["jí"], ["yì"], ["jū"]],
"别居异财": [["bié"], ["jū"], ["yì"], ["cái"]],
Expand Down Expand Up @@ -19063,7 +19063,7 @@ module.exports = {
"不平等条约": [["bù"], ["píng"], ["děng"], ["tiáo"], ["yuē"]],
"不平则鸣": [["bù"], ["píng"], ["zé"], ["míng"]],
"不期而会": [["bù"], ["qī"], ["ér"], ["huì"]],
"不破不立": [["bù"], ["può"], ["bù"], ["lì"]],
"不破不立": [["bù"], [""], ["bù"], ["lì"]],
"不期而然": [["bù"], ["qī"], ["ér"], ["rán"]],
"不期而同": [["bù"], ["qī"], ["ér"], ["tóng"]],
"不期而遇": [["bù"], ["qī"], ["ér"], ["yù"]],
Expand Down Expand Up @@ -19468,7 +19468,7 @@ module.exports = {
"餐风宿雨": [["cān"], ["fēng"], ["sù"], ["yǔ"]],
"餐风咽露": [["cān"], ["fēng"], ["yàn"], ["lù"]],
"餐风饮露": [["cān"], ["fēng"], ["yǐn"], ["lù"]],
"餐松啖柏": [["cān"], ["sōng"], ["dàn"], ["biǎ"]],
"餐松啖柏": [["cān"], ["sōng"], ["dàn"], ["bǎi"]],
"餐葩饮露": [["cān"], ["pā"], ["yǐn"], ["lù"]],
"餐霞吸露": [["cān"], ["xiá"], ["xī"], ["lù"]],
"餐霞饮景": [["cān"], ["xiá"], ["yǐn"], ["jǐng"]],
Expand Down Expand Up @@ -19519,7 +19519,7 @@ module.exports = {
"藏之名山": [["cáng"], ["zhī"], ["míng"], ["shān"]],
"藏诸名山": [["cáng"], ["zhū"], ["míng"], ["shān"]],
"藏踪蹑迹": [["cáng"], ["zōng"], ["niè"], ["jī"]],
"操戈同室": [["cāo"], ["gē"], ["tóon"], ["shì"]],
"操戈同室": [["cāo"], ["gē"], ["tóng"], ["shì"]],
"操奇计赢": [["cāo"], ["qí"], ["jì"], ["yíng"]],
"操奇逐赢": [["cāo"], ["qì"], ["zhù"], ["yíng"]],
"操揉磨治": [["cāo"], ["róu"], ["mó"], ["zhì"]],
Expand Down Expand Up @@ -21810,7 +21810,7 @@ module.exports = {
"地主之仪": [["dì"], ["zhǔ"], ["zhī"], ["yí"]],
"地主之谊": [["dì"], ["zhǔ"], ["zhī"], ["yì"]],
"弟男子侄": [["dì"], ["nán"], ["zǐ"], ["zhí"]],
"帝王将相": [["dì"], ["wáng"], ["jiòn"], ["xiàng"]],
"帝王将相": [["dì"], ["wáng"], ["jiàng"], ["xiàng"]],
"递条子": [["dì"], ["tiáo"], ["zi"]],
"递兴递废": [["dì"], ["xīng"], ["dì"], ["fèi"]],
"第二信号系统": [["dì"], ["èr"], ["xìn"], ["hào"], ["xì"], ["tǒng"]],
Expand Down Expand Up @@ -22962,7 +22962,7 @@ module.exports = {
"飞鸿雪爪": [["fēi"], ["hóng"], ["xuě"], ["zhǎo"]],
"飞机场": [["fēi"], ["jī"], ["chǎng"]],
"飞将军": [["fēi"], ["jiàng"], ["jūn"]],
"飞将数奇": [[""], ["jiàng"], ["shù"], ["jī"]],
"飞将数奇": [["fēi"], ["jiàng"], ["shù"], ["jī"]],
"飞流短长": [["fēi"], ["liú"], ["duǎn"], ["cháng"]],
"飞来横祸": [["fēi"], ["lái"], ["hèng"], ["huò"]],
"飞龙乘云": [["fēi"], ["lóng"], ["chéng"], ["yún"]],
Expand Down Expand Up @@ -23347,7 +23347,7 @@ module.exports = {
"风语不透": [["fēng"], ["yǔ"], ["bù"], ["tòu"]],
"风月无涯": [["fēng"], ["yuè"], ["wú"], ["yá"]],
"风月无边": [["fēng"], ["yuè"], ["wú"], ["biān"]],
"风云变幻": [["fēng"], ["yún"], ["bià"], ["huàn"]],
"风云变幻": [["fēng"], ["yún"], ["biàn"], ["huàn"]],
"风云变态": [["fēng"], ["yún"], ["biàn"], ["tài"]],
"风云不测": [["fēng"], ["yún"], ["bù"], ["cè"]],
"风云际会": [["fēng"], ["yún"], ["jì"], ["huì"]],
Expand Down Expand Up @@ -24262,7 +24262,7 @@ module.exports = {
"躬自菲薄": [["gōng"], ["zì"], ["fěi"], ["bó"]],
"龚行天罚": [["gōng"], ["xíng"], ["tiān"], ["fá"]],
"觥饭不及壶飧": [["gōng"], ["fàn"], ["bù"], ["jí"], ["hú"], ["sūn"]],
"拱肩缩背": [["gǒng"], ["jān"], ["suō"], ["bèi"]],
"拱肩缩背": [["gǒng"], ["jiān"], ["suō"], ["bèi"]],
"汞溴红": [["gǒng"], ["xiù"], ["hóng"]],
"拱手而降": [["gǒng"], ["shòu"], ["ér"], ["xiáng"]],
"共产党": [["gòng"], ["chǎn"], ["dǎng"]],
Expand Down Expand Up @@ -26270,7 +26270,7 @@ module.exports = {
"几起几落": [["jǐ"], ["qǐ"], ["jǐ"], ["luò"]],
"己饥己溺": [["jǐ"], ["jī"], ["jǐ"], ["nì"]],
"己溺己饥": [["jǐ"], ["nì"], ["jǐ"], ["jī"]],
"虮虱相吊": [["jǐ"], ["shī"], ["xiēng"], ["diào"]],
"虮虱相吊": [["jǐ"], ["shī"], ["xiāng"], ["diào"]],
"挤眉溜眼": [["jǐ"], ["méi"], ["liū"], ["yǎn"]],
"挤眉弄眼": [["jǐ"], ["méi"], ["nòng"], ["yǎn"]],
"挤牙膏": [["jǐ"], ["yá"], ["gāo"]],
Expand Down Expand Up @@ -30262,7 +30262,7 @@ module.exports = {
"年富力强": [["nián"], ["fù"], ["lì"], ["qiáng"]],
"年高望重": [["nián"], ["gāo"], ["wàng"], ["zhòng"]],
"年谷不登": [["nián"], ["gǔ"], ["bù"], ["dēng"]],
"年华垂暮": [["nián"], ["huá"], ["thuí"], ["mù"]],
"年华垂暮": [["nián"], ["huá"], ["chuí"], ["mù"]],
"年老体弱": [["nián"], ["lǎo"], ["tǐ"], ["ruò"]],
"年衰岁暮": [["nián"], ["shuāi"], ["suì"], ["mù"]],
"年头月尾": [["nián"], ["tóu"], ["yuè"], ["wěi"]],
Expand Down Expand Up @@ -30714,7 +30714,7 @@ module.exports = {
"片语只辞": [["piàn"], ["yán"], ["zhǐ"], ["cí"]],
"片云遮顶": [["piàn"], ["yún"], ["zhē"], ["dǐng"]],
"片纸只字": [["piàn"], ["zhǐ"], ["yán"], ["zì"]],
"偏听偏信": [["piān"], ["tīng"], ["piāng"], ["xìn"]],
"偏听偏信": [["piān"], ["tīng"], ["piān"], ["xìn"]],
"偏信则暗": [["piān"], ["xìn"], ["zé"], ["àn"]],
"翩翩风度": [["piān"], ["piān"], ["fēng"], ["dù"]],
"翩翩年少": [["piān"], ["piān"], ["nián"], ["shǎo"]],
Expand Down Expand Up @@ -31896,7 +31896,7 @@ module.exports = {
"缺衣少食": [["quē"], ["yī"], ["shǎo"], ["shí"]],
"缺食无衣": [["quē"], ["shí"], ["wú"], ["yī"]],
"缺一不可": [["quē"], ["yī"], ["bù"], ["kě"]],
"缺吃少穿": [["quē"], ["chī"], ["xhǎo"], ["chuān"]],
"缺吃少穿": [["quē"], ["chī"], ["shǎo"], ["chuān"]],
"却老还童": [["què"], ["lǎo"], ["huán"], ["tóng"]],
"却之不恭": [["què"], ["zhī"], ["bù"], ["gōng"]],
"雀马鱼龙": [["què"], ["mǎ"], ["yú"], ["lóng"]],
Expand Down Expand Up @@ -33214,7 +33214,7 @@ module.exports = {
"剩馥残膏": [["shèng"], ["fù"], ["cán"], ["gāo"]],
"剩余价值": [["shèng"], ["yú"], ["jià"], ["zhí"]],
"尸横遍野": [["shī"], ["héng"], ["biàn"], ["yě"]],
"失败为成功之母": [["shī"], ["bài"], ["wéi"], ["chéng"], ["gōng"], ["zhī"], ["m"]],
"失败为成功之母": [["shī"], ["bài"], ["wéi"], ["chéng"], ["gōng"], ["zhī"], [""]],
"尸居龙见": [["shī"], ["jū"], ["lóng"], ["xiàn"]],
"尸山血海": [["shī"], ["shān"], ["xuè"], ["hǎi"]],
"失道寡助": [["shī"], ["dào"], ["guǎ"], ["zhù"]],
Expand Down Expand Up @@ -34030,7 +34030,7 @@ module.exports = {
"思想性": [["sī"], ["xiǎng"], ["xìng"]],
"思绪万千": [["sī"], ["xù"], ["wàn"], ["qiān"]],
"斯德哥尔摩": [["sī"], ["dé"], ["gē"], ["ěr"], ["mó"]],
"斯事体大": [["ī"], ["shì"], ["tǐ"], ["dà"]],
"斯事体大": [[""], ["shì"], ["tǐ"], ["dà"]],
"斯文扫地": [["sī"], ["wén"], ["sǎo"], ["dì"]],
"缌麻服": [["sī"], ["má"], ["fú"]],
"撕心裂肺": [["sī"], ["xīn"], ["liè"], ["fèi"]],
Expand Down Expand Up @@ -35572,7 +35572,7 @@ module.exports = {
"味如鸡肋": [["wèi"], ["rú"], ["jī"], ["lèi"]],
"味如嚼蜡": [["wèi"], ["rú"], ["jiáo"], ["là"]],
"味同嚼蜡": [["wèi"], ["tóng"], ["jiáo"], ["là"]],
"畏首畏尾": [["wèi"], ["shǒ"], ["wèi"], ["wěi"]],
"畏首畏尾": [["wèi"], ["shǒu"], ["wèi"], ["wěi"]],
"畏缩不前": [["wèi"], ["suō"], ["bù"], ["qián"]],
"畏葸不前": [["wèi"], ["xǐ"], ["bù"], ["qián"]],
"畏影恶迹": [["wèi"], ["yǐng"], ["è"], ["jì"]],
Expand Down Expand Up @@ -39961,7 +39961,7 @@ module.exports = {
"支策据梧": [["zhī"], ["cè"], ["jù"], ["wú"]],
"支分节解": [["zhī"], ["fēn"], ["jié"], ["jiě"]],
"支纷节解": [["zhī"], ["fēn"], ["jié"], ["jiě"]],
"支分族解": [["zhī"], [""], ["zú"], ["jiě"]],
"支分族解": [["zhī"], ["fēn"], ["zú"], ["jiě"]],
"支委会": [["zhī"], ["wěi"], ["huì"]],
"支吾其词": [["zhī"], ["wū"], ["qí"], ["cí"]],
"支支吾吾": [["zhī"], ["zhī"], ["wú"], ["wú"]],
Expand All @@ -39983,15 +39983,15 @@ module.exports = {
"枝附叶著": [["zhī"], ["fù"], ["yiè"], ["zhuó"]],
"枝附叶着": [["zhī"], ["fù"], ["yiè"], ["zhuó"]],
"枝附影从": [["zhī"], ["fù"], ["yǐng"], ["cóng"]],
"枝干相持": [["zhī"], ["gàn"], ["xiāng"], ["xhí"]],
"枝干相持": [["zhī"], ["gàn"], ["xiāng"], ["chí"]],
"枝节横生": [["zhī"], ["jié"], ["héng"], ["shēng"]],
"枝流叶布": [["zhī"], ["liú"], ["yè"], ["bù"]],
"枝末生根": [["zhī"], ["mò"], ["shēng"], ["gēn"]],
"枝外生枝": [["zhī"], ["wài"], ["shēng"], ["zhī"]],
"枝叶扶疏": [["zhī"], ["yè"], ["fú"], ["shū"]],
"枝叶扶苏": [["zhī"], ["yè"], ["fú"], ["sū"]],
"枝源派本": [["zhī"], ["yuán"], ["pài"], ["běn"]],
"枝叶相持": [["zhī"], ["yè"], ["xīng"], ["chí"]],
"枝叶相持": [["zhī"], ["yè"], ["xiāng"], ["chí"]],
"枝枝节节": [["zhī"], ["zhī"], ["jié"], ["jié"]],
"知白守黑": [["zhī"], ["bái"], ["shǒu"], ["hēi"]],
"知彼知己": [["zhī"], ["bǐ"], ["zhī"], ["jǐ"]],
Expand Down
26 changes: 8 additions & 18 deletions package.json
Expand Up @@ -19,6 +19,7 @@
"homepage": "http://pinyin.hotoo.me/",
"author": "闲耘 <hotoo.cn@gmail.com>",
"main": "lib/index.js",
"browser": "lib/web-pinyin.js",
"bin": {
"pinyin": "./bin/pinyin"
},
Expand All @@ -34,37 +35,26 @@
"url": "https://github.com/hotoo/pinyin/issues"
},
"scripts": {
"test": "make test"
"lint": "eslint ./lib/ ./bin/ ./tests/",
"test-cli": "mocha -R spec --timeout 5000 tests/cli.test.js",
"test-npm": "istanbul cover _mocha -- --harmony --reporter spec --timeout 2000 --inline-diffs ./tests/test.js",
"benchmark": "node tests/benchmark.test.js",
"test": "npm run lint && npm run test-cli && npm run test-npm && npm run benchmark"
},
"dependencies": {
"commander": "~1.1.1",
"object-assign": "^4.0.1"
},
"peerDependencies": {
"optionalDependencies": {
"nodejieba": "^2.2.1"
},
"devDependencies": {
"benchmark": "~1.0.0",
"eslint": "~0.24.0",
"expect.js": "~0.3.1",
"istanbul": "~0.3.17",
"mocha": "1.17.1",
"mocha": "^8.3.2",
"request": "~2.68.0"
},
"spm": {
"main": "lib/web-pinyin.js",
"devDependencies": {
"expect.js": "0.3.1",
"url": "1.2.0"
},
"build": {
"babel": {}
},
"tests": "tests/*-spec.js",
"dependencies": {
"object-assign": "~4.0.1"
}
},
"browser": "lib/web-pinyin.js",
"license": "MIT"
}

0 comments on commit 408fce4

Please sign in to comment.