Git Product home page Git Product logo

tones's Introduction

pinyin tone converter 🔢

Converts Mandarin pinyin with tone numbers to pinyin with tone marks.

Example:

numerical:
bao1 guo3

tone marks:
bāo guǒ

how to use

To try out the converter, use the cli tool. This tool prompts the user to input numerical pinyin and returns pinyin with tone marks.

The main function 'convert_from_numerical_pinyin' is found in numerical_pinyin_converter.py. This function takes a numerical pinyin string ("bao1 guo3") as input and returns a converted string ("bāo guǒ").

from numerical_pinyin_converter import convert_from_numerical_pinyin

convert_from_numerical_pinyin("bao1 guo3") # Returns bāo guǒ

As an example use case, csv_example includes a wrapper for the converter to take a csv file as input and output a new, modified csv file. There are example original and modified csv files included.

what is pinyin

Pinyin is the most commonly used romanization system for Mandarin. Numerical pinyin is often used to avoid issues with utf8 encoding. Where utf8 encoding is not a concern, pinyin with tone marks is generally preferred.

tones's People

Contributors

em-shea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tones's Issues

Solve for ng characters

Write tone placement logic for words that can spelled 'ng' (嗯、唔).

For now, the recommendation is to write these as 'en.'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.