Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pinyin-tone-convert

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinyin-tone-convert

Convert Pinyin tone numbers to tone marks.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Pinyin Tone Convert

Build Status Coverage Status code style: prettier License: MIT

Easily convert pinyin tone numbers to tone marks.

Installation

npm install pinyin-tone-convert

Usage

const toneConvert = require('pinyin-tone-convert')

toneConvert('Ni3 hao3 ma5?')
// 'Nǐ hǎo ma?'

toneConvert('Zhong1guo2ren2 ai4 he1 cha2 hai2shi5 ka1fei1?')
// Zhōngguórén ài hē chá háishi kāfēi?

Options

Under the hood this library uses pinyin-tone-parse library and thus passes options object directly to it. Look for all available options here.

const toneConvert = require('pinyin-tone-convert')

toneConvert('pinyin...', options)

Conversion Rules

This library works based on these rules:

  1. a and e trump all other vowels and always take the tone mark.
  2. In the combination ou, o takes the mark.
  3. In all other cases, the final vowel takes the mark.

Tests

npm test

License

MIT.

Keywords

FAQs

Package last updated on 24 Jun 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc