Socket
Socket
Sign inDemoInstall

compromise

Package Overview
Dependencies
Maintainers
2
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compromise - npm Package Compare versions

Comparing version 7.0.16 to 7.0.17

126

docs/generic.js

@@ -0,1 +1,3 @@

'use strict';
//methods on the generic Result prototype

@@ -6,5 +8,4 @@ module.exports = {

desc: 'return a handy array of meta-data for this subset. Default subset is sentences, but it can be anything.',
example: `nlp('The stage was set for the Alan Parsons Project! Which I believe was some sort of hovercraft.').data()
//[{normal:'the stage was set...'}]`,
returns: 'array',
example: 'nlp(\'The stage was set for the Alan Parsons Project! Which I believe was some sort of hovercraft.\').data()\n//[{normal:\'the stage was set...\'}]',
returns: 'array'
},

@@ -14,4 +15,3 @@ found: {

returns: 'bool',
example: `nlp('oh say can you see?').match('see').found
//true`
example: 'nlp(\'oh say can you see?\').match(\'see\').found\n//true'
},

@@ -21,4 +21,3 @@ all: {

returns: 'Text',
example: `nlp('this is yelling').verbs().toTitleCase().all().out()
//this IS yelling`
example: 'nlp(\'this is yelling\').verbs().toTitleCase().all().out()\n//this IS yelling'
},

@@ -28,3 +27,3 @@ debug: {

returns: 'Text',
example: `nlp('wayne’s world, party time, excellent- weeeyooweeeyoo!').debug().out()`
example: 'nlp(\'wayne\u2019s world, party time, excellent- weeeyooweeeyoo!\').debug().out()'
},

@@ -34,4 +33,3 @@ out: {

returns: 'Text',
example: `nlp('you might say there’s a little Uter in all of us').match('#Adjective uter').out('html')
//<span><span class="nl-Adjective">little</span>&nbsp;<span class="nl-Person nl-FirstName">Uter</span></span>`
example: 'nlp(\'you might say there\u2019s a little Uter in all of us\').match(\'#Adjective uter\').out(\'html\')\n//<span><span class="nl-Adjective">little</span>&nbsp;<span class="nl-Person nl-FirstName">Uter</span></span>'
},

@@ -41,4 +39,3 @@ whitespace: {

returns: 'Text',
example: `nlp('We like Roy! We like Roy!').whitespace.before(' ').out()
//We like Roy! We like Roy!`
example: 'nlp(\'We like Roy! We like Roy!\').whitespace.before(\' \').out()\n//We like Roy! We like Roy!'
},

@@ -48,5 +45,4 @@ normalize: {

returns: 'Text',
example: `nlp(' so... you like DONUTS? have all the donuts in the WORLD!!!').normalize().sentences(0).out()
//So you like donuts?`
},
example: 'nlp(\' so... you like DONUTS? have all the donuts in the WORLD!!!\').normalize().sentences(0).out()\n//So you like donuts?'
}
},

@@ -57,4 +53,3 @@ array: {

returns: 'Text',
example: `nlp('would somebody please think of the children').clone().toUpperCase().parent.out()
//would somebody please think of the children`
example: 'nlp(\'would somebody please think of the children\').clone().toUpperCase().parent.out()\n//would somebody please think of the children'
},

@@ -64,4 +59,3 @@ length: {

returns: 'int',
example: `nlp('jackie kennedy and aristotle onassis').people().length
//2`
example: 'nlp(\'jackie kennedy and aristotle onassis\').people().length\n//2'
},

@@ -71,4 +65,3 @@ slice: {

returns: 'Text',
example: `nlp('Homer, have you been eating that sandwich again?').terms().slice(0, 3).out()
//Homer, have you`
example: 'nlp(\'Homer, have you been eating that sandwich again?\').terms().slice(0, 3).out()\n//Homer, have you'
},

@@ -78,4 +71,3 @@ sort: {

returns: 'Text',
example: `nlp('Larry, Curly, and Moe').people().sort('alphabetical').out('array')
//Curly, Larry, Moe`
example: 'nlp(\'Larry, Curly, and Moe\').people().sort(\'alphabetical\').out(\'array\')\n//Curly, Larry, Moe'
},

@@ -85,4 +77,3 @@ concat: {

returns: 'Text',
example: `nlp('My name is Otto.').concat(nlp('i love to get blotto')).length()
//2`
example: 'nlp(\'My name is Otto.\').concat(nlp(\'i love to get blotto\')).length()\n//2'
},

@@ -92,5 +83,4 @@ flatten: {

returns: 'Text',
example: `nlp('sex cauldron? I thought they closed that place down.').flatten().length()
//1`
},
example: 'nlp(\'sex cauldron? I thought they closed that place down.\').flatten().length()\n//1'
}
},

