punctuation-name2symbol

1.1.0 • Public • Published

punctuation-name2symbol

Transform this:

hello comma world exclamation point it's a beautiful day period what's new question mark

Into this:

Hello, world! It's a beautiful day. What's new?

This is useful when dealing with speech-to-text software.

Usage:

$ npm install --save punctuation-name2symbol

In your project:

const punctuate = require("punctuation-name2symbol");

punctuate("hello comma world exclamation point what's new question mark");
// Hello, world! What's new?

You can also pass in an object if you want to disable auto-capitalization:

punctuate({
  text: "hello world period what's new question mark",
  capitalize: false
});
// hello world. what's new?

Escaping punctuation mark names is also possible:

punctuate("what is your favorite time \\period question mark");
// What is your favorite time period?

Supported punctuation:

period

comma

question mark

exclamation mark|point (or just exclamation)

hyphen|dash

colon

semi-colon

Package Sidebar

Install

npm i punctuation-name2symbol

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

4.62 kB

Total Files

4

Last publish

Collaborators

  • johnwcallahan