Coder Social home page Coder Social logo

braille-ja's People

Contributors

tadd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

braille-ja's Issues

簡単な使い方がない

現状はとても長ったらしくBrailleJa::KanaTranslator.translate('あいうえお')と書く必要があるが、本当は 'あいうえお'.to_braille_jaみたいに簡単に書きたい。

けれどこれには、それなりの理由があって、素朴に実装しちゃうと以下のような問題がある。

  • 日本語点字は基本的に音の符号化なので、日本語文字列一般に対して、簡単にはできない。
    • たぶん、漢字が含まれていたら分かち書きの上、読みがなを付け、それを符号化(現在の実装部分)しなければならない。
    • これはウィキペのみから得た知識なので偏りがあるかも

ということで気安く呼んでも、意図しない文字列が帰ってくるか、サポートされていないという例外があがるか、という結果になっちゃうので、現状簡単なインターフェースをすぐに作るわけには行かない。

とりあえず、String#kana_to_braille_jaとか作る?

Inspired by #1.

Herokuでも形態素解析したい

#3 のコメントに書いた通り、まともな点字翻訳には助詞にあたるカナの変換(「は」→「わ」のようなもの)が不可欠になる。変換自体は自明だが、助詞を見つけ出す作業には日本語自然文に対する形態素解析が必要。

これを安直にMeCabでやろうとも考えたが、任意のCライブラリをインストールできないHerokuでは実行できなくなってしまう(基本的にGem経由でなければいけなさそう)。

Herokuに依存するライブラリにするつもりはないが、ひとまずHerokuの枠の中でうまく動くライブラリにはしたい。

いくつかの解決案。

  • Nokogiriがlibxmlに対してやっている(libxml2 and libxslt are bundled with the gem)ように、MeCabを内包した拡張ライブラリgemを作る
    • ○ 一度インストールできちゃえば困ることはなさそう
    • × 作るの自体がめんどくさそう
  • Ruby製の形態素解析ライブラリを使う。たとえば okura とか
    • ○ gemはもうあるから楽、今のところ最有力
    • × okuraを使うとして:
    • MeCab辞書部分はgemを作らなくちゃいけなさそう(でも比較的簡単そう)
    • どこまで使えるか、試さないと分からない
  • Herokuアドオンとしても使える、SolrやElasticSearch経由でKuromojiとかを使う
    • × 生きてる別サーバーが必要という時点で、braille-jaが独立したライブラリとして存在する意味があまりなくなってしまう
  • Kuromoji*.jarをRubyから叩く
    • ○ gemを作るとしても、jarを内包するだけ
    • × rjb経由でJVM立ち上げるというやり過ぎ感

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.