@@ -102,4 +92,3 @@

returns: 'Text',
example: `nlp('jupiter, pluto and mars').nouns().toTitleCase().all().out()
//Jupiter, Pluto and Mars.`
example: 'nlp(\'jupiter, pluto and mars\').nouns().toTitleCase().all().out()\n//Jupiter, Pluto and Mars.'
},

@@ -109,4 +98,3 @@ toUpperCase: {

returns: 'Text',
example: `nlp('Dental plan. Lisa needs braces.').match('dental .').toUpperCase().out()
//DENTAL PLAN.`
example: 'nlp(\'Dental plan. Lisa needs braces.\').match(\'dental .\').toUpperCase().out()\n//DENTAL PLAN.'
},

@@ -116,4 +104,3 @@ toLowerCase: {

returns: 'Text',
example: `nlp('Careful! They’re RUFFLED!!').toLowerCase().out()
//careful! they’re ruffled!!`
example: 'nlp(\'Careful! They\u2019re RUFFLED!!\').toLowerCase().out()\n//careful! they\u2019re ruffled!!'
},

@@ -123,5 +110,4 @@ toCamelCase: {

returns: 'Text',
example: `nlp('natural language processing').toCamelCase().out()
//NaturalLanguageProcessing`
},
example: 'nlp(\'natural language processing\').toCamelCase().out()\n//NaturalLanguageProcessing'
}
},

@@ -132,4 +118,3 @@ punctuation: {

returns: 'Text',
example: `nlp('natural language processing').hyphenate().out()
//natural-language-processing`
example: 'nlp(\'natural language processing\').hyphenate().out()\n//natural-language-processing'
},

@@ -139,5 +124,4 @@ dehyphenate: {

returns: 'Text',
example: `nlp('natural-language processing').dehyphenate().out()
//natural language processing`
},
example: 'nlp(\'natural-language processing\').dehyphenate().out()\n//natural language processing'
}

@@ -150,4 +134,3 @@ },

returns: 'Text',
example: `nlp('stupid flanders').match('flanders').insertBefore('sexy').all().out()
//stupid sexy flanders`
example: 'nlp(\'stupid flanders\').match(\'flanders\').insertBefore(\'sexy\').all().out()\n//stupid sexy flanders'
},

@@ -157,4 +140,3 @@ insertAfter: {

returns: 'Text',
example: `nlp('i know so many words').insertAfter('bigly').all().out()
//i know so many words bigly`
example: 'nlp(\'i know so many words\').insertAfter(\'bigly\').all().out()\n//i know so many words bigly'
},

@@ -164,5 +146,4 @@ insertAt: {

returns: 'Text',
example: `nlp('so you are from Africa?').insertAt(2, 'like,').all().out()
//so you are like, from africa?`
},
example: 'nlp(\'so you are from Africa?\').insertAt(2, \'like,\').all().out()\n//so you are like, from africa?'
}
},

@@ -174,4 +155,3 @@

returns: 'Text',
example: `nlp('it was the worst of times').match('worst').replaceWith('blurst').all().out()
//it was the blurst of times`
example: 'nlp(\'it was the worst of times\').match(\'worst\').replaceWith(\'blurst\').all().out()\n//it was the blurst of times'
},

@@ -181,4 +161,3 @@ replace: {

returns: 'Text',
example: `nlp('trust me folks, big league.').replace('big league','bigly').all().out()
//trust me folks, bigly.`
example: 'nlp(\'trust me folks, big league.\').replace(\'big league\',\'bigly\').all().out()\n//trust me folks, bigly.'
},

@@ -188,5 +167,4 @@ delete: {

returns: 'Text',
example: `nlp('you don’t win friends with salad').delete('do not').out()
//you win friends with salad`
},
example: 'nlp(\'you don\u2019t win friends with salad\').delete(\'do not\').out()\n//you win friends with salad'
}
},

@@ -198,4 +176,3 @@

returns: 'Text',
example: `nlp('we understand, we are from the land of chocolate.').match('land of #Noun').out()
//land of chocolate`
example: 'nlp(\'we understand, we are from the land of chocolate.\').match(\'land of #Noun\').out()\n//land of chocolate'
},

@@ -205,4 +182,3 @@ not: {

returns: 'Text',
example: `nlp('wait, there’s a new mexico?').places().not('new').out()
//mexico`
example: 'nlp(\'wait, there\u2019s a new mexico?\').places().not(\'new\').out()\n//mexico'
},

