Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/go-haiku
俳句(Haiku) detection
https://github.com/mattn/go-haiku
go golang haiku
Last synced: about 9 hours ago
JSON representation
俳句(Haiku) detection
- Host: GitHub
- URL: https://github.com/mattn/go-haiku
- Owner: mattn
- Created: 2015-08-23T05:09:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-02-07T05:34:08.000Z (8 months ago)
- Last Synced: 2024-06-19T00:30:57.975Z (4 months ago)
- Topics: go, golang, haiku
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 44
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# haiku
古池や蛙飛び込む水の音
Haiku Matcher
## Interface
```go
if haiku.Match(text, []int{5, 7, 5}) {
log.Println(arg + " is haiku")
}
``````go
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/mattn/go-haiku/cmd/haiku
```## License
MIT
## Author
Yasuhiro Matsumoto (a.k.a mattn)