@stdlib/nlp-expand-acronyms
v0.2.2
Published
Expand acronyms.
Downloads
42
Readme
Expand Acronyms
Expand acronyms.
Installation
npm install @stdlib/nlp-expand-acronyms
Usage
var expandAcronyms = require( '@stdlib/nlp-expand-acronyms' );
expandAcronyms( str )
Expands acronyms in a string.
var str = 'TLDR, the article is too long...';
var out = expandAcronyms( str );
// returns 'too long did not read, the article is too long...'
Notes
- This expansion is done via a simple table look-up. Hence, it is not able to replace acronyms for which there are multiple possible expansions.
Examples
var expandAcronyms = require( '@stdlib/nlp-expand-acronyms' );
var str = 'LOL, this is fun. I am ROFL.';
var out = expandAcronyms( str );
// returns 'laughing out loud, this is fun. I am rolling on the floor laughing.'
str = 'brb, I need to check my mail. thx!';
out = expandAcronyms( str );
// returns 'be right back, I need to check my mail. thanks!'
str = 'OTOH, there are some drawbacks to this approach imho.';
out = expandAcronyms( str );
// returns 'on the other hand, there are some drawbacks to this approach in my humble opinion.'
See Also
@stdlib/nlp-expand-contractions
: expand contractions.
Notice
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.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.