@@ -212,4 +188,3 @@ if: {

returns: 'Text',
example: `nlp('We’re here, we’re clear, we don’t want anymore bears.').clauses().if('anymore').out()
//we don't want anymore bears`
example: 'nlp(\'We\u2019re here, we\u2019re clear, we don\u2019t want anymore bears.\').clauses().if(\'anymore\').out()\n//we don\'t want anymore bears'
},

@@ -219,9 +194,6 @@ ifNo: {

returns: 'Text',
example: `nlp('We’re here, we’re clear, we don’t want anymore bears.').clauses().ifNo('anymore').out()
//We're here, we're clear,`
},
example: 'nlp(\'We\u2019re here, we\u2019re clear, we don\u2019t want anymore bears.\').clauses().ifNo(\'anymore\').out()\n//We\'re here, we\'re clear,'
}
},
split: {

@@ -231,4 +203,3 @@ splitOn: {

returns: 'Text',
example: `nlp('Monorail...Once again! Monorail... Monorail!').splitOn('monorail').get(0).out()
//Monorail`
example: 'nlp(\'Monorail...Once again! Monorail... Monorail!\').splitOn(\'monorail\').get(0).out()\n//Monorail'
},

@@ -238,4 +209,3 @@ splitBefore: {

returns: 'Text',
example: `nlp('Monorail...Once again! Monorail... Monorail!').splitBefore('monorail').get(0).out()
//Monorail...Once again!`
example: 'nlp(\'Monorail...Once again! Monorail... Monorail!\').splitBefore(\'monorail\').get(0).out()\n//Monorail...Once again!'
},

@@ -245,5 +215,4 @@ splitAfter: {

returns: 'Text',
example: `nlp('Monorail...Once again! Monorail... Monorail!').splitAfter('monorail').get(0).out()
//Monorail`
},
example: 'nlp(\'Monorail...Once again! Monorail... Monorail!\').splitAfter(\'monorail\').get(0).out()\n//Monorail'
}
},

@@ -255,4 +224,3 @@

returns: 'Text',
example: `nlp('Michael Apple ate a delicious apple.').match('#FirstName apple').tag('Person').people().out()
//Michael Apple`
example: 'nlp(\'Michael Apple ate a delicious apple.\').match(\'#FirstName apple\').tag(\'Person\').people().out()\n//Michael Apple'
},

@@ -262,4 +230,3 @@ unTag: {

returns: 'Text',
example: `nlp('they made a catch & scored a run').match(['run','catch']).unTag('#Verb').nouns().out('array')
//catch, run`
example: 'nlp(\'they made a catch & scored a run\').match([\'run\',\'catch\']).unTag(\'#Verb\').nouns().out(\'array\')\n//catch, run'
},

@@ -269,6 +236,5 @@ canBe: {

returns: 'Text',
example: `nlp('it’s fusilli jerry!').canBe('Person').out()
//fusilli jerry`
example: 'nlp(\'it\u2019s fusilli jerry!\').canBe(\'Person\').out()\n//fusilli jerry'
}
}
};

@@ -0,6 +1,7 @@

'use strict';
module.exports = {
data: {
desc: 'return a handy array of meta-data for this the contractions in this text',
example: `nlp(' I’d like to request seventeen dollars for a push broom rebristling').contractions().data()
//[{text:'I'd'}]`,
example: 'nlp(\' I\u2019d like to request seventeen dollars for a push broom rebristling\').contractions().data()\n//[{text:\'I\'d\'}]',
returns: 'array'

@@ -11,4 +12,3 @@ },

returns: 'Text',
example: `nlp('He’s the greatest guy in history').contractions().expand().out('')
//He is`
example: 'nlp(\'He\u2019s the greatest guy in history\').contractions().expand().out(\'\')\n//He is'
},

@@ -18,4 +18,3 @@ contract: {

returns: 'Text',
example: `nlp('He is about to hit a chestnut tree').contractions().contract().out('')
//He's`
example: 'nlp(\'He is about to hit a chestnut tree\').contractions().contract().out(\'\')\n//He\'s'
},

@@ -25,4 +24,3 @@ contracted: {

returns: 'Text',
example: `nlp('Lisa, I’d like to buy your rock.').contractions().contracted().out('')
//I'd`
example: 'nlp(\'Lisa, I\u2019d like to buy your rock.\').contractions().contracted().out(\'\')\n//I\'d'
},

@@ -32,5 +30,4 @@ expanded: {

returns: 'Text',
example: `nlp('Lisa, I would like to buy your rock.').contractions().expanded().out('')
//I would`
example: 'nlp(\'Lisa, I would like to buy your rock.\').contractions().expanded().out(\'\')\n//I would'
}
};

@@ -0,6 +1,6 @@

