Last active
December 9, 2018 14:06
-
-
Save flatfisher/0b04dcaa339144639d1209f23d53e84f to your computer and use it in GitHub Desktop.
Slackでよく使われる単語をまとめてみた ref: https://qiita.com/flatfisher/items/4000f54e15e471f83def
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew insatll mecab mecab-ipadic | |
$ which mecab-config | |
/usr/local/bin/mecab-config //こんな感じになればOK | |
// 環境変数を作成 | |
$ export CGO_LDFLAGS="`mecab-config --libs`" | |
$ export CGO_CFLAGS="-I`mecab-config --inc-dir`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ [こちら 結婚式 土曜日 日曜日 結婚式 チャンネル] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ [{お答え 1} {大丈夫 10} {どちら 2} {どっち 1} {タイミング 3} {マグロ 2}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ [{大丈夫 10} {タイミング 3} {どちら 2} {マグロ 2} {お答え 1} {どっち 1}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
チャンネル => 92 | |
お願い => 58 | |
イベント => 57 | |
こちら => 24 | |
オンライン => 22 | |
申し込み => 16 | |
みたい => 16 | |
ページ => 14 | |
スピーカー => 13 | |
大丈夫 => 10 | |
コード => 9 | |
みんな => 9 | |
レポート => 7 | |
カレー => 7 | |
フォーム => 7 | |
スライド => 7 | |
セッション => 7 | |
みなさん => 7 | |
トピック => 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"sort" | |
) | |
type Buzzword struct { | |
Word string | |
Count int | |
} | |
type Buzzwords []Buzzword | |
func (p Buzzwords) Len() int { | |
return len(p) | |
} | |
func (p Buzzwords) Swap(i, j int) { | |
p[i], p[j] = p[j], p[i] | |
} | |
type ByCount struct { | |
Buzzwords | |
} | |
func (b ByCount) Less(i, j int) bool { | |
return b.Buzzwords[i].Count > b.Buzzwords[j].Count | |
} | |
func main() { | |
var people Buzzwords = []Buzzword{ | |
{"お答え", 1}, | |
{"大丈夫", 10}, | |
{"どちら", 2}, | |
{"どっち", 1}, | |
{"タイミング", 3}, | |
{"マグロ", 2}, | |
} | |
sort.Sort(ByCount{people}) | |
log.Println(people) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment