Skip to content
Permalink
Browse files

Add tooling for TravisCI, Codecov.io

Added npm scripts for getting coverage reports
Setup Travis yml file to support CI
  • Loading branch information...
zurawiki committed Sep 23, 2017
1 parent f730735 commit 74b08f3d83e373ec0c29166d25065ab369bd0838
Showing with 30 additions and 13 deletions.
  1. +2 −1 .gitignore
  2. +9 −0 .travis.yml
  3. +16 −11 README.md
  4. +3 −1 package.json
@@ -1,3 +1,4 @@
coverage
node_modules
.DS_Store
public_html
@@ -7,4 +8,4 @@ study.js
owntest.js
bugfixes.txt
owndata
test.js
test.js
@@ -0,0 +1,9 @@
language: node_js
node_js:
- "node"
- "6"
- "4"
script:
- npm test -- --coverage
after_success:
- bash <(curl -s https://codecov.io/bash)
@@ -1,5 +1,10 @@
# HanziJS

[![NPM version](https://img.shields.io/npm/v/hanzi.svg?style=flat-square)](https://npmjs.org/package/hanzi)
[![Build Status](https://img.shields.io/travis/nieldlr/Hanzi/master.svg?style=flat-square)](https://travis-ci.org/nieldlr/hanzi)
[![Coverage Status](https://img.shields.io/codecov/c/github/nieldlr/hanzi/master.svg?style=flat-square)](https://codecov.io/gh/nieldlr/hanzi/branch/master)
[![codecov](https://codecov.io/gh/nieldlr/Hanzi/branch/master/graph/badge.svg)](https://codecov.io/gh/nieldlr/Hanzi)

HanziJS is a Chinese character and NLP module for Chinese language processing for Node.js. It is primarily written to help provide a framework for Chinese language learners to explore Chinese.

At present features include:
@@ -37,12 +42,12 @@ hanzi.start();

#### hanzi.decompose(character, type of decomposition);

A function that takes a Chinese character and returns an object with decomposition data. Type of decomposition is optional.
A function that takes a Chinese character and returns an object with decomposition data. Type of decomposition is optional.

Type of decomposition levels:
Type of decomposition levels:

* 1 - "Once" (only decomposes character once),
* 2 - "Radical" (decomposes character into its lowest radical components),
* 1 - "Once" (only decomposes character once),
* 2 - "Radical" (decomposes character into its lowest radical components),
* 3 - "Graphical" (decomposes into lowest forms, will be mostly strokes and small indivisable units)

```javascript
@@ -70,17 +75,17 @@ A function that takes a string of characters and returns one object for all char
var decomposition = hanzi.decomposeMany('爱橄黃');
console.log(decomposition);
{ '':
{ '':
{ character: '',
components1: [ 'No glyph available', '' ],
components2: [ '', '', '𠂇', '' ],
components3: [ '', '', '𠂇', '', '' ] },
'':
'':
{ character: '',
components1: [ '', '' ],
components2: [ '', 'No glyph available', '', '' ],
components3: [ '', '', '', '', '', '', '', '丿', '', '' ] },
'':
'':
{ character: '',
components1: [ '廿', 'No glyph available' ],
components2: [ '' ],
@@ -125,7 +130,7 @@ console.log(hanzi.definitionLookup('雪'));

#### hanzi.dictionarySearch(characters, search type);

Searches the dictionary based on input. Search type changes what data it returns. Defaults to
Searches the dictionary based on input. Search type changes what data it returns. Defaults to

Search type paramaters:

@@ -282,7 +287,7 @@ console.log(hanzi.segment("我們都是陌生人。"));

#### hanzi.getPinyin(character);

Returns all possible pinyin data for a character.
Returns all possible pinyin data for a character.

```javascript
console.log(hanzi.getPinyin(''));
@@ -349,7 +354,7 @@ The object returned is organized by the possible pronunciations of the character
```javascript
console.log(hanzi.determinePhoneticRegularity(''));
{ yang2:
{ yang2:
{ character: '',
component: [ '', '', '', '', '', '' ],
phoneticpinyin: [ 'shui3', 'Yang2', 'yang2', 'shui3', 'Yang2', 'yang2' ],
@@ -374,7 +379,7 @@ HanziJS is used in the following projects:

## Contributors

* [nieldlr (Author)](http://github.com/nieldlr)
* [nieldlr (Author)](http://github.com/nieldlr)
* [djuretic](http://github.com/djuretic)
* [nikdvp](http://github.com/nikvdp)
* [hermanschaaf](http://github.com/hermanschaaf)
@@ -16,7 +16,9 @@
},
"scripts": {
"test": "jest",
"precommit": "lint-staged"
"precommit": "lint-staged",
"coverage": "npm test -- --coverage",
"postcoverage": "opn coverage/lcov-report/index.html"
},
"lint-staged": {
"{index.js,*.json,lib/*.js,test/*.js}": ["prettier --write", "git add"]

0 comments on commit 74b08f3

Please sign in to comment.
You can’t perform that action at this time.