'use strict';
module.exports = {
data: {
desc: 'return an array of meta-data about the dates and times in this text',
example: `nlp('Finally, I just stopped caring. Luckily for me, it was 1980 and no one noticed.').dates().data()
//[{text:'1980'}]`,
example: 'nlp(\'Finally, I just stopped caring. Luckily for me, it was 1980 and no one noticed.\').dates().data()\n//[{text:\'1980\'}]',
returns: 'array'

@@ -11,4 +11,3 @@ },

returns: 'Text',
example: `nlp('April, June, and Sept').dates().toShortForm().all().out()
//Apr, Jun, and Sept`
example: 'nlp(\'April, June, and Sept\').dates().toShortForm().all().out()\n//Apr, Jun, and Sept'
},

@@ -18,5 +17,4 @@ toLongForm: {

returns: 'Text',
example: `nlp('April, June, and Sept').dates().toShortForm().all().out()
//April, June, and September`
},
example: 'nlp(\'April, June, and Sept\').dates().toShortForm().all().out()\n//April, June, and September'
}
};

@@ -0,1 +1,3 @@

'use strict';
module.exports = {

@@ -14,4 +16,3 @@ contractions: require('./contractions'),

desc: 'return an array of meta-data for the acronyms in this text',
example: `nlp('In the USA, the big CIA. The Bloods and the Crips, and the KKK.').acronyms().data()
//[{text:'USA'...}]`,
example: 'nlp(\'In the USA, the big CIA. The Bloods and the Crips, and the KKK.\').acronyms().data()\n//[{text:\'USA\'...}]',
returns: 'array'

@@ -24,4 +25,3 @@ }

desc: 'return an array of meta-data for the adjectives and their adverbs',
example: `nlp('Guys, we have to assume our guns are useless. Throw them in the lake.').adjectives().data()
//[{text:'useless'}]`,
example: 'nlp(\'Guys, we have to assume our guns are useless. Throw them in the lake.\').adjectives().data()\n//[{text:\'useless\'}]',
returns: 'array'

@@ -34,4 +34,3 @@ }

desc: 'return an array of meta-data for the adverbs in this text',
example: `nlp('truly, madly, deeply').adverbs().data()
//[{text:'truly'...}]`,
example: 'nlp(\'truly, madly, deeply\').adverbs().data()\n//[{text:\'truly\'...}]',
returns: 'array'

@@ -44,4 +43,3 @@ }

desc: 'return an array of words split by sentence phrase (clause)',
example: `nlp('All right, Colossus, you’re free to go, but stay away from Death Mountain').clauses().data()
//[{normal:'all right'}, {normal:'Colossus'}, {normal:'you're free to go'},]`,
example: 'nlp(\'All right, Colossus, you\u2019re free to go, but stay away from Death Mountain\').clauses().data()\n//[{normal:\'all right\'}, {normal:\'Colossus\'}, {normal:\'you\'re free to go\'},]',
returns: 'array'

@@ -54,4 +52,3 @@ }

desc: 'return an array of parsed hashtags used in the text',
example: `nlp('oh, but where is the #anykey').hashTags().data()
//[{normal:'anykey'}]`,
example: 'nlp(\'oh, but where is the #anykey\').hashTags().data()\n//[{normal:\'anykey\'}]',
returns: 'array'

@@ -64,4 +61,3 @@ }

desc: 'return an array of subsequences beginning at the start of each sentence or match',
example: `nlp('Who controls the British crown? Who keeps the metric system down?').startGrams().data()
//[{normal:'who', size:1, count:2}...]`,
example: 'nlp(\'Who controls the British crown? Who keeps the metric system down?\').startGrams().data()\n//[{normal:\'who\', size:1, count:2}...]',
returns: 'array'

@@ -73,4 +69,3 @@ }

desc: 'return an array of subsequences ending at the end of each sentence or match',
example: `nlp('you think that’s a knife? I’ll show you a knife.').endGrams().data()
//[{normal:'knife', count:2, size:1}...]`,
example: 'nlp(\'you think that\u2019s a knife? I\u2019ll show you a knife.\').endGrams().data()\n//[{normal:\'knife\', count:2, size:1}...]',
returns: 'array'

@@ -83,4 +78,3 @@ }

desc: 'return an array of named-organizations in this text',
example: `nlp('Your dreams may vary from those of Globex Corporation, its subsidiaries and shareholders.').organizations().data()
//[{text:'Globex Corporation'}]`,
example: 'nlp(\'Your dreams may vary from those of Globex Corporation, its subsidiaries and shareholders.\').organizations().data()\n//[{text:\'Globex Corporation\'}]',
returns: 'array'

@@ -93,4 +87,3 @@ }

