Code Monkey home page Code Monkey logo

parakeet's Introduction

parakeet

Disclaimer

I know nothing about parsing, Haskell and Japanese. This repository is purely for fun, and serving as a test-bed for some Haskell experiments.

Introduction

Build the most convenient tool for Japanese beginners!

Input:

Output:

Full output:

Romaji should follow Hepburn romanization.

For an experimential online demo powered by GHCJS, see here for more details.

Installation

To build, at least ghc 7.10.2 is required.

$ cabal install parakeet.cabal

For stack users,

$ stack init
$ stack install

or

$ stack install --stack-yaml=stack-ghcjs.yaml

if you want to compile to JavaScript.

Development

$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal build

Usage

  • XeLaTex package dependencies: xeCJK, ruby
  • Font dependencies: MS Mincho, MS Gothic
$ parakeet -j Butter-fly.j -r Butter-fly.r -o Butter-fly.tex
$ xelatex Butter-fly.tex

or directly,

$ parakeet -j Buffer-fly.j -r Buffer-fly.r -o Buffer-fly.pdf

You should guarantee that the two input files are encoded in UTF-8.

Limitations

  • The parsing algorithm is essentially LL(infinity), it is an exponential algorithm of course! So the program may get extremely slow when there is a mistake in a long line of romaji. A proper use of separator $ can avoid this trap.
  • The long vowel ō is ambiguous in Hepburn romanization, which is interpreted to ou or oo. To resolve this, we always pick the former one. For example, 東京(Tōkyō) is correctly translated to とうきょう, while 大阪(Ōsaka) is wrongly translated to おうさか.
  • There are two zus and jis in romanization, namely ずづ and じぢ in hiragana respectively. We always pick ずじ when translating zu and ji into furigana. If you want づぢ, use du(dzu) and di(dji) instead.
  • Unfriendly parse error message.

Document

Since I haven't find any potential users, so there will be no document available, please create an issue if you have trouble using it.

TODO List

  • Ambiguous ō warning.
  • Extended katakana support.
  • Wiki for Japanese lexical rules.

parakeet's People

Contributors

foreverbell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.