Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@stdlib/nlp-expand-contractions
Advanced tools
Expand all contractions to their formal equivalents.
npm install @stdlib/nlp-expand-contractions
var expandContractions = require( '@stdlib/nlp-expand-contractions' );
Expands all contractions to their formal equivalents.
var str = 'I won\'t be able to get y\'all out of this one.';
var out = expandContractions( str );
// returns 'I will not be able to get you all out of this one.'
"She'd"
, which can be expanded to both "She would"
or "She had"
. In such cases, the package expands to a chosen default, in the given example "She would"
. Should you desire higher accuracy, consider using a fully-fledged NLP disambiguation algorithm for English contractions.var expandContractions = require( '@stdlib/nlp-expand-contractions' );
var str = 'I won\'t be able to, sorry.';
var out = expandContractions( str );
// returns 'I will not be able to, sorry.'
str = 'She\'ll be coming around the mountain...';
out = expandContractions( str );
// returns 'She will be coming around the mountain...'
str = 'Y\'all\'d be surprised if you know what I\'ll do.';
out = expandContractions( str );
// returns 'You all would be surprised if you know what I will do.'
str = 'Y\'all\'d\'ve come to the park if y\'all could\'ve, right?';
out = expandContractions( str );
// returns 'You all would have come to the park if you all could have, right?'
str = 'If Parker hadn\'t been sent off for a foul, they\'d\'ve won.';
out = expandContractions( str );
// returns 'If Parker had not been sent off for a foul, they would have won.'
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2021. The Stdlib Authors.
0.0.3 (2021-06-16)
No changes reported for this release.
</section> <!-- /.release --> <section class="release" id="v0.0.2">FAQs
Expand contractions.
The npm package @stdlib/nlp-expand-contractions receives a total of 113 weekly downloads. As such, @stdlib/nlp-expand-contractions popularity was classified as not popular.
We found that @stdlib/nlp-expand-contractions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.