desc: 'return an array of parsed phonenumbers in this text',
example: `nlp('Moe Sizlak. That’s right. I’m a surgeon. (800) 555-0000.').phoneNumbers().data()
//[{text:'(800) 555-0000'}]`,
example: 'nlp(\'Moe Sizlak. That\u2019s right. I\u2019m a surgeon. (800) 555-0000.\').phoneNumbers().data()\n//[{text:\'(800) 555-0000\'}]',
returns: 'array'

@@ -103,4 +96,3 @@ }

desc: 'return an array of locations mentioned in this text',
example: `nlp('you could still go to McGill, the Harvard of Canada!').places().data()
//[{normal:'canada'}]`,
example: 'nlp(\'you could still go to McGill, the Harvard of Canada!\').places().data()\n//[{normal:\'canada\'}]',
returns: 'array'

@@ -113,4 +105,3 @@ }

desc: 'return an array of question sentences in this text',
example: `nlp('are you saying boo, or boo-urns?').questions().data().length
//1`,
example: 'nlp(\'are you saying boo, or boo-urns?\').questions().data().length\n//1',
returns: 'array'

@@ -123,4 +114,3 @@ }

desc: 'return an array of meta-data with the parsed quoations',
example: `nlp('the he said "crazy like a fox!".').quotations().data().length
//1`,
example: 'nlp(\'the he said "crazy like a fox!".\').quotations().data().length\n//1',
returns: 'array'

@@ -133,4 +123,3 @@ }

desc: 'return an array of sentences that are not questions',
example: `nlp('i was saying boo-urns.').statements().data()
//[{normal:'i was saying boo-urns'}]`,
example: 'nlp(\'i was saying boo-urns.\').statements().data()\n//[{normal:\'i was saying boo-urns\'}]',
returns: 'array'

@@ -143,4 +132,3 @@ }

desc: 'split all words into individual results, and return their metadata',
example: `nlp('we should all be more like little Ruttiger').terms().data()
//[{text:'we'}, {text:'should'}...]`,
example: 'nlp(\'we should all be more like little Ruttiger\').terms().data()\n//[{text:\'we\'}, {text:\'should\'}...]',
returns: 'array'

@@ -153,4 +141,3 @@ }

desc: 'return the people, places, and organizations of this text',
example: `nlp('Hey everybody, I’m lookin’ for Amanda Hugginkiss').topics().data()
//[{text:'Amanda Hugginkiss'}]`,
example: 'nlp(\'Hey everybody, I\u2019m lookin\u2019 for Amanda Hugginkiss\').topics().data()\n//[{text:\'Amanda Hugginkiss\'}]',
returns: 'array'

@@ -163,4 +150,3 @@ }

desc: 'return an array of urls mentioned in this text',
example: `nlp('👏 http://simpsons.wikia.com').urls().data()
//[{text:'http://simpsons.wikia.com'}]`,
example: 'nlp(\'\uD83D\uDC4F http://simpsons.wikia.com\').urls().data()\n//[{text:\'http://simpsons.wikia.com\'}]',
returns: 'array'

@@ -167,0 +153,0 @@ }

@@ -0,6 +1,7 @@

'use strict';
module.exports = {
data: {
desc: 'return a handy array of meta-data for the n-grams in this text',
example: `nlp('love love me do.').ngrams().data()
//[{text:'love', count:2, size:1}..]`,
example: 'nlp(\'love love me do.\').ngrams().data()\n//[{text:\'love\', count:2, size:1}..]',
returns: 'array'

@@ -11,4 +12,3 @@ },

returns: 'Text',
example: `nlp('University of Toronto, in toronto').ngrams().unigrams(0).data()
//[{normal:'toronto', count:2, size:1}]`
example: 'nlp(\'University of Toronto, in toronto\').ngrams().unigrams(0).data()\n//[{normal:\'toronto\', count:2, size:1}]'
},

@@ -18,4 +18,3 @@ bigrams: {

returns: 'Text',
example: `nlp('The University of Ryerson and University of Toronto, in toronto').ngrams().bigrams(0).data()
//[{normal:'university of', count:2, size:2}]`
example: 'nlp(\'The University of Ryerson and University of Toronto, in toronto\').ngrams().bigrams(0).data()\n//[{normal:\'university of\', count:2, size:2}]'
},

@@ -25,4 +24,3 @@ trigrams: {

returns: 'Text',
example: `nlp('we like Roy! we like Roy!').ngrams().trigrams(0).data()
//[{normal:'we like roy', count:2, size:3}]`
example: 'nlp(\'we like Roy! we like Roy!\').ngrams().trigrams(0).data()\n//[{normal:\'we like roy\', count:2, size:3}]'
},

@@ -32,5 +30,4 @@ sort: {

returns: 'Text',
example: `nlp('i scream, you scream, we all scream for icecream.').ngrams().sort().first().out()
//scream`
},
example: 'nlp(\'i scream, you scream, we all scream for icecream.\').ngrams().sort().first().out()\n//scream'
}
};

