Giter Club home page Giter Club logo

go-haiku's Introduction

go-haiku

これは、 mattn/go-haiku のフォークです。 フォーク元では Pure Go で書かれている kagome を形態素解析エンジンとして使用していましたが、 mecab-ipadic-neologd を使おうとするとビルド時間がとてつもなく長くなり、さらに立ち上がりや処理が遅く、メモリをバカ食いしていたため、こちらのフォークでは MeCab に切り替えています。

Haiku Matcher

Interface

if haiku.Match(text, []int{5, 7, 5}) {
    log.Println(arg + " is haiku")
}
for _, h := range haiku.Find(text, []int{5, 7, 5}) {
    log.Println(h + "、575 じゃん")
}

Usage

From argument

$ haiku あぁ柿くへば鐘が鳴るなり法隆寺
柿くへば 鐘が鳴るなり 法隆寺

From stdin

$ cat README.md | haiku
古池や 蛙飛び込む 水の音

Extract 俳句 from URL with -u option

$ haiku -u "https://ja.wikipedia.org/wiki/ハノイの塔"
**に 穴の開いた 大きさの
円盤の 上に大きな 円盤を
有効な 問題として 有名で
円盤を 移動させると すると次
一回り 大きい物の 右隣
一回り 大きい物の 右隣
円盤を 対応付けた とき数字
円盤を 動かすことで 解答が
円盤を 別の柱に 移し替え

Extract 短歌 with -r option

$ haiku -r 5,7,5,7,7 -u "https://ja.wikipedia.org/wiki/フクロウ"
フクロウが 鳴くと明日は 晴れるので 洗濯物を 干せという意味

Installation

$ go get github.com/makotia/go-haiku/cmd/haiku

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

Forked

makotia

go-haiku's People

Contributors

mattn avatar 0x307e avatar ikawaha avatar riku6460 avatar

Stargazers

 avatar Takehiro Ogura avatar

Watchers

James Cloos avatar

Forkers

riku6460

go-haiku's Issues

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.