Git Product home page Git Product logo

roman-to-kana's Introduction

roman-to-kana

A tool for converting roman (English) text to kana (Japanese)

design

This tool somewhat ignores the complexities of variable width Unicode characters and builds a solution around the exact parameters of the problem. The input starts of as a standard c-string (char *) and is converted to an array of unsigned integers (unsigned *), giving each character a fixed 4 byte width. Each character is then substituted for its katakana/ hirigana equivalent and the extra characters are removed from the sequence.

For example

  • "ke" is the input and starts as a 2 byte ascii string.
  • It is converted to unsigned * and becomes an 8 byte fixed width psudo-unicode string.
  • The "k" is replaced with the hirigana "け" and the "e" is removed leaving a 4 byte fixed width unicode character which can be printed to standard out.

notes

  • Characters that cannot be converted are left in place i.e. kevin --> けvいん (There is no "v" in Japanese).
  • Unlike some other conversion tools I've come across, n is parsed before double characters so konnichiha --> こんにちは (ko·n·ni·chi·ha) not こっにちは (ko·nni·chi·ha).

usage

The first command line argument is taken as the input string.

roman_to_kana "text to be translated"

roman-to-kana's People

Contributors

klampworks avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.