New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

natural

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

natural - npm Package Compare versions

Comparing version 0.0.66 to 0.0.67

1

lib/natural/index.js

@@ -25,2 +25,3 @@ /*

exports.Metaphone = require('./phonetics/metaphone');
exports.DoubleMetaphone = require('./phonetics/double_metaphone');
exports.PorterStemmer = require('./stemmers/porter_stemmer');

@@ -27,0 +28,0 @@ exports.LancasterStemmer = require('./stemmers/lancaster_stemmer');

@@ -490,3 +490,12 @@ /*

function compare(stringA, stringB) {
var encodingsA = process(stringA),
encodingsB = process(stringB);
return encodingsA[0] == encodingsB[0] ||
encodingsA[1] == encodingsB[1];
};
DoubleMetaphone.compare = compare
DoubleMetaphone.process = process;
DoubleMetaphone.isVowel = isVowel;

2

package.json
{
"name": "natural",
"description": "General natural language (tokenizing, stemming, classification, inflection, phonetics, tfidf, WordNet) facilities for node.",
"version": "0.0.66",
"version": "0.0.67",
"homepage": "https://github.com/NaturalNode/natural",

@@ -6,0 +6,0 @@ "engines": {

@@ -142,4 +142,4 @@

Phonetic matching (sounds-like) matching can be done with either the SoundEx or
Metaphone algorithms
Phonetic matching (sounds-like) matching can be done withthe SoundEx,
Metaphone or DoubleMetaphone algorithms

@@ -174,2 +174,11 @@ var natural = require('natural'),

DoubleMetaphone deals with two encodings returned in an array
var natural = require('natural'),
var dm = natural.DoubleMetaphone;
var encodings = dm.process('Matrix');
console.log(encodings[0]);
console.log(encodings[1]);
full text strings can be tokenized into arrays of phonetics similar to stemmers

@@ -176,0 +185,0 @@

@@ -704,5 +704,10 @@

expect(encodings[0]).toMatch(/ANTRFNXN/);
expect(encodings[1]).toMatch(/ANTRFNXN/);
expect(encodings[1]).toMatch(/ANTRFNXN/);
});
it('should compare', function() {
expect(doubleMetaphone.compare('love', 'hate')).toBeFalsy();
expect(doubleMetaphone.compare('love', 'luv')).toBeTruthy();
});
});
});
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