@@ -0,6 +1,7 @@

'use strict';
module.exports = {
data: {
desc: 'return a handy array of meta-data for the nouns in this text',
example: `nlp('Lunchlady Doris, have you got any grease?').nouns().data()
//[{text:'Lunchlady Doris'}, {text:'grease'}]`,
example: 'nlp(\'Lunchlady Doris, have you got any grease?\').nouns().data()\n//[{text:\'Lunchlady Doris\'}, {text:\'grease\'}]',
returns: 'array'

@@ -11,4 +12,3 @@ },

returns: 'Text',
example: `nlp('All my life I’ve had one dream, to accomplish my many goals.').nouns().isPlural().out()
//goals`
example: 'nlp(\'All my life I\u2019ve had one dream, to accomplish my many goals.\').nouns().isPlural().out()\n//goals'
},

@@ -18,4 +18,3 @@ hasPlural: {

returns: 'Text',
example: `nlp('bring joy to the air, water, earth, and sky.').nouns().hasPlural().length()
//0`
example: 'nlp(\'bring joy to the air, water, earth, and sky.\').nouns().hasPlural().length()\n//0'
},

@@ -25,4 +24,3 @@ toPlural: {

returns: 'Text',
example: `nlp('the purple dinosaur').nouns().toPlural().all().out()
//the purple dinosaurs`
example: 'nlp(\'the purple dinosaur\').nouns().toPlural().all().out()\n//the purple dinosaurs'
},

@@ -32,6 +30,5 @@ toSingular: {

returns: 'Text',
example: `nlp('the king’s men').nouns().toSingular().out()
//the king's man`
},
example: 'nlp(\'the king\u2019s men\').nouns().toSingular().out()\n//the king\'s man'
}
};

@@ -0,6 +1,6 @@

'use strict';
module.exports = {
data: {
desc: 'return a handy array of meta-data of people mentioned in the text',
example: `nlp('The bong-rattling bass of Mel Schacher? The competent drum work of Don Brewer?').people().data()
//[{text:' Mel Schacher'}, {text:'Don Brewer'}]`,
example: 'nlp(\'The bong-rattling bass of Mel Schacher? The competent drum work of Don Brewer?\').people().data()\n//[{text:\' Mel Schacher\'}, {text:\'Don Brewer\'}]',
returns: 'array'

@@ -11,5 +11,4 @@ },

returns: 'String',
example: `nlp('Tony Hawk did a 900').people().pronoun()
//'he'`
example: 'nlp(\'Tony Hawk did a 900\').people().pronoun()\n//\'he\''
}
};

@@ -0,6 +1,7 @@

'use strict';
module.exports = {
data: {
desc: 'return a handy array of meta-data for the sentences in this text',
example: `nlp('hi everybody! Hi Dr. Nick!').sentences().data().length
//[{normal:'hi everybody'}, {normal:'hi dr nick'}]`,
example: 'nlp(\'hi everybody! Hi Dr. Nick!\').sentences().data().length\n//[{normal:\'hi everybody\'}, {normal:\'hi dr nick\'}]',
returns: 'array'

@@ -11,4 +12,3 @@ },

returns: 'Text',
example: `nlp('I know so many words.').sentences().prepend('believe me').out()
//Believe me, I know so many words.`
example: 'nlp(\'I know so many words.\').sentences().prepend(\'believe me\').out()\n//Believe me, I know so many words.'
},

@@ -18,4 +18,3 @@ append: {

returns: 'Text',
example: `nlp('I know so many words.').sentences().append('big league').out()
//I know so many words big league.`
example: 'nlp(\'I know so many words.\').sentences().append(\'big league\').out()\n//I know so many words big league.'
},

@@ -25,4 +24,3 @@ toPastTense: {

returns: 'Text',
example: `nlp('I pay the Homer tax.').sentences().toPastTense().out()
//I paid the Homer tax.`
example: 'nlp(\'I pay the Homer tax.\').sentences().toPastTense().out()\n//I paid the Homer tax.'
},

@@ -32,4 +30,3 @@ toPresentTense: {

returns: 'Text',
example: `nlp('I paid the Homer tax.').sentences().toPresentTense().out()
//I pay the Homer tax.`
example: 'nlp(\'I paid the Homer tax.\').sentences().toPresentTense().out()\n//I pay the Homer tax.'
},

@@ -39,4 +36,3 @@ toFutureTense: {

returns: 'Text',
example: `nlp('That’s the home-owner tax.').sentences().toFutureTense().out()
//That will be the home-owner tax`
example: 'nlp(\'That\u2019s the home-owner tax.\').sentences().toFutureTense().out()\n//That will be the home-owner tax'
},

