
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
query-text-match
Advanced tools
Calculates the matching score between query and text
yarn add query-text-match
const _ = require('lodash');
const queryTextMatch = require('./index');
const query = "because I can't you";
const texts = [
'The stranger officiates the meal.',
'When transplanting seedlings, candied teapots will make the task easier.',
'His mind was blown that there was nothing in space except space itself.',
"Please put on these earmuffs because I can't you hear.",
'Flash photography is best used in full sunlight.',
'It dawned on her that others could make her happier, but only she could make herself happy.',
'He was the type of guy who liked Christmas lights on his house in the middle of July.',
"Art doesn't have to be intentional.",
'It was getting dark, and we weren’t there yet.',
'He learned the important lesson that a picnic at the beach on a windy day is a bad idea.',
];
const results = texts.map((text) => ({ ...queryTextMatch(query, text), text }));
console.log(
JSON.stringify(
_.sortBy(results, [
'unmatchedQueryWordsCount',
'extraCharactersCount',
'totalDistance',
]),
null,
2
)
);
Outcome:
[
{
"matchedQueryWordsCount": 3,
"unmatchedQueryWordsCount": 1,
"queryWordsCount": 4,
"totalDistance": 6,
"extraCharactersCount": 0,
"takenWords": [
{
"index": 29,
"actualWord": "because",
"extraPerfixLength": 0,
"extraSufixLength": 0,
"UnNormalizedQueryWord": "because",
"normalizedQueryWord": "because",
"extraCharsLength": 0,
"taken": true,
"surroundingDistance": 7
},
{
"index": 37,
"actualWord": "I",
"extraPerfixLength": 0,
"extraSufixLength": 0,
"UnNormalizedQueryWord": "I",
"normalizedQueryWord": "i",
"extraCharsLength": 0,
"taken": true,
"surroundingDistance": 14
},
{
"index": 45,
"actualWord": "you",
"extraPerfixLength": 0,
"extraSufixLength": 0,
"UnNormalizedQueryWord": "you",
"normalizedQueryWord": "you",
"extraCharsLength": 0,
"taken": true,
"surroundingDistance": 7
}
],
"queryNormalizedWordsList": [
"because",
"i",
"cant",
"you"
],
"text": "Please put on these earmuffs because I can't you hear."
},
{
"matchedQueryWordsCount": 1,
"unmatchedQueryWordsCount": 3,
"queryWordsCount": 4,
"totalDistance": 0,
"extraCharactersCount": 0,
"takenWords": [
{
"index": 42,
"actualWord": "i",
"extraPerfixLength": 0,
"extraSufixLength": 0,
"UnNormalizedQueryWord": "i",
"normalizedQueryWord": "i",
"extraCharsLength": 0,
"taken": true
}
],
"queryNormalizedWordsList": [
"because",
"i",
"cant",
"you"
],
"text": "His mind was blown that there was nothing in space except space itself."
},
...
]
FAQs
Calculates the matching score between query and text
The npm package query-text-match receives a total of 1 weekly downloads. As such, query-text-match popularity was classified as not popular.
We found that query-text-match 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.