Skip to content

Commit

Permalink
use lowercase methods
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Dec 19, 2015
1 parent 818d9a7 commit fcef020
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 46 deletions.
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ let models = {

const extend = function(m, context) {
context = context || {};

return m;
};

Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/adjective/to_adverb.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('adjective methods', function() {
['cute', 'cutely'],
];
tests.forEach(function(a) {
let adv = nlp.Adjective(a[0]);
let adv = nlp.adjective(a[0]);
(adv.to_adverb() || '').should.equal(a[1]);
});
done();
Expand All @@ -32,7 +32,7 @@ describe('adjective methods', function() {
['cute', 'cutest'],
];
tests.forEach(function(a) {
let adv = nlp.Adjective(a[0]);
let adv = nlp.adjective(a[0]);
(adv.to_superlative() || '').should.equal(a[1]);
});
done();
Expand All @@ -49,14 +49,14 @@ describe('adjective methods', function() {
['cute', 'cuter'],
];
tests.forEach(function(a) {
let adv = nlp.Adjective(a[0]);
let adv = nlp.adjective(a[0]);
(adv.to_comparative() || '').should.equal(a[1]);
});
done();
});

it('conjugate', function(done) {
let adv = nlp.Adjective('nice');
let adv = nlp.adjective('nice');
let o = adv.conjugate();
(o.comparative).should.equal('nicer');
(o.superlative).should.equal('nicest');
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/adjective/to_noun.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('adjective', function() {
['clean', 'cleanliness'],
];
tests.forEach(function(a) {
let adv = nlp.Adjective(a[0]);
let adv = nlp.adjective(a[0]);
adv.to_noun().should.equal(a[1]);
});
done();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/adverb/to_adjective.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('to_adjective', function() {
['vertically', 'vertical']
];
tests.forEach(function(a) {
let adv = nlp.Adverb(a[0]);
let adv = nlp.adverb(a[0]);
adv.to_adjective().should.equal(a[1]);
});
done();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/nouns/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('article', function() {
['ukalele', 'a'],
];
tests.forEach(function(a) {
let n = nlp.Noun(a[0]);
let n = nlp.noun(a[0]);
n.article().should.equal(a[1]);
});
done();
Expand Down
7 changes: 4 additions & 3 deletions tests/unit_tests/nouns/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('date', function () {
// ['200bc', [5, 22, 1997]],
];
tests.forEach(function (a) {
let n = nlp.Date(a[0]);
let n = nlp.date(a[0]);
let w = a[1];
let d = n.date();
d.getMonth().should.equal(w[0]);
Expand All @@ -43,6 +43,7 @@ describe('date', function () {
});
done();
});

it('partial dates', function (done) {
let tests = [
['3rd of March 1969', [2, 3, 1969]],
Expand All @@ -63,7 +64,7 @@ describe('date', function () {
['jan 1921', [0, null, 1921]],
];
tests.forEach(function (a) {
let n = nlp.Date(a[0]);
let n = nlp.date(a[0]);
let w = a[1];
let o = n.data;
(o.month || '').should.equal(w[0] || '');
Expand All @@ -80,7 +81,7 @@ describe('date', function () {
['January 5th 4032', [0, 5, null]],
];
tests.forEach(function (a) {
let n = nlp.Date(a[0]);
let n = nlp.date(a[0]);
let w = a[1];
let o = n.data;
(o.month || '').should.equal(w[0] || '');
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/nouns/to_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ let tests = [
describe('to noun', function() {
it('text to noun', function(done) {
tests.forEach(function(a) {
let v = nlp.Value(a[0]);
let v = nlp.value(a[0]);
(v.number || '').should.equal(a[1] || '');
});
done();
Expand Down
22 changes: 11 additions & 11 deletions tests/unit_tests/sentence/lumper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('lumper test', function() {
['joe had 5 books', ['Person', 'PastTense', 'Value']],
];
tests.forEach(function(a) {
let n = nlp.Text(a[0]);
let n = nlp.text(a[0]);
let tags = n.tags()[0];
(a[1]).should.deepEqual(tags);
});
Expand All @@ -27,16 +27,16 @@ describe('lumper test', function() {

it('contractions', function(done) {

nlp.Text('he\'s fun').terms()[1].normal.should.equal('is');
nlp.Text('she\'s walking').terms()[1].normal.should.equal('is');
nlp.Text('where\'s waldo').terms()[1].normal.should.equal('is');
nlp.Text('where\'s he going?').terms()[1].normal.should.equal('is');
nlp.Text('where\'s the pencil?').terms()[1].normal.should.equal('is');
nlp.Text('he\'s walked').terms()[1].normal.should.equal('has');
nlp.Text('it\'s got the best features').terms()[1].normal.should.equal('has');
nlp.Text('it\'s achieved each goal').terms()[1].normal.should.equal('has');
nlp.Text('where\'s he disappeared to?').terms()[1].normal.should.equal('has');
nlp.Text('where\'s the pencil disappeared to?').terms()[1].normal.should.equal('has');
nlp.text('he\'s fun').terms()[1].normal.should.equal('is');
nlp.text('she\'s walking').terms()[1].normal.should.equal('is');
nlp.text('where\'s waldo').terms()[1].normal.should.equal('is');
nlp.text('where\'s he going?').terms()[1].normal.should.equal('is');
nlp.text('where\'s the pencil?').terms()[1].normal.should.equal('is');
nlp.text('he\'s walked').terms()[1].normal.should.equal('has');
nlp.text('it\'s got the best features').terms()[1].normal.should.equal('has');
nlp.text('it\'s achieved each goal').terms()[1].normal.should.equal('has');
nlp.text('where\'s he disappeared to?').terms()[1].normal.should.equal('has');
nlp.text('where\'s the pencil disappeared to?').terms()[1].normal.should.equal('has');
done();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/sentence/manipulations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Sentence Manipulation Methods', function() {
['he is quick', 'he was quick', 'he will be quick'],
];
tests.forEach(function(a) {
let s = nlp.Text(a[0]);
let s = nlp.text(a[0]);
s.to_past();
s.text().should.equal(a[1]);
s.to_future();
Expand Down
16 changes: 8 additions & 8 deletions tests/unit_tests/sentence/sentence.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let nlp = require('../../../src/index.js');
describe('Sentence Class Methods', function() {

it('Basic', function(done) {
let sen = nlp.Text('Hello World').sentences[0];
let sen = nlp.text('Hello World').sentences[0];
let methods = [
'terminator',
'text',
Expand All @@ -25,7 +25,7 @@ describe('Sentence Class Methods', function() {
['Tony is okay', '.']
];
tests.forEach(function(a) {
let s = nlp.Text(a[0]).sentences[0];
let s = nlp.text(a[0]).sentences[0];
s.terminator().should.eql(a[1]);
});
done();
Expand All @@ -40,7 +40,7 @@ describe('Sentence Class Methods', function() {
];

tests.forEach(function(a) {
let people = nlp.Text(a[0]).people();
let people = nlp.text(a[0]).people();
people = people.map(function(t) {
return t.text;
});
Expand All @@ -57,7 +57,7 @@ describe('Sentence Class Methods', function() {
];

tests.forEach(function(a) {
let arr = nlp.Text(a[0]).places();
let arr = nlp.text(a[0]).places();
arr = arr.map(function(t) {
return t.text;
});
Expand All @@ -74,7 +74,7 @@ describe('Sentence Class Methods', function() {
];

tests.forEach(function(a) {
let arr = nlp.Text(a[0]).dates();
let arr = nlp.text(a[0]).dates();
arr = arr.map(function(t) {
return t.text;
});
Expand All @@ -92,7 +92,7 @@ describe('Sentence Class Methods', function() {
];

tests.forEach(function(a) {
let arr = nlp.Text(a[0]).values();
let arr = nlp.text(a[0]).values();
arr = arr.map(function(t) {
return t.text;
});
Expand All @@ -110,7 +110,7 @@ describe('Sentence Class Methods', function() {
];

tests.forEach(function(a) {
let arr = nlp.Text(a[0]).organisations();
let arr = nlp.text(a[0]).organisations();
arr = arr.map(function(t) {
return t.text;
});
Expand All @@ -127,7 +127,7 @@ describe('Sentence Class Methods', function() {
];

tests.forEach(function(a) {
let bool = nlp.Sentence(a[0]).is_passive();
let bool = nlp.sentence(a[0]).is_passive();
(bool).should.eql(a[1]);
});
done();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/sentence/tagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('pos tag', function() {
['He is in Canada', ['Person', 'Copula', 'Preposition', 'Place']],
];
tests.forEach(function(a) {
let n = nlp.Text(a[0]);
let n = nlp.text(a[0]);
let tags = n.tags()[0];
(a[1]).should.deepEqual(tags);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/text/ngram_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('ngram', function() {
['55 and 55', '55', 2],
];
tests.forEach(function(a) {
let n = nlp.Text(a[0]);
let n = nlp.text(a[0]);
let topgram = n.ngram()[0][0];
topgram.word.should.equal(a[1]);
topgram.count.should.equal(a[2]);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/tokenize/sentence.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('tokenize sentence tests', function() {
['I made $5.60 today in 1 hour of work. The E.M.T.\'s were on time, but only barely.', 2]
];
tests.forEach(function(a) {
let n = nlp.Text(a[0]);
let n = nlp.text(a[0]);
n.sentences.should.have.length(a[1]);
});
done();
Expand Down
20 changes: 10 additions & 10 deletions tests/unit_tests/verbs/conjugate.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,79 +147,79 @@ let verbs = [{
describe('verb conjugate', function() {
it('infinitive stays infinitive', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.infinitive).conjugate();
let c = nlp.verb(o.infinitive).conjugate();
(c.infinitive).should.equal(o.infinitive);
});
done();
});

it('infinitive becomes past', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.infinitive).conjugate();
let c = nlp.verb(o.infinitive).conjugate();
(c.past).should.equal(o.past);
});
done();
});

it('infinitive becomes present', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.infinitive).conjugate();
let c = nlp.verb(o.infinitive).conjugate();
(c.present).should.equal(o.present);
});
done();
});

it('infinitive becomes gerund', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.infinitive).conjugate();
let c = nlp.verb(o.infinitive).conjugate();
(c.gerund).should.equal(o.gerund);
});
done();
});

it('past stays past', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.past).conjugate();
let c = nlp.verb(o.past).conjugate();
(c.past).should.equal(o.past);
});
done();
});

it('past becomes present', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.past).conjugate();
let c = nlp.verb(o.past).conjugate();
(c.present).should.equal(o.present);
});
done();
});

it('past becomes gerund', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.past).conjugate();
let c = nlp.verb(o.past).conjugate();
(c.gerund).should.equal(o.gerund);
});
done();
});

it('present stays present', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.present).conjugate();
let c = nlp.verb(o.present).conjugate();
(c.present).should.equal(o.present);
});
done();
});

it('present becomes past', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.present).conjugate();
let c = nlp.verb(o.present).conjugate();
(c.past).should.equal(o.past);
});
done();
});

it('present becomes gerund', function(done) {
verbs.forEach(function(o) {
let c = nlp.Verb(o.present).conjugate();
let c = nlp.verb(o.present).conjugate();
(c.gerund).should.equal(o.gerund);
});
done();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/verbs/negate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('verb negate', function() {
];

tests.forEach(function(a) {
let n = nlp.Text(a[0]);
let n = nlp.text(a[0]);
it(a[1], function(done) {
n.terms()[0].negate().should.equal(a[1]);
done();
Expand Down

0 comments on commit fcef020

Please sign in to comment.