@@ -46,4 +42,3 @@ toNegative: {

returns: 'Text',
example: `nlp('Now make like my pants, and split.').sentences(0).toNegative().out()
//Now do not make like my pants, and split.`
example: 'nlp(\'Now make like my pants, and split.\').sentences(0).toNegative().out()\n//Now do not make like my pants, and split.'
},

@@ -53,4 +48,3 @@ toPositive: {

returns: 'Text',
example: `nlp('The goggles do nothing!').sentences().toPositive().out()
//The goggles do everything!`
example: 'nlp(\'The goggles do nothing!\').sentences().toPositive().out()\n//The goggles do everything!'
},

@@ -60,4 +54,3 @@ isPassive: {

returns: 'Text',
example: `nlp('you were saved by the bell').sentences().isPassive().out()
//you were saved by the bell`
example: 'nlp(\'you were saved by the bell\').sentences().isPassive().out()\n//you were saved by the bell'
},

@@ -67,4 +60,3 @@ toExclamation: {

returns: 'Text',
example: `nlp('sweet balls of fire?').sentences().toExclamation().out()
//sweet balls of fire!`
example: 'nlp(\'sweet balls of fire?\').sentences().toExclamation().out()\n//sweet balls of fire!'
},

@@ -74,4 +66,3 @@ toQuestion: {

returns: 'Text',
example: `nlp('Stupider like a fox.').sentences().toQuestion().out()
//Stupider like a fox?`
example: 'nlp(\'Stupider like a fox.\').sentences().toQuestion().out()\n//Stupider like a fox?'
},

@@ -81,5 +72,4 @@ toStatement: {

returns: 'Text',
example: `nlp('Go out on a Tuesday? Who am I, Charlie Sheen?').sentences(0).toStatement().out()
//Go out on a Tuesday. Who am I, Charlie Sheen?`
example: 'nlp(\'Go out on a Tuesday? Who am I, Charlie Sheen?\').sentences(0).toStatement().out()\n//Go out on a Tuesday. Who am I, Charlie Sheen?'
}
};

@@ -0,6 +1,7 @@

'use strict';
module.exports = {
data: {
desc: 'return a handy array of meta-data for the numbers and values in this text',
example: `nlp('I’d like to request seventeen dollars for a push broom rebristling').values().data()
//[{number:17, TextValue:{ Ordinal:'seventeenth'}, NumericValue:{ Ordinal:'17th'}} ]`,
example: 'nlp(\'I\u2019d like to request seventeen dollars for a push broom rebristling\').values().data()\n//[{number:17, TextValue:{ Ordinal:\'seventeenth\'}, NumericValue:{ Ordinal:\'17th\'}} ]',
returns: 'array'

@@ -11,4 +12,3 @@ },

returns: 'Text',
example: `nlp('in 2016, I’m going to party like it’s on sale for $19.99.').values().noDates().length
//1`
example: 'nlp(\'in 2016, I\u2019m going to party like it\u2019s on sale for $19.99.\').values().noDates().length\n//1'
},

@@ -18,4 +18,3 @@ toNumber: {

returns: 'Text',
example: `nlp('ten things i hate about you').values().toNumber().all().out()
//10 things i hate about you`
example: 'nlp(\'ten things i hate about you\').values().toNumber().all().out()\n//10 things i hate about you'
},

@@ -25,4 +24,3 @@ toTextValue: {

returns: 'Text',
example: `nlp('10 things i hate about you').values().toTextValue().all().out()
//ten things i hate about you`
example: 'nlp(\'10 things i hate about you\').values().toTextValue().all().out()\n//ten things i hate about you'
},

@@ -32,4 +30,3 @@ toNiceNumber: {

returns: 'Text',
example: `nlp('five hundred sixty two thousand, four hundred and seven').values().toTextValue().all().out()
//'562,407'`
example: 'nlp(\'five hundred sixty two thousand, four hundred and seven\').values().toTextValue().all().out()\n//\'562,407\''
},

@@ -39,4 +36,3 @@ toCardinal: {

returns: 'Text',
example: `nlp('twenty-third of december').values().toCardinal().all().out()
//23rd of december`
example: 'nlp(\'twenty-third of december\').values().toCardinal().all().out()\n//23rd of december'
},

@@ -46,4 +42,3 @@ toOrdinal: {

returns: 'Text',
example: `nlp('three strikes').values().toOrdinal().all().nouns().toSingular().all().out()
//third strike`
example: 'nlp(\'three strikes\').values().toOrdinal().all().nouns().toSingular().all().out()\n//third strike'
},

