GithubHelp home page GithubHelp logo

o-jill / jkf Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 260 KB

JSON棋譜フォーマット(JKF)の定義とKIF, KI2, CSAからの変換ライブラリ

License: MIT License

Ruby 99.92% Shell 0.08%

jkf's Introduction

Jkf

Gem Version Build Status Code Climate Test Coverage Inline docs

jkfはJSON棋譜フォーマット( https://github.com/na2hiro/json-kifu-format )をRubyに移植したものです。 KIF, KI2, CSAをパースしJKFへ変換、JKFからKIF, KI2, CSAへの変換に対応しています。

Installation

アプリケーションにインストールする場合(bundlerを使用する場合)、Gemfileに以下のように記述してください。

gem 'jkf'

さらにbundleコマンドを実行することでインストールできます。

$ bundle

または、gem installコマンドを使って直接インストールすることもできます。

$ gem install jkf

Usage

KIF, KI2, CSAそれぞれParserとConverterが用意してあります。

kif_parser = Jkf::Parser::Kif.new
ki2_parser = Jkf::Parser::Ki2.new
csa_parser = Jkf::Parser::Csa.new
kif_converter = Jkf::Converter::Kif.new
ki2_converter = Jkf::Converter::Ki2.new
csa_converter = Jkf::Converter::Csa.new

parser#parse(str)でjkfへの変換、#convert(jkf)でjkfから各フォーマットへ変換できます。

jkf = kif_parser.parse(kif_str) #=> Hash
jkf = ki2_parser.parse(ki2_str) #=> Hash
jkf = csa_parser.parse(csa_str) #=> Hash
kif = kif_converter.parse(jkf) #=> String
ki2 = ki2_converter.parse(jkf) #=> String
csa = csa_converter.parse(jkf) #=> String

Contributing

バグレポートやプルリクエストはGithubでよろしくお願いします。 https://github.com/iyuuya/jkf.

License

ライセンスはMITです。 MIT License.

jkf's People

Contributors

iyuuya avatar

Watchers

James Cloos avatar  avatar

Forkers

komagata

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.