![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
match_percentage
Advanced tools
I originally wrote this to compare title headlines from local news websites I web scrape. On any given day, all the websites can have the same story with the title being very similar, which helps me check for duplicate articles.
This is a simple Node.js module for calculating the match percentage between two sentences. It removes simple words (such as "of", "at", "i", etc.) from the sentences before calculating the match percentage.
I originally wrote this to compare title headlines from local news websites I web scrape. On any given day, all the websites can have the same story with the title being very similar, which helps me check for duplicate articles.
Get me at kentaylorappdev@gmail.com
Open issues on github - contributions welcomed
To use the module, simply install it using npm or yarn:
npm install match-percentage
or
yarn add match-percentage
Once the module is installed, you can import it into your code and use the checkMatchPercentage(s1,s2)
function to calculate the match percentage between two sentences. The function takes two arguments: the two sentences to compare. It returns an object with two properties:
matchPercentage
: The match percentage between the two sentences, as a number between 0 and 100.match
: A string indicating whether the two sentences are likely to be a match, based on the match percentage.Here is an example of how to use the module:
const matchPercentage = require('match-percentage');
or
import matchPercentage from match-percentage;
const sentence1 = 'This is a simple sentence.';
const sentence2 = 'This is a very similar sentence.';
const result = await matchPercentage(sentence1, sentence2);
console.log(result);
Output:
{
matchPercentage: 90,
match: 'This is probably a match'
}
The module includes a list of simple words that are removed from the sentences before calculating the match percentage. This list can be customized by passing an array of words to the removeSimpleWords()
function.
Here is an example of how to customize the list of simple words:
javascript const matchPercentage = require('match-percentage');
const simpleWords = ['of', 'at', 'i', 'by', 'in', 'is', 'to', 'as', 'for', 'of', 'a', 'the', 'this', 'I', 'he', 'you', 'and', 'but', 'or', 'if'];
const customSimpleWords = ['very', 'simple'];
const result = await matchPercentage.checkMatchPercentage(sentence1, sentence2, customSimpleWords);
console.log(result);
Output:
{
matchPercentage: 80,
match: 'This is probably a match'
}
This module provides a simple way to calculate the match percentage between two sentences. It can be used in a variety of applications, such as plagiarism detection, text matching, and natural language processing.
FAQs
I originally wrote this to compare title headlines from local news websites I web scrape. On any given day, all the websites can have the same story with the title being very similar, which helps me check for duplicate articles.
The npm package match_percentage receives a total of 5 weekly downloads. As such, match_percentage popularity was classified as not popular.
We found that match_percentage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.