@@ -53,5 +48,4 @@ numbers: {

returns: 'Array',
example: `nlp('at the seven eleven').values().numbers()
// [7, 11]`
},
example: 'nlp(\'at the seven eleven\').values().numbers()\n// [7, 11]'
}
};

@@ -0,7 +1,7 @@

'use strict';
module.exports = {
data: {
desc: 'return a handy array of meta-data for the verbs and their auxillaries in this text',
example: `nlp('he will have been walking quickly').verbs().data()
//[{verb:'walking', auxillary:'will have been', adverb:'quickly'}]
`,
example: 'nlp(\'he will have been walking quickly\').verbs().data()\n//[{verb:\'walking\', auxillary:\'will have been\', adverb:\'quickly\'}]\n',
returns: 'array'

@@ -12,5 +12,3 @@ },

returns: 'String',
example: `nlp('My cat’s breath smells like cat food').verbs().conjugation()
//['PresentTense']
`
example: 'nlp(\'My cat\u2019s breath smells like cat food\').verbs().conjugation()\n//[\'PresentTense\']\n'
},

@@ -20,5 +18,3 @@ conjugate: {

returns: 'Array',
example: `nlp('she walked the walk').verbs().conjugate()
//[{Infinitive:'walk', ...}]
`
example: 'nlp(\'she walked the walk\').verbs().conjugate()\n//[{Infinitive:\'walk\', ...}]\n'
},

@@ -29,5 +25,3 @@

returns: 'Text',
example: `nlp('we were discussing Wittgenstein over a game of backgammon').verbs().isSingular().out('array')
//[{text:'were discussing'}]
`
example: 'nlp(\'we were discussing Wittgenstein over a game of backgammon\').verbs().isSingular().out(\'array\')\n//[{text:\'were discussing\'}]\n'
},

@@ -37,5 +31,3 @@ isPlural: {

returns: 'Text',
example: `nlp('We were sitting in Barney’s car').verbs().isPlural().out('array')
//[]
`
example: 'nlp(\'We were sitting in Barney\u2019s car\').verbs().isPlural().out(\'array\')\n//[]\n'
},

@@ -46,5 +38,3 @@

returns: 'Text',
example: `nlp('Dear Miss Hoover, you have Lyme disease.').verbs().isNegative().length()
//1
`
example: 'nlp(\'Dear Miss Hoover, you have Lyme disease.\').verbs().isNegative().length()\n //1\n '
},

@@ -54,5 +44,3 @@ isNegative: {

returns: 'Text',
example: `nlp('Dear Miss Hoover, you have Lyme disease.').verbs().isNegative().length()
//0
`
example: 'nlp(\'Dear Miss Hoover, you have Lyme disease.\').verbs().isNegative().length()\n//0\n'
},

@@ -62,5 +50,3 @@ toNegative: {

returns: 'Text',
example: `nlp('Dear Miss Hoover, you have Lyme disease.').verbs().toNegative().out()
//do not have
`
example: 'nlp(\'Dear Miss Hoover, you have Lyme disease.\').verbs().toNegative().out()\n//do not have\n'
},

@@ -70,5 +56,3 @@ toPositive: {

returns: 'Text',
example: `nlp('Dear Miss Hoover, you do not have Lyme disease').verbs().toPositive().out()
//have
`
example: 'nlp(\'Dear Miss Hoover, you do not have Lyme disease\').verbs().toPositive().out()\n//have\n'
},

@@ -78,5 +62,3 @@ toPastTense: {

returns: 'Text',
example: `nlp('It tastes like burning.').verbs().toPastTense().out()
//tasted
`
example: 'nlp(\'It tastes like burning.\').verbs().toPastTense().out()\n//tasted\n'
},

@@ -86,5 +68,3 @@ toPresentTense: {

returns: 'Text',
example: `nlp('you ate the sandwich?').verbs().toPresentTense().out()
//you eat the sandwich?
`
example: 'nlp(\'you ate the sandwich?\').verbs().toPresentTense().out()\n//you eat the sandwich?\n'
},

@@ -94,4 +74,3 @@ toFutureTense: {

returns: 'Text',
example: `nlp('I’m a furniture! ').verbs().toFutureTense().out()
//will be`
example: 'nlp(\'I\u2019m a furniture! \').verbs().toFutureTense().out()\n//will be'
},

@@ -101,5 +80,4 @@ asAdjective: {

returns: 'Array',
example: `nlp('strain').verbs().asAdjective()
//strenuous`
},
example: 'nlp(\'strain\').verbs().asAdjective()\n//strenuous'
}
};

@@ -5,3 +5,3 @@ {

"description": "natural language processing in the browser",
"version": "7.0.16",
"version": "7.0.17",
"main": "./builds/compromise.js",

@@ -8,0 +8,0 @@ "repository": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc