├── cmd └── turtle │ ├── testdata │ ├── char │ │ └── robot.json │ ├── list │ │ └── categories.json │ ├── search │ │ ├── rocket.json │ │ └── dog.json │ ├── keyword │ │ └── mountain.json │ └── category │ │ └── animals_and_nature.json │ ├── main.go │ ├── random_test.go │ ├── category_test.go │ ├── char_test.go │ ├── keyword_test.go │ ├── search_test.go │ ├── char.go │ ├── keyword.go │ ├── category.go │ ├── search.go │ ├── random.go │ ├── writer.go │ ├── turtle.go │ ├── list_test.go │ ├── turtle_test.go │ ├── list.go │ └── README.md ├── go.mod ├── .gitignore ├── doc.go ├── CONTRIBUTORS.md ├── .github └── workflows │ └── go.yml ├── turtle.go ├── filters.go ├── LICENSE ├── labels.toml ├── filters_test.go ├── examples_test.go ├── CODE_OF_CONDUCT.md ├── README.md ├── turtle_test.go └── go.sum /cmd/turtle/testdata/char/robot.json: -------------------------------------------------------------------------------- 1 | {"name":"robot","category":"people","char":"🤖","keywords":["computer","machine","bot"]} 2 | -------------------------------------------------------------------------------- /cmd/turtle/testdata/list/categories.json: -------------------------------------------------------------------------------- 1 | ["activity","animals_and_nature","flags","food_and_drink","objects","people","symbols","travel_and_places"] 2 | -------------------------------------------------------------------------------- /cmd/turtle/testdata/search/rocket.json: -------------------------------------------------------------------------------- 1 | [{"name":"rocket","category":"travel_and_places","char":"🚀","keywords":["launch","ship","staffmode","NASA","outer space","outer_space","fly"]}] 2 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hackebrot/turtle 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/google/go-cmp v0.4.0 7 | github.com/hackebrot/go-repr v0.1.0 8 | github.com/spf13/cobra v1.0.0 9 | ) 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # VSCode settings 12 | .vscode/ 13 | -------------------------------------------------------------------------------- /cmd/turtle/testdata/keyword/mountain.json: -------------------------------------------------------------------------------- 1 | [{"name":"foggy","category":"travel_and_places","char":"🌁","keywords":["photo","mountain"]},{"name":"mount_fuji","category":"travel_and_places","char":"🗻","keywords":["photo","mountain","nature","japanese"]}] 2 | -------------------------------------------------------------------------------- /doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package turtle is a library for working with emojis. The API ca be used to 3 | retrieve emoji for a specific name, a category or a keyword. You can also 4 | search emojis if you do not know the name of an emoji. 5 | */ 6 | package turtle 7 | -------------------------------------------------------------------------------- /cmd/turtle/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func main() { 9 | cmd := newTurtleCmd(os.Stdout) 10 | 11 | if err := cmd.Execute(); err != nil { 12 | fmt.Fprintf(os.Stderr, "error: %v\n", err) 13 | os.Exit(1) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cmd/turtle/random_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | func TestRunRandom(t *testing.T) { 6 | tests := []cmdTestCase{{ 7 | name: "random", 8 | args: []string{"random"}, 9 | wantError: false, 10 | }} 11 | runTestCmd(t, tests) 12 | } 13 | -------------------------------------------------------------------------------- /cmd/turtle/testdata/search/dog.json: -------------------------------------------------------------------------------- 1 | [{"name":"dog","category":"animals_and_nature","char":"🐶","keywords":["animal","friend","nature","woof","puppy","pet","faithful"]},{"name":"dog2","category":"animals_and_nature","char":"🐕","keywords":["animal","nature","friend","doge","pet","faithful"]},{"name":"hotdog","category":"food_and_drink","char":"🌭","keywords":["food","frankfurter"]}] 2 | -------------------------------------------------------------------------------- /cmd/turtle/category_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | func TestRunCategory(t *testing.T) { 6 | tests := []cmdTestCase{{ 7 | name: "error missing category", 8 | args: []string{"category"}, 9 | wantError: true, 10 | }, { 11 | name: "animals_and_nature", 12 | args: []string{"category", "animals_and_nature"}, 13 | outFile: "category/animals_and_nature.json", 14 | wantError: false, 15 | }} 16 | runTestCmd(t, tests) 17 | } 18 | -------------------------------------------------------------------------------- /cmd/turtle/char_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | func TestRunChar(t *testing.T) { 6 | tests := []cmdTestCase{{ 7 | name: "error missing char", 8 | args: []string{"char"}, 9 | wantError: true, 10 | }, { 11 | name: "error unknown char", 12 | args: []string{"char", "abc"}, 13 | wantError: true, 14 | }, { 15 | name: "robot", 16 | args: []string{"char", "🤖"}, 17 | outFile: "char/robot.json", 18 | wantError: false, 19 | }} 20 | runTestCmd(t, tests) 21 | } 22 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # Contributors 2 | 3 | - Cássio Botaro ([@cassiobotaro][cassiobotaro]) 4 | - Faiyaz Shaikh ([@yTakkar][yTakkar]) 5 | - Raphael Pierzina ([@hackebrot][hackebrot]) 6 | - Sumit ([@sum12][sum12]) 7 | - Kevin O'Neal ([@Scuilion][Scuilion]) 8 | - Tobias Salzmann ([@Eun][Eun]) 9 | 10 | [cassiobotaro]: https://github.com/cassiobotaro 11 | [hackebrot]: https://github.com/hackebrot 12 | [yTakkar]: https://github.com/yTakkar 13 | [sum12]: https://github.com/sum12 14 | [Scuilion]: https://github.com/Scuilion 15 | [Eun]: https://github.com/Eun 16 | -------------------------------------------------------------------------------- /cmd/turtle/keyword_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | func TestRunKeyword(t *testing.T) { 6 | tests := []cmdTestCase{{ 7 | name: "error missing keyword", 8 | args: []string{"keyword"}, 9 | wantError: true, 10 | }, { 11 | name: "error unknown keyword", 12 | args: []string{"keyword", "foo"}, 13 | wantError: true, 14 | }, { 15 | name: "mountain", 16 | args: []string{"keyword", "mountain"}, 17 | outFile: "keyword/mountain.json", 18 | wantError: false, 19 | }} 20 | runTestCmd(t, tests) 21 | } 22 | -------------------------------------------------------------------------------- /cmd/turtle/search_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | func TestRunSearch(t *testing.T) { 6 | tests := []cmdTestCase{{ 7 | name: "error no match", 8 | args: []string{"search", "aaaaaaaaaa"}, 9 | wantError: true, 10 | }, { 11 | name: "single match", 12 | args: []string{"search", "rocket"}, 13 | outFile: "search/rocket.json", 14 | wantError: false, 15 | }, { 16 | name: "multiple matches", 17 | args: []string{"search", "dog"}, 18 | outFile: "search/dog.json", 19 | wantError: false, 20 | }} 21 | runTestCmd(t, tests) 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: Go 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | 11 | build: 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | os: [ubuntu-latest, windows-latest, macos-latest] 16 | 17 | name: Build 📦🚧🤖 18 | runs-on: ${{ matrix.os }} 19 | steps: 20 | 21 | - name: Set up Go 1.17 💻 22 | uses: actions/setup-go@v2 23 | with: 24 | go-version: 1.17 25 | 26 | - name: Check out code 🐢 27 | uses: actions/checkout@v2 28 | 29 | - name: Download dependencies 📦 30 | run: go mod download 31 | 32 | - name: Build 🚧 33 | run: go build -v ./... 34 | 35 | - name: Test 🤖 36 | run: go test -v ./... 37 | -------------------------------------------------------------------------------- /cmd/turtle/char.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | "github.com/hackebrot/turtle" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func newCharCmd(w io.Writer) *cobra.Command { 12 | return &cobra.Command{ 13 | Use: "char [CHAR]", 14 | Short: "Print the emoji for the emoji character", 15 | Long: "Print the emoji for the emoji character", 16 | Args: cobra.ExactArgs(1), 17 | RunE: func(cmd *cobra.Command, args []string) error { 18 | return runChar(w, args[0]) 19 | }, 20 | } 21 | } 22 | 23 | func runChar(w io.Writer, c string) error { 24 | 25 | e, ok := turtle.EmojisByChar[c] 26 | 27 | if !ok { 28 | return fmt.Errorf("cannot find emoji with emoji character %q", c) 29 | } 30 | 31 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 32 | 33 | if err != nil { 34 | return fmt.Errorf("error creating JSONWriter: %v", err) 35 | } 36 | 37 | return j.WriteEmoji(e) 38 | } 39 | -------------------------------------------------------------------------------- /cmd/turtle/keyword.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | "github.com/hackebrot/turtle" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func newKeywordCmd(w io.Writer) *cobra.Command { 12 | return &cobra.Command{ 13 | Use: "keyword [KEYWORD]", 14 | Short: "Print all emojis with the keyword", 15 | Long: "Print all emojis with the keyword", 16 | Args: cobra.ExactArgs(1), 17 | RunE: func(cmd *cobra.Command, args []string) error { 18 | return runKeyword(w, args[0]) 19 | }, 20 | } 21 | } 22 | 23 | func runKeyword(w io.Writer, k string) error { 24 | 25 | emojis := turtle.Keyword(k) 26 | 27 | if emojis == nil { 28 | return fmt.Errorf("cannot find emojis for keyword %q", k) 29 | } 30 | 31 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 32 | 33 | if err != nil { 34 | return fmt.Errorf("error creating JSONWriter: %v", err) 35 | } 36 | 37 | return j.WriteEmojis(emojis) 38 | } 39 | -------------------------------------------------------------------------------- /cmd/turtle/category.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | "github.com/hackebrot/turtle" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func newCategoryCmd(w io.Writer) *cobra.Command { 12 | return &cobra.Command{ 13 | Use: "category [CATEGORY]", 14 | Short: "Print all emojis of the category", 15 | Long: "Print all emojis of the category", 16 | Args: cobra.ExactArgs(1), 17 | RunE: func(cmd *cobra.Command, args []string) error { 18 | return runCategory(w, args[0]) 19 | }, 20 | } 21 | } 22 | 23 | func runCategory(w io.Writer, c string) error { 24 | 25 | emojis := turtle.Category(c) 26 | 27 | if emojis == nil { 28 | return fmt.Errorf("cannot find emojis of category %q", c) 29 | } 30 | 31 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 32 | 33 | if err != nil { 34 | return fmt.Errorf("error creating JSONWriter: %v", err) 35 | } 36 | 37 | return j.WriteEmojis(emojis) 38 | } 39 | -------------------------------------------------------------------------------- /turtle.go: -------------------------------------------------------------------------------- 1 | package turtle 2 | 3 | // Version of the turtle library 4 | const Version = "v0.2.0" 5 | 6 | // Emojis maps a name to an Emoji 7 | var Emojis = make(map[string]*Emoji) 8 | 9 | // EmojisByChar maps a character to an Emoji 10 | var EmojisByChar = make(map[string]*Emoji) 11 | 12 | func init() { 13 | for _, e := range emojis { 14 | Emojis[e.Name] = e 15 | EmojisByChar[e.Char] = e 16 | } 17 | } 18 | 19 | // Search emojis by a name 20 | func Search(s string) []*Emoji { 21 | return search(emojis, s) 22 | } 23 | 24 | // Keyword filters the emojis by a keyword 25 | func Keyword(k string) []*Emoji { 26 | return keyword(emojis, k) 27 | } 28 | 29 | // Category filters the emojis by a category 30 | func Category(c string) []*Emoji { 31 | return category(emojis, c) 32 | } 33 | 34 | // Filter the emojis based on the given comparison function 35 | func Filter(f func(e *Emoji) bool) []*Emoji { 36 | return filter(emojis, f) 37 | } 38 | -------------------------------------------------------------------------------- /cmd/turtle/search.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | "github.com/hackebrot/turtle" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | func newSearchCmd(w io.Writer) *cobra.Command { 12 | return &cobra.Command{ 13 | Use: "search [STRING]", 14 | Short: "Print emojis with a name that contains the search string", 15 | Long: "Print emojis with a name that contains the search string", 16 | Args: cobra.ExactArgs(1), 17 | RunE: func(cmd *cobra.Command, args []string) error { 18 | return runSearch(w, args[0]) 19 | }, 20 | } 21 | } 22 | 23 | func runSearch(w io.Writer, s string) error { 24 | 25 | emojis := turtle.Search(s) 26 | 27 | if emojis == nil { 28 | return fmt.Errorf("cannot find emojis for search %q", s) 29 | } 30 | 31 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 32 | 33 | if err != nil { 34 | return fmt.Errorf("error creating JSONWriter: %v", err) 35 | } 36 | 37 | return j.WriteEmojis(emojis) 38 | } 39 | -------------------------------------------------------------------------------- /cmd/turtle/random.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "math/rand" 7 | "time" 8 | 9 | "github.com/hackebrot/turtle" 10 | "github.com/spf13/cobra" 11 | ) 12 | 13 | func newRandomCmd(w io.Writer) *cobra.Command { 14 | return &cobra.Command{ 15 | Use: "random", 16 | Short: "Print a random emoji", 17 | Long: "Print a random emoji", 18 | Args: cobra.NoArgs, 19 | RunE: func(cmd *cobra.Command, args []string) error { 20 | return runRandom(w) 21 | }, 22 | } 23 | } 24 | 25 | func runRandom(w io.Writer) error { 26 | 27 | emojis := make([]*turtle.Emoji, 0, len(turtle.Emojis)) 28 | 29 | for _, value := range turtle.Emojis { 30 | emojis = append(emojis, value) 31 | } 32 | 33 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 34 | 35 | if err != nil { 36 | return fmt.Errorf("error creating JSONWriter: %v", err) 37 | } 38 | 39 | return j.WriteEmoji(emojis[rand.Intn(len(emojis))]) 40 | } 41 | 42 | func init() { 43 | rand.Seed(time.Now().Unix()) 44 | } 45 | -------------------------------------------------------------------------------- /filters.go: -------------------------------------------------------------------------------- 1 | package turtle 2 | 3 | import "strings" 4 | 5 | // filter a given slice of Emoji by f 6 | func filter(emojis []*Emoji, f func(e *Emoji) bool) []*Emoji { 7 | var r []*Emoji 8 | for _, e := range emojis { 9 | if f(e) { 10 | r = append(r, e) 11 | } 12 | } 13 | return r 14 | } 15 | 16 | // category filters a slice of Emoji by Category 17 | func category(emojis []*Emoji, c string) []*Emoji { 18 | return filter(emojis, func(e *Emoji) bool { 19 | return e.Category == c 20 | }) 21 | } 22 | 23 | // keyword filters a slice of Emoji by Keywords 24 | func keyword(emojis []*Emoji, k string) []*Emoji { 25 | return filter(emojis, func(e *Emoji) bool { 26 | for _, keyword := range e.Keywords { 27 | if keyword == k { 28 | return true 29 | } 30 | } 31 | return false 32 | }) 33 | } 34 | 35 | // search Emoji in a slice by Name 36 | func search(emojis []*Emoji, s string) []*Emoji { 37 | return filter(emojis, func(e *Emoji) bool { 38 | return strings.Contains(e.Name, s) 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Raphael Pierzina 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /labels.toml: -------------------------------------------------------------------------------- 1 | [bug] 2 | color = "ea707a" 3 | name = "bug" 4 | description = "Bugs and problems with turtle" 5 | 6 | ["code quality"] 7 | color = "fcc4db" 8 | name = "code quality" 9 | description = "Tasks related to linting, coding style" 10 | 11 | [dependencies] 12 | color = "43a2b7" 13 | name = "dependencies" 14 | description = "Tasks related to managing dependencies" 15 | 16 | [discussion] 17 | color = "8f7ad6" 18 | name = "discussion" 19 | description = "Issues for discussing ideas for features" 20 | 21 | ["do not merge"] 22 | color = "e069aa" 23 | name = "do not merge" 24 | description = "Pull requests which must not be merged" 25 | 26 | [docs] 27 | color = "2abf88" 28 | name = "docs" 29 | description = "Tasks to write and update documentation" 30 | 31 | [enhancement] 32 | color = "81c4e2" 33 | name = "enhancement" 34 | description = "New feature or enhancement for turtle" 35 | 36 | ["good first issue"] 37 | color = "b6f4a1" 38 | name = "good first issue" 39 | description = "Tasks for new contributors to turtle" 40 | 41 | [misc] 42 | color = "f9d03b" 43 | name = "misc" 44 | description = "Tasks that don't fit any of the other categories" 45 | 46 | [project] 47 | color = "bbd1f7" 48 | name = "project" 49 | description = "Tasks related to managing turtle" 50 | -------------------------------------------------------------------------------- /cmd/turtle/writer.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "io" 7 | 8 | "github.com/hackebrot/turtle" 9 | ) 10 | 11 | // JSONWriter writes Emojis as JSON 12 | type JSONWriter struct { 13 | e *json.Encoder 14 | } 15 | 16 | // NewJSONWriter creates a new JSONWriter 17 | func NewJSONWriter(w io.Writer, options ...func(*JSONWriter) error) (*JSONWriter, error) { 18 | j := &JSONWriter{e: json.NewEncoder(w)} 19 | 20 | for _, option := range options { 21 | if err := option(j); err != nil { 22 | return nil, fmt.Errorf("error applying option: %v", err) 23 | } 24 | } 25 | 26 | return j, nil 27 | } 28 | 29 | // WithIndent sets an indent on adds a separator to a thread 30 | func WithIndent(prefix, indent string) func(*JSONWriter) error { 31 | return func(j *JSONWriter) error { 32 | j.e.SetIndent(prefix, indent) 33 | return nil 34 | } 35 | } 36 | 37 | // WriteEmoji to an io.Writer as JSON 38 | func (j *JSONWriter) WriteEmoji(emoji *turtle.Emoji) error { 39 | return j.e.Encode(emoji) 40 | } 41 | 42 | // WriteEmojis to an io.Writer as JSON 43 | func (j *JSONWriter) WriteEmojis(emojis []*turtle.Emoji) error { 44 | return j.e.Encode(emojis) 45 | } 46 | 47 | // Write a value to an io.Writer as JSON 48 | func (j *JSONWriter) Write(v interface{}) error { 49 | return j.e.Encode(v) 50 | } 51 | -------------------------------------------------------------------------------- /cmd/turtle/turtle.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | "github.com/hackebrot/turtle" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | var indent string 12 | var prefix string 13 | 14 | // Create a new turtle command with the given output 15 | func newTurtleCmd(w io.Writer) *cobra.Command { 16 | turtleCmd := &cobra.Command{ 17 | Use: "turtle [NAME]", 18 | Short: "Print the emoji with the specified name identifier", 19 | Long: "Print the emoji with the specified name identifier", 20 | Args: cobra.ExactArgs(1), 21 | RunE: func(cmd *cobra.Command, args []string) error { 22 | return runTurtle(w, args[0]) 23 | }, 24 | Version: turtle.Version, 25 | } 26 | 27 | turtleCmd.PersistentFlags().StringVarP(&indent, "indent", "i", "", "indent for JSON output") 28 | turtleCmd.PersistentFlags().StringVarP(&prefix, "prefix", "p", "", "prefix for JSON output") 29 | 30 | turtleCmd.SetVersionTemplate("{{with .Name}}{{printf \"%s \" .}}{{end}}{{printf \"%s\" .Version}}\n") 31 | 32 | turtleCmd.AddCommand(newCharCmd(w)) 33 | turtleCmd.AddCommand(newCategoryCmd(w)) 34 | turtleCmd.AddCommand(newKeywordCmd(w)) 35 | turtleCmd.AddCommand(newSearchCmd(w)) 36 | turtleCmd.AddCommand(newListCmd(w)) 37 | turtleCmd.AddCommand(newRandomCmd(w)) 38 | 39 | return turtleCmd 40 | } 41 | 42 | func runTurtle(w io.Writer, name string) error { 43 | 44 | e, ok := turtle.Emojis[name] 45 | 46 | if !ok { 47 | return fmt.Errorf("cannot find emoji with name %q", name) 48 | } 49 | 50 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 51 | 52 | if err != nil { 53 | return fmt.Errorf("error creating JSONWriter: %v", err) 54 | } 55 | 56 | return j.WriteEmoji(e) 57 | } 58 | -------------------------------------------------------------------------------- /filters_test.go: -------------------------------------------------------------------------------- 1 | package turtle 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/google/go-cmp/cmp" 7 | "github.com/hackebrot/go-repr/repr" 8 | ) 9 | 10 | func TestFilter(t *testing.T) { 11 | tests := []struct { 12 | name string 13 | f func(e *Emoji) bool 14 | want []*Emoji 15 | }{ 16 | { 17 | name: "no matches", 18 | f: func(e *Emoji) bool { 19 | return e.Name == "nope" 20 | }, 21 | want: nil, 22 | }, 23 | { 24 | name: "single match", 25 | f: func(e *Emoji) bool { 26 | for _, keyword := range e.Keywords { 27 | if keyword == "developer" { 28 | return true 29 | } 30 | } 31 | return false 32 | }, 33 | want: []*Emoji{ 34 | { 35 | Name: "woman_technologist", 36 | Category: "people", 37 | Char: "👩‍💻", 38 | Keywords: []string{"coder", "developer", "engineer", "programmer", "software", "woman", "human"}, 39 | }, 40 | }, 41 | }, 42 | { 43 | name: "multiple matches", 44 | f: func(e *Emoji) bool { 45 | return e.Category == "animals_and_nature" 46 | }, 47 | want: []*Emoji{ 48 | { 49 | Name: "turtle", 50 | Category: "animals_and_nature", 51 | Char: "🐢", 52 | Keywords: []string{"animal", "slow", "nature", "tortoise"}, 53 | }, 54 | { 55 | Name: "dog", 56 | Category: "animals_and_nature", 57 | Char: "🐶", 58 | Keywords: []string{"animal", "friend", "nature", "woof", "puppy", "pet", "faithful"}, 59 | }, 60 | }, 61 | }, 62 | } 63 | 64 | for _, tt := range tests { 65 | t.Run(tt.name, func(t *testing.T) { 66 | if got := filter(testEmojis, tt.f); !cmp.Equal(got, tt.want) { 67 | t.Errorf("filter() = %v, want %v", repr.Repr(got), repr.Repr(tt.want)) 68 | } 69 | }) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /cmd/turtle/list_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/google/go-cmp/cmp" 7 | "github.com/hackebrot/go-repr/repr" 8 | ) 9 | 10 | func TestAddIfUnique(t *testing.T) { 11 | type args struct { 12 | r []string 13 | sItems []string 14 | } 15 | tests := []struct { 16 | name string 17 | args args 18 | want []string 19 | }{ 20 | { 21 | name: "one element", 22 | args: args{ 23 | r: []string{}, 24 | sItems: []string{"hello"}, 25 | }, 26 | want: []string{"hello"}, 27 | }, 28 | { 29 | name: "non empty", 30 | args: args{ 31 | r: []string{"hello"}, 32 | sItems: []string{"world", "zzz"}, 33 | }, 34 | want: []string{"hello", "world", "zzz"}, 35 | }, 36 | { 37 | name: "duplicate", 38 | args: args{ 39 | r: []string{"hello"}, 40 | sItems: []string{"world", "hello"}, 41 | }, 42 | want: []string{"hello", "world"}, 43 | }, 44 | { 45 | name: "sorted", 46 | args: args{ 47 | r: []string{"hello"}, 48 | sItems: []string{"world", "a"}, 49 | }, 50 | want: []string{"a", "hello", "world"}, 51 | }, 52 | } 53 | 54 | for _, tt := range tests { 55 | t.Run(tt.name, func(t *testing.T) { 56 | if got := addIfUnique(tt.args.r, tt.args.sItems...); !cmp.Equal(got, tt.want) { 57 | t.Errorf("addIfUnique() = %v, want %v", repr.Repr(got), repr.Repr(tt.want)) 58 | } 59 | }) 60 | } 61 | } 62 | func TestRunList(t *testing.T) { 63 | tests := []cmdTestCase{{ 64 | name: "show help for missing subcommand", 65 | args: []string{"list"}, 66 | wantError: false, 67 | }, { 68 | name: "categories", 69 | args: []string{"list", "categories"}, 70 | outFile: "list/categories.json", 71 | wantError: false, 72 | }, { 73 | name: "keywords", 74 | args: []string{"list", "keywords"}, 75 | wantError: false, 76 | }, { 77 | name: "names", 78 | args: []string{"list", "names"}, 79 | wantError: false, 80 | }} 81 | runTestCmd(t, tests) 82 | } 83 | -------------------------------------------------------------------------------- /cmd/turtle/turtle_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "io/ioutil" 6 | "path/filepath" 7 | "strings" 8 | "testing" 9 | 10 | "github.com/google/go-cmp/cmp" 11 | "github.com/hackebrot/go-repr/repr" 12 | ) 13 | 14 | // cmdTestCase describes a test case for turtle commands 15 | type cmdTestCase struct { 16 | name string 17 | args []string 18 | outFile string 19 | wantError bool 20 | } 21 | 22 | const testdata = "testdata" 23 | 24 | // runTestCmd is a test helper that runs the given test cases 25 | func runTestCmd(t *testing.T, tests []cmdTestCase) { 26 | t.Helper() 27 | 28 | for _, tt := range tests { 29 | t.Run(tt.name, func(t *testing.T) { 30 | t.Logf("💻 running 'turtle %s'", strings.Join(tt.args, " ")) 31 | 32 | out, err := executeCmd(tt.args) 33 | 34 | if tt.wantError && err == nil { 35 | t.Fatalf("🤖 command did not return error") 36 | } 37 | 38 | if !tt.wantError && err != nil { 39 | t.Errorf("🤖 unexpected error: %v", err) 40 | } 41 | 42 | if tt.outFile != "" { 43 | data, err := ioutil.ReadFile(filepath.Join(testdata, tt.outFile)) 44 | if err != nil { 45 | t.Fatalf("🤖 error reading outFile: %v", err) 46 | } 47 | 48 | got := strings.TrimSpace(out) 49 | want := strings.TrimSpace(string(data)) 50 | 51 | if !cmp.Equal(got, want) { 52 | t.Errorf( 53 | "📋 cmd output does not match '%s'\n\ngot:\n%s\n\nwant:\n%s\n", 54 | tt.outFile, 55 | repr.Repr(got), 56 | repr.Repr(want), 57 | ) 58 | } 59 | } 60 | }) 61 | } 62 | } 63 | 64 | // executeCmd creates and executes a new turtle cmd 65 | func executeCmd(args []string) (string, error) { 66 | buf := new(bytes.Buffer) 67 | root := newTurtleCmd(buf) 68 | root.SetOut(buf) 69 | root.SetArgs(args) 70 | 71 | err := root.Execute() 72 | 73 | return buf.String(), err 74 | } 75 | 76 | func TestVersionFlag(t *testing.T) { 77 | tests := []cmdTestCase{{ 78 | name: "version", 79 | args: []string{"--version"}, 80 | wantError: false, 81 | }} 82 | runTestCmd(t, tests) 83 | } 84 | -------------------------------------------------------------------------------- /cmd/turtle/list.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "sort" 7 | 8 | "github.com/hackebrot/turtle" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func newListCmd(w io.Writer) *cobra.Command { 13 | listCmd := &cobra.Command{ 14 | Use: "list", 15 | Short: "Print a list of values from the turtle library", 16 | Long: `Print a list of values from the turtle library. 17 | 18 | List requires a subcommand, e.g. turte list categories`, 19 | Args: cobra.NoArgs, 20 | } 21 | categoriesCmd := &cobra.Command{ 22 | Use: "categories", 23 | Short: "Print all categories from the turtle library", 24 | Long: "Print all categories from the turtle library", 25 | Args: cobra.NoArgs, 26 | RunE: func(cmd *cobra.Command, args []string) error { 27 | return runCategories(w) 28 | }, 29 | } 30 | keywordsCmd := &cobra.Command{ 31 | Use: "keywords", 32 | Short: "Print all keywords from the turtle library", 33 | Long: "Print all keywords from the turtle library", 34 | Args: cobra.NoArgs, 35 | RunE: func(cmd *cobra.Command, args []string) error { 36 | return runKeywords(w) 37 | }, 38 | } 39 | namesCmd := &cobra.Command{ 40 | Use: "names", 41 | Short: "Print all names from the turtle library", 42 | Long: "Print all names from the turtle library", 43 | Args: cobra.NoArgs, 44 | RunE: func(cmd *cobra.Command, args []string) error { 45 | return runNames(w) 46 | }, 47 | } 48 | listCmd.AddCommand(categoriesCmd) 49 | listCmd.AddCommand(keywordsCmd) 50 | listCmd.AddCommand(namesCmd) 51 | return listCmd 52 | } 53 | 54 | // addIfUnique adds strings to a given slice, if it 55 | // cannot be found in the slice and then sorts the slice 56 | func addIfUnique(r []string, sItems ...string) []string { 57 | 58 | // The slice must be sorted in ascending order 59 | // before we use it in sort.SearchStrings 60 | sort.Strings(r) 61 | 62 | for _, s := range sItems { 63 | i := sort.SearchStrings(r, s) 64 | 65 | if i >= len(r) || r[i] != s { 66 | // r does not contain s, add it and sort 67 | r = append(r, s) 68 | sort.Strings(r) 69 | } 70 | } 71 | 72 | return r 73 | } 74 | 75 | func runKeywords(w io.Writer) error { 76 | var keywords []string 77 | 78 | for _, e := range turtle.Emojis { 79 | keywords = addIfUnique(keywords, e.Keywords...) 80 | } 81 | 82 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 83 | if err != nil { 84 | return fmt.Errorf("error creating JSONWriter: %v", err) 85 | } 86 | 87 | return j.Write(keywords) 88 | } 89 | 90 | func runCategories(w io.Writer) error { 91 | var categories []string 92 | 93 | for _, e := range turtle.Emojis { 94 | categories = addIfUnique(categories, e.Category) 95 | } 96 | 97 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 98 | if err != nil { 99 | return fmt.Errorf("error creating JSONWriter: %v", err) 100 | } 101 | 102 | return j.Write(categories) 103 | } 104 | 105 | func runNames(w io.Writer) error { 106 | var names []string 107 | 108 | for _, e := range turtle.Emojis { 109 | names = addIfUnique(names, e.Name) 110 | } 111 | 112 | j, err := NewJSONWriter(w, WithIndent(prefix, indent)) 113 | if err != nil { 114 | return fmt.Errorf("error creating JSONWriter: %v", err) 115 | } 116 | 117 | return j.Write(names) 118 | } 119 | -------------------------------------------------------------------------------- /examples_test.go: -------------------------------------------------------------------------------- 1 | package turtle 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | // Example for using the Emojis map to find an 9 | // emoji for the specified name. 10 | func ExampleEmojis() { 11 | name := "turtle" 12 | emoji, ok := Emojis[name] 13 | 14 | if !ok { 15 | fmt.Fprintf(os.Stderr, "no emoji found for name: %v\n", name) 16 | os.Exit(1) 17 | } 18 | 19 | fmt.Printf("Name: %q\n", emoji.Name) 20 | fmt.Printf("Char: %s\n", emoji.Char) 21 | fmt.Printf("Category: %q\n", emoji.Category) 22 | fmt.Printf("Keywords: %q\n", emoji.Keywords) 23 | 24 | // Output: 25 | // Name: "turtle" 26 | // Char: 🐢 27 | // Category: "animals_and_nature" 28 | // Keywords: ["animal" "slow" "nature" "tortoise"] 29 | } 30 | 31 | // Example for using the EmojisByChar map to find an 32 | // emoji for the specified emoji character. 33 | func ExampleEmojisByChar() { 34 | char := "🐢" 35 | emoji, ok := EmojisByChar[char] 36 | 37 | if !ok { 38 | fmt.Fprintf(os.Stderr, "no emoji found for char: %v\n", char) 39 | os.Exit(1) 40 | } 41 | 42 | fmt.Printf("Name: %q\n", emoji.Name) 43 | fmt.Printf("Char: %s\n", emoji.Char) 44 | fmt.Printf("Category: %q\n", emoji.Category) 45 | fmt.Printf("Keywords: %q\n", emoji.Keywords) 46 | 47 | // Output: 48 | // Name: "turtle" 49 | // Char: 🐢 50 | // Category: "animals_and_nature" 51 | // Keywords: ["animal" "slow" "nature" "tortoise"] 52 | } 53 | 54 | // Example for using the Category function to find all 55 | // emojis of the specified category. 56 | func ExampleCategory() { 57 | c := "travel_and_places" 58 | emojis := Category(c) 59 | 60 | if emojis == nil { 61 | fmt.Fprintf(os.Stderr, "no emojis found for category: %v\n", c) 62 | os.Exit(1) 63 | } 64 | 65 | fmt.Printf("%s: %s\n", c, emojis[:3]) 66 | 67 | // Output: 68 | // travel_and_places: [🚡 ✈️ 🚑] 69 | } 70 | 71 | // Example for using the Keyword function to find all 72 | // emojis with the specified keyword. 73 | func ExampleKeyword() { 74 | k := "happy" 75 | emojis := Keyword(k) 76 | 77 | if emojis == nil { 78 | fmt.Fprintf(os.Stderr, "no emoji found for keyword: %v\n", k) 79 | os.Exit(1) 80 | } 81 | 82 | fmt.Printf("%s: %s", k, emojis[:4]) 83 | 84 | // Output: 85 | // happy: [😊 😁 😀 😂] 86 | } 87 | 88 | // Example for using the Search function to find all 89 | // emojis with a name that contains the search string. 90 | func ExampleSearch() { 91 | s := "computer" 92 | emojis := Search(s) 93 | 94 | if emojis == nil { 95 | fmt.Fprintf(os.Stderr, "no emojis found for search: %v\n", s) 96 | os.Exit(1) 97 | } 98 | 99 | fmt.Printf("%s: %s", s, emojis) 100 | 101 | // Output: 102 | // computer: [💻 🖱 🖥] 103 | } 104 | 105 | // Example for using the Filter function to find all 106 | // emojis in a category with a specific keyword 107 | func ExampleFilter() { 108 | emojis := Filter(func(e *Emoji) bool { 109 | if e.Category == "animals_and_nature" { 110 | for _, keyword := range e.Keywords { 111 | if keyword == "world" { 112 | return true 113 | } 114 | } 115 | } 116 | return false 117 | }) 118 | 119 | if emojis == nil { 120 | fmt.Fprintf(os.Stderr, "no emojis found in animals_and_nature with keyword world\n") 121 | os.Exit(1) 122 | } 123 | 124 | fmt.Printf("emojis: %s", emojis) 125 | 126 | // Output: 127 | // emojis: [🌍 🌎 🌏] 128 | } 129 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at raphael@hackebrot.de. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # turtle 2 | 3 | Emojis for Go 😄🐢🚀 4 | 5 | ## Reference 6 | 7 | Follow this link to view the reference documentation: [GoDoc Reference][godoc] 📝 8 | 9 | ## Installation 10 | 11 | ### Library 12 | 13 | To install the **turtle** library run: 14 | 15 | ``go get github.com/hackebrot/turtle`` 16 | 17 | ### CLI app 18 | 19 | If you would also like to use the **turtle** CLI app run: 20 | 21 | ``go get github.com/hackebrot/turtle/cmd/turtle`` 22 | 23 | See the [turtle CLI][cli] README for more information. 24 | 25 | ## Usage 26 | 27 | ### Emoji lookup 28 | 29 | ``turtle.Emojis`` is a map which contains all emojis available in **turtle**. 30 | You can use it to look up emoji by their name. 31 | 32 | ```go 33 | package main 34 | 35 | import ( 36 | "fmt" 37 | "os" 38 | 39 | "github.com/hackebrot/turtle" 40 | ) 41 | 42 | func main() { 43 | name := "turtle" 44 | emoji, ok := turtle.Emojis[name] 45 | 46 | if !ok { 47 | fmt.Fprintf(os.Stderr, "no emoji found for name: %v\n", name) 48 | os.Exit(1) 49 | } 50 | 51 | fmt.Printf("Name: %q\n", emoji.Name) 52 | fmt.Printf("Char: %s\n", emoji.Char) 53 | fmt.Printf("Category: %q\n", emoji.Category) 54 | fmt.Printf("Keywords: %q\n", emoji.Keywords) 55 | } 56 | ``` 57 | 58 | ```text 59 | Name: "turtle" 60 | Char: 🐢 61 | Category: "animals_and_nature" 62 | Keywords: ["animal" "slow" "nature" "tortoise"] 63 | ``` 64 | 65 | ### Search 66 | 67 | Use ``Search()`` to find all emojis with a name that contains the search string. 68 | 69 | ```go 70 | package main 71 | 72 | import ( 73 | "fmt" 74 | "os" 75 | 76 | "github.com/hackebrot/turtle" 77 | ) 78 | 79 | func main() { 80 | s := "computer" 81 | emojis := turtle.Search(s) 82 | 83 | if emojis == nil { 84 | fmt.Fprintf(os.Stderr, "no emojis found for search: %v\n", s) 85 | os.Exit(1) 86 | } 87 | 88 | fmt.Printf("%s: %s\n", s, emojis) 89 | } 90 | ``` 91 | 92 | ```text 93 | computer: [💻 🖱 🖥 ] 94 | ``` 95 | 96 | ### Category 97 | 98 | Use ``Category()`` to find all emojis of the specified category. 99 | 100 | ```go 101 | package main 102 | 103 | import ( 104 | "fmt" 105 | "os" 106 | 107 | "github.com/hackebrot/turtle" 108 | ) 109 | 110 | func main() { 111 | c := "travel_and_places" 112 | emojis := turtle.Category(c) 113 | 114 | if emojis == nil { 115 | fmt.Fprintf(os.Stderr, "no emojis found for category: %v\n", c) 116 | os.Exit(1) 117 | } 118 | 119 | fmt.Printf("%s: %s\n", c, emojis) 120 | } 121 | ``` 122 | 123 | ```text 124 | travel_and_places: [🚡 ✈️ 🚑 ] 125 | ``` 126 | 127 | ### Keyword 128 | 129 | Use ``Keyword()`` to find all emojis by a keyword. 130 | 131 | ```go 132 | package main 133 | 134 | import ( 135 | "fmt" 136 | "os" 137 | 138 | "github.com/hackebrot/turtle" 139 | ) 140 | 141 | func main() { 142 | k := "happy" 143 | emojis := turtle.Keyword(k) 144 | 145 | if emojis == nil { 146 | fmt.Fprintf(os.Stderr, "no emoji found for keyword: %v\n", k) 147 | os.Exit(1) 148 | } 149 | 150 | fmt.Printf("%s: %s\n", k, emojis) 151 | } 152 | ``` 153 | 154 | ```text 155 | happy: [😊 😁 😀 😂 ] 156 | ``` 157 | 158 | ## Emojis 159 | 160 | Emoji names, categories and keywords are based on the fantastic 161 | [muan/emojilib][emojilib] keyword library 📖 162 | 163 | At this point, the **turtle** project supports the emojis that are also 164 | available on GitHub. See the [GitHub REST API documentation][github-api] for 165 | more information. 166 | 167 | ## Issues 168 | 169 | If you encounter any problems, please [file an issue][new-issue] along with a 170 | detailed description. 171 | 172 | ## Contributing 173 | 174 | Contributions are welcome, and they are greatly appreciated! Every little bit 175 | helps, and credit will always be given. 176 | 177 | ## License 178 | 179 | Distributed under the terms of the [MIT license][mit], turtle is free and 180 | open source software. 181 | 182 | [cli]: /cmd/turtle/README.md 183 | [emojilib]: https://github.com/muan/emojilib 184 | [github-api]: https://developer.github.com/v3/emojis/ 185 | [godoc]: https://godoc.org/github.com/hackebrot/turtle (See GoDoc Reference) 186 | [mit]: /LICENSE 187 | [new-issue]: https://github.com/hackebrot/turtle/issues/new 188 | -------------------------------------------------------------------------------- /turtle_test.go: -------------------------------------------------------------------------------- 1 | package turtle 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/google/go-cmp/cmp" 7 | "github.com/hackebrot/go-repr/repr" 8 | ) 9 | 10 | var testEmojis = []*Emoji{ 11 | { 12 | Name: "turtle", 13 | Category: "animals_and_nature", 14 | Char: "🐢", 15 | Keywords: []string{"animal", "slow", "nature", "tortoise"}, 16 | }, 17 | { 18 | Name: "coffee", 19 | Category: "food_and_drink", 20 | Char: "☕", 21 | Keywords: []string{"beverage", "caffeine", "latte", "espresso"}, 22 | }, 23 | { 24 | Name: "woman_technologist", 25 | Category: "people", 26 | Char: "👩‍💻", 27 | Keywords: []string{"coder", "developer", "engineer", "programmer", "software", "woman", "human"}, 28 | }, 29 | { 30 | Name: "dog", 31 | Category: "animals_and_nature", 32 | Char: "🐶", 33 | Keywords: []string{"animal", "friend", "nature", "woof", "puppy", "pet", "faithful"}, 34 | }, 35 | } 36 | 37 | func TestCategory(t *testing.T) { 38 | tests := []struct { 39 | name string 40 | c string 41 | want []*Emoji 42 | }{ 43 | { 44 | name: "no matches", 45 | c: "activity", 46 | want: nil, 47 | }, 48 | { 49 | name: "multiple matches", 50 | c: "animals_and_nature", 51 | want: []*Emoji{ 52 | { 53 | Name: "turtle", 54 | Category: "animals_and_nature", 55 | Char: "🐢", 56 | Keywords: []string{"animal", "slow", "nature", "tortoise"}, 57 | }, 58 | { 59 | Name: "dog", 60 | Category: "animals_and_nature", 61 | Char: "🐶", 62 | Keywords: []string{"animal", "friend", "nature", "woof", "puppy", "pet", "faithful"}, 63 | }, 64 | }, 65 | }, 66 | } 67 | 68 | for _, tt := range tests { 69 | t.Run(tt.name, func(t *testing.T) { 70 | if got := category(testEmojis, tt.c); !cmp.Equal(got, tt.want) { 71 | t.Errorf("category() = %v, want %v", repr.Repr(got), repr.Repr(tt.want)) 72 | } 73 | }) 74 | } 75 | } 76 | 77 | func TestKeyword(t *testing.T) { 78 | tests := []struct { 79 | name string 80 | k string 81 | want []*Emoji 82 | }{ 83 | { 84 | name: "no matches", 85 | k: "weather", 86 | want: nil, 87 | }, 88 | { 89 | name: "single match", 90 | k: "programmer", 91 | want: []*Emoji{ 92 | { 93 | Name: "woman_technologist", 94 | Category: "people", 95 | Char: "👩‍💻", 96 | Keywords: []string{"coder", "developer", "engineer", "programmer", "software", "woman", "human"}, 97 | }, 98 | }, 99 | }, 100 | } 101 | for _, tt := range tests { 102 | t.Run(tt.name, func(t *testing.T) { 103 | if got := keyword(testEmojis, tt.k); !cmp.Equal(got, tt.want) { 104 | t.Errorf("keyword() = %v, want %v", repr.Repr(got), repr.Repr(tt.want)) 105 | } 106 | }) 107 | } 108 | } 109 | 110 | func TestSearch(t *testing.T) { 111 | tests := []struct { 112 | name string 113 | s string 114 | want []*Emoji 115 | }{ 116 | { 117 | name: "no matches", 118 | s: "nope", 119 | want: nil, 120 | }, 121 | { 122 | name: "substring", 123 | s: "technologist", 124 | want: []*Emoji{ 125 | { 126 | Name: "woman_technologist", 127 | Category: "people", 128 | Char: "👩‍💻", 129 | Keywords: []string{"coder", "developer", "engineer", "programmer", "software", "woman", "human"}, 130 | }, 131 | }, 132 | }, 133 | { 134 | name: "full string", 135 | s: "woman_technologist", 136 | want: []*Emoji{ 137 | { 138 | Name: "woman_technologist", 139 | Category: "people", 140 | Char: "👩‍💻", 141 | Keywords: []string{"coder", "developer", "engineer", "programmer", "software", "woman", "human"}, 142 | }, 143 | }, 144 | }, 145 | } 146 | for _, tt := range tests { 147 | t.Run(tt.name, func(t *testing.T) { 148 | if got := search(testEmojis, tt.s); !cmp.Equal(got, tt.want) { 149 | t.Errorf("search() = %v, want %v", repr.Repr(got), repr.Repr(tt.want)) 150 | } 151 | }) 152 | } 153 | } 154 | 155 | func TestEmojis(t *testing.T) { 156 | want := &Emoji{ 157 | Name: "fox_face", 158 | Category: "animals_and_nature", 159 | Char: "🦊", 160 | Keywords: []string{"animal", "nature", "face"}, 161 | } 162 | 163 | got, ok := Emojis[want.Name] 164 | 165 | if !ok { 166 | t.Fatalf("Emojis does not contain name %v", repr.Repr(want.Name)) 167 | } 168 | 169 | if !cmp.Equal(got, want) { 170 | t.Errorf("Emojis[] = %v, want %v", repr.Repr(got), repr.Repr(want)) 171 | } 172 | } 173 | 174 | func TestEmojisByChar(t *testing.T) { 175 | want := &Emoji{ 176 | Name: "fox_face", 177 | Category: "animals_and_nature", 178 | Char: "🦊", 179 | Keywords: []string{"animal", "nature", "face"}, 180 | } 181 | 182 | got, ok := EmojisByChar[want.Char] 183 | 184 | if !ok { 185 | t.Fatalf("Emojis does not contain char %v", repr.Repr(want.Char)) 186 | } 187 | 188 | if !cmp.Equal(got, want) { 189 | t.Errorf("Emojis[] = %v, want %v", repr.Repr(got), repr.Repr(want)) 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /cmd/turtle/README.md: -------------------------------------------------------------------------------- 1 | # turtle 2 | 3 | CLI for the [turtle library][library] 😄🐢💻 4 | 5 | ## Installation 6 | 7 | ``go get github.com/hackebrot/turtle/cmd/turtle`` 8 | 9 | ## Usage 10 | 11 | ```text 12 | Print the emoji with the specified name identifier 13 | 14 | Usage: 15 | turtle [NAME] [flags] 16 | turtle [command] 17 | 18 | Available Commands: 19 | category Print all emojis of the category 20 | char Print the emoji for the emoji character 21 | help Help about any command 22 | keyword Print all emojis with the keyword 23 | list Print a list of values from the turtle library 24 | random Print a random emoji 25 | search Print emojis with a name that contains the search string 26 | 27 | Flags: 28 | -h, --help help for turtle 29 | -i, --indent string indent for JSON output 30 | -p, --prefix string prefix for JSON output 31 | -v, --version version for turtle 32 | 33 | Use "turtle [command] --help" for more information about a command. 34 | ``` 35 | 36 | ### Emoji lookup 37 | 38 | ```bash 39 | turtle -i " " rocket 40 | ``` 41 | 42 | ```json 43 | { 44 | "name": "rocket", 45 | "category": "travel_and_places", 46 | "char": "🚀", 47 | "keywords": [ 48 | "launch", 49 | "ship", 50 | "staffmode", 51 | "NASA", 52 | "outer space", 53 | "outer_space", 54 | "fly" 55 | ] 56 | } 57 | ``` 58 | 59 | ### Search 60 | 61 | ```bash 62 | turtle -i " " search computer 63 | ``` 64 | 65 | ```json 66 | [ 67 | { 68 | "name": "computer", 69 | "category": "objects", 70 | "char": "💻", 71 | "keywords": [ 72 | "technology", 73 | "laptop", 74 | "screen", 75 | "display", 76 | "monitor" 77 | ] 78 | }, 79 | { 80 | "name": "computer_mouse", 81 | "category": "objects", 82 | "char": "🖱", 83 | "keywords": [ 84 | "click" 85 | ] 86 | }, 87 | { 88 | "name": "desktop_computer", 89 | "category": "objects", 90 | "char": "🖥", 91 | "keywords": [ 92 | "technology", 93 | "computing", 94 | "screen" 95 | ] 96 | } 97 | ] 98 | ``` 99 | 100 | ### Char 101 | 102 | ```bash 103 | turtle -i " " char 🐝 104 | ``` 105 | 106 | ```json 107 | { 108 | "name": "honeybee", 109 | "category": "animals_and_nature", 110 | "char": "🐝", 111 | "keywords": [ 112 | "animal", 113 | "insect", 114 | "nature", 115 | "bug", 116 | "spring", 117 | "honey" 118 | ] 119 | } 120 | ``` 121 | 122 | ### Category 123 | 124 | ```bash 125 | turtle -i " " category travel_and_places 126 | ``` 127 | 128 | ```json 129 | [ 130 | { 131 | "name": "aerial_tramway", 132 | "category": "travel_and_places", 133 | "char": "🚡", 134 | "keywords": [ 135 | "transportation", 136 | "vehicle", 137 | "ski" 138 | ] 139 | }, 140 | { 141 | "name": "airplane", 142 | "category": "travel_and_places", 143 | "char": "✈️", 144 | "keywords": [ 145 | "vehicle", 146 | "transportation", 147 | "flight", 148 | "fly" 149 | ] 150 | }, 151 | { 152 | "name": "ambulance", 153 | "category": "travel_and_places", 154 | "char": "🚑", 155 | "keywords": [ 156 | "health", 157 | "911", 158 | "hospital" 159 | ] 160 | } 161 | ] 162 | ``` 163 | 164 | ### Keyword 165 | 166 | ```bash 167 | turtle -i " " keyword happy 168 | ``` 169 | 170 | ```json 171 | [ 172 | { 173 | "name": "blush", 174 | "category": "people", 175 | "char": "😊", 176 | "keywords": [ 177 | "face", 178 | "smile", 179 | "happy", 180 | "flushed", 181 | "crush", 182 | "embarrassed", 183 | "shy", 184 | "joy" 185 | ] 186 | }, 187 | { 188 | "name": "grin", 189 | "category": "people", 190 | "char": "😁", 191 | "keywords": [ 192 | "face", 193 | "happy", 194 | "smile", 195 | "joy", 196 | "kawaii" 197 | ] 198 | }, 199 | { 200 | "name": "grinning", 201 | "category": "people", 202 | "char": "😀", 203 | "keywords": [ 204 | "face", 205 | "smile", 206 | "happy", 207 | "joy", 208 | ":D", 209 | "grin" 210 | ] 211 | } 212 | ] 213 | ``` 214 | 215 | ### Random 216 | 217 | ```bash 218 | turtle -i " " random 219 | ``` 220 | 221 | ```json 222 | { 223 | "name": "woman_technologist", 224 | "category": "people", 225 | "char": "👩‍💻", 226 | "keywords": [ 227 | "coder", 228 | "developer", 229 | "engineer", 230 | "programmer", 231 | "software", 232 | "woman", 233 | "human" 234 | ] 235 | } 236 | ``` 237 | 238 | ### List names, categories, keywords 239 | 240 | Use the ``list`` subcommand to get information about emoji names, categories, 241 | and keywords. 242 | 243 | ```bash 244 | turtle -i " " list categories 245 | ``` 246 | 247 | ```json 248 | [ 249 | "activity", 250 | "animals_and_nature", 251 | "flags", 252 | "food_and_drink", 253 | "objects", 254 | "people", 255 | "symbols", 256 | "travel_and_places" 257 | ] 258 | ``` 259 | 260 | [library]: ../../README.md 261 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 3 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 4 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 5 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 6 | github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= 7 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 8 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 9 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 10 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 11 | github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= 12 | github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 13 | github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 14 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 15 | github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 16 | github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 17 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 18 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 19 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 20 | github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= 21 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 22 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 23 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 24 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 25 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 26 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 27 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 28 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 29 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 30 | github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 31 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 32 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 33 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 34 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 35 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 36 | github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= 37 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 38 | github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 39 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 40 | github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 41 | github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 42 | github.com/hackebrot/go-repr v0.1.0 h1:28FyOiVx+rHPqEj/nqUbxqs2ocz2hfM9gP01kAeJJoA= 43 | github.com/hackebrot/go-repr v0.1.0/go.mod h1:5nbEBC4Y57U1dVAlQGF4lQdqAJZAwu7cszx8HtEq8XM= 44 | github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= 45 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 46 | github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= 47 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 48 | github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 49 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 50 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 51 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 52 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 53 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 54 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 55 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 56 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 57 | github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= 58 | github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 59 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 60 | github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= 61 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 62 | github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= 63 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 64 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 65 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 66 | github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= 67 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 68 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 69 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 70 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 71 | github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= 72 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 73 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 74 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 75 | github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 76 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 77 | github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 78 | github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 79 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 80 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 81 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 82 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 83 | github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 84 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 85 | github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= 86 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 87 | github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= 88 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 89 | github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= 90 | github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= 91 | github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= 92 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 93 | github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= 94 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 95 | github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= 96 | github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= 97 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 98 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 99 | github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 100 | github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= 101 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 102 | github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= 103 | go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 104 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 105 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 106 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 107 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 108 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 109 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 110 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 111 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 112 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 113 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 114 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 115 | golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 116 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 117 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 118 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 119 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 120 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 121 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 122 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 123 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 124 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= 125 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 126 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 127 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 128 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 129 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 130 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 131 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 132 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= 133 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 134 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 135 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 136 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 137 | google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 138 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 139 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 140 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 141 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 142 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 143 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 144 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 145 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 146 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 147 | -------------------------------------------------------------------------------- /cmd/turtle/testdata/category/animals_and_nature.json: -------------------------------------------------------------------------------- 1 | [{"name":"ant","category":"animals_and_nature","char":"🐜","keywords":["animal","insect","nature","bug"]},{"name":"baby_chick","category":"animals_and_nature","char":"🐤","keywords":["animal","chicken","bird"]},{"name":"badger","category":"animals_and_nature","char":"🦡","keywords":["animal","nature","honey"]},{"name":"bamboo","category":"animals_and_nature","char":"🎍","keywords":["plant","nature","vegetable","panda","pine_decoration"]},{"name":"bat","category":"animals_and_nature","char":"🦇","keywords":["animal","nature","blind","vampire"]},{"name":"bear","category":"animals_and_nature","char":"🐻","keywords":["animal","nature","wild"]},{"name":"beetle","category":"animals_and_nature","char":"🐞","keywords":["animal","insect","nature","ladybug"]},{"name":"bird","category":"animals_and_nature","char":"🐦","keywords":["animal","nature","fly","tweet","spring"]},{"name":"blossom","category":"animals_and_nature","char":"🌼","keywords":["nature","flowers","yellow"]},{"name":"blowfish","category":"animals_and_nature","char":"🐡","keywords":["animal","nature","food","sea","ocean"]},{"name":"boar","category":"animals_and_nature","char":"🐗","keywords":["animal","nature"]},{"name":"boom","category":"animals_and_nature","char":"💥","keywords":["bomb","explode","explosion","collision","blown"]},{"name":"bouquet","category":"animals_and_nature","char":"💐","keywords":["flowers","nature","spring"]},{"name":"bug","category":"animals_and_nature","char":"🐛","keywords":["animal","insect","nature","worm"]},{"name":"butterfly","category":"animals_and_nature","char":"🦋","keywords":["animal","insect","nature","caterpillar"]},{"name":"cactus","category":"animals_and_nature","char":"🌵","keywords":["vegetable","plant","nature"]},{"name":"camel","category":"animals_and_nature","char":"🐫","keywords":["animal","nature","hot","desert","hump"]},{"name":"cat","category":"animals_and_nature","char":"🐱","keywords":["animal","meow","nature","pet","kitten"]},{"name":"cat2","category":"animals_and_nature","char":"🐈","keywords":["animal","meow","pet","cats"]},{"name":"cherry_blossom","category":"animals_and_nature","char":"🌸","keywords":["nature","plant","spring","flower"]},{"name":"chestnut","category":"animals_and_nature","char":"🌰","keywords":["food","squirrel"]},{"name":"chicken","category":"animals_and_nature","char":"🐔","keywords":["animal","cluck","nature","bird"]},{"name":"chipmunk","category":"animals_and_nature","char":"🐿","keywords":["animal","nature","rodent","squirrel"]},{"name":"christmas_tree","category":"animals_and_nature","char":"🎄","keywords":["festival","vacation","december","xmas","celebration"]},{"name":"cloud","category":"animals_and_nature","char":"☁️","keywords":["weather","sky"]},{"name":"cloud_with_lightning","category":"animals_and_nature","char":"🌩","keywords":["weather","thunder"]},{"name":"cloud_with_lightning_and_rain","category":"animals_and_nature","char":"⛈","keywords":["weather","lightning"]},{"name":"cloud_with_rain","category":"animals_and_nature","char":"🌧","keywords":["weather"]},{"name":"cloud_with_snow","category":"animals_and_nature","char":"🌨","keywords":["weather"]},{"name":"comet","category":"animals_and_nature","char":"☄","keywords":["space"]},{"name":"cow","category":"animals_and_nature","char":"🐮","keywords":["beef","ox","animal","nature","moo","milk"]},{"name":"cow2","category":"animals_and_nature","char":"🐄","keywords":["beef","ox","animal","nature","moo","milk"]},{"name":"crab","category":"animals_and_nature","char":"🦀","keywords":["animal","crustacean"]},{"name":"crescent_moon","category":"animals_and_nature","char":"🌙","keywords":["night","sleep","sky","evening","magic"]},{"name":"crocodile","category":"animals_and_nature","char":"🐊","keywords":["animal","nature","reptile","lizard","alligator"]},{"name":"dash","category":"animals_and_nature","char":"💨","keywords":["wind","air","fast","shoo","fart","smoke","puff"]},{"name":"deciduous_tree","category":"animals_and_nature","char":"🌳","keywords":["plant","nature"]},{"name":"deer","category":"animals_and_nature","char":"🦌","keywords":["animal","nature","horns","venison"]},{"name":"dizzy","category":"animals_and_nature","char":"💫","keywords":["star","sparkle","shoot","magic"]},{"name":"dog","category":"animals_and_nature","char":"🐶","keywords":["animal","friend","nature","woof","puppy","pet","faithful"]},{"name":"dog2","category":"animals_and_nature","char":"🐕","keywords":["animal","nature","friend","doge","pet","faithful"]},{"name":"dolphin","category":"animals_and_nature","char":"🐬","keywords":["animal","nature","fish","sea","ocean","flipper","fins","beach"]},{"name":"dove","category":"animals_and_nature","char":"🕊","keywords":["animal","bird"]},{"name":"dragon","category":"animals_and_nature","char":"🐉","keywords":["animal","myth","nature","chinese","green"]},{"name":"dragon_face","category":"animals_and_nature","char":"🐲","keywords":["animal","myth","nature","chinese","green"]},{"name":"dromedary_camel","category":"animals_and_nature","char":"🐪","keywords":["animal","hot","desert","hump"]},{"name":"droplet","category":"animals_and_nature","char":"💧","keywords":["water","drip","faucet","spring"]},{"name":"duck","category":"animals_and_nature","char":"🦆","keywords":["animal","nature","bird","mallard"]},{"name":"eagle","category":"animals_and_nature","char":"🦅","keywords":["animal","nature","bird"]},{"name":"ear_of_rice","category":"animals_and_nature","char":"🌾","keywords":["nature","plant"]},{"name":"earth_africa","category":"animals_and_nature","char":"🌍","keywords":["globe","world","international"]},{"name":"earth_americas","category":"animals_and_nature","char":"🌎","keywords":["globe","world","USA","international"]},{"name":"earth_asia","category":"animals_and_nature","char":"🌏","keywords":["globe","world","east","international"]},{"name":"elephant","category":"animals_and_nature","char":"🐘","keywords":["animal","nature","nose","th","circus"]},{"name":"evergreen_tree","category":"animals_and_nature","char":"🌲","keywords":["plant","nature"]},{"name":"fallen_leaf","category":"animals_and_nature","char":"🍂","keywords":["nature","plant","vegetable","leaves"]},{"name":"fire","category":"animals_and_nature","char":"🔥","keywords":["hot","cook","flame"]},{"name":"first_quarter_moon","category":"animals_and_nature","char":"🌓","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"first_quarter_moon_with_face","category":"animals_and_nature","char":"🌛","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"fish","category":"animals_and_nature","char":"🐟","keywords":["animal","food","nature"]},{"name":"fog","category":"animals_and_nature","char":"🌫","keywords":["weather"]},{"name":"four_leaf_clover","category":"animals_and_nature","char":"🍀","keywords":["vegetable","plant","nature","lucky","irish"]},{"name":"fox_face","category":"animals_and_nature","char":"🦊","keywords":["animal","nature","face"]},{"name":"frog","category":"animals_and_nature","char":"🐸","keywords":["animal","nature","croak","toad"]},{"name":"full_moon","category":"animals_and_nature","char":"🌕","keywords":["nature","yellow","twilight","planet","space","night","evening","sleep"]},{"name":"full_moon_with_face","category":"animals_and_nature","char":"🌝","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"giraffe","category":"animals_and_nature","char":"🦒","keywords":["animal","nature","spots","safari"]},{"name":"goat","category":"animals_and_nature","char":"🐐","keywords":["animal","nature"]},{"name":"gorilla","category":"animals_and_nature","char":"🦍","keywords":["animal","nature","circus"]},{"name":"grasshopper","category":"animals_and_nature","char":"🦗","keywords":["animal","cricket","chirp"]},{"name":"hamster","category":"animals_and_nature","char":"🐹","keywords":["animal","nature"]},{"name":"hatched_chick","category":"animals_and_nature","char":"🐥","keywords":["animal","chicken","baby","bird"]},{"name":"hatching_chick","category":"animals_and_nature","char":"🐣","keywords":["animal","chicken","egg","born","baby","bird"]},{"name":"hear_no_evil","category":"animals_and_nature","char":"🙉","keywords":["animal","monkey","nature"]},{"name":"hedgehog","category":"animals_and_nature","char":"🦔","keywords":["animal","nature","spiny"]},{"name":"herb","category":"animals_and_nature","char":"🌿","keywords":["vegetable","plant","medicine","weed","grass","lawn"]},{"name":"hibiscus","category":"animals_and_nature","char":"🌺","keywords":["plant","vegetable","flowers","beach"]},{"name":"hippopotamus","category":"animals_and_nature","char":"🦛","keywords":["animal","nature"]},{"name":"honeybee","category":"animals_and_nature","char":"🐝","keywords":["animal","insect","nature","bug","spring","honey"]},{"name":"horse","category":"animals_and_nature","char":"🐴","keywords":["animal","brown","nature"]},{"name":"jack_o_lantern","category":"animals_and_nature","char":"🎃","keywords":["halloween","light","pumpkin","creepy","fall"]},{"name":"kangaroo","category":"animals_and_nature","char":"🦘","keywords":["animal","nature","australia","joey","hop","marsupial"]},{"name":"koala","category":"animals_and_nature","char":"🐨","keywords":["animal","nature"]},{"name":"last_quarter_moon","category":"animals_and_nature","char":"🌗","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"last_quarter_moon_with_face","category":"animals_and_nature","char":"🌜","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"leaves","category":"animals_and_nature","char":"🍃","keywords":["nature","plant","tree","vegetable","grass","lawn","spring"]},{"name":"leopard","category":"animals_and_nature","char":"🐆","keywords":["animal","nature"]},{"name":"lion","category":"animals_and_nature","char":"🦁","keywords":["animal","nature"]},{"name":"lizard","category":"animals_and_nature","char":"🦎","keywords":["animal","nature","reptile"]},{"name":"llama","category":"animals_and_nature","char":"🦙","keywords":["animal","nature","alpaca"]},{"name":"lobster","category":"animals_and_nature","char":"🦞","keywords":["animal","nature","bisque","claws","seafood"]},{"name":"maple_leaf","category":"animals_and_nature","char":"🍁","keywords":["nature","plant","vegetable","ca","fall"]},{"name":"monkey","category":"animals_and_nature","char":"🐒","keywords":["animal","nature","banana","circus"]},{"name":"monkey_face","category":"animals_and_nature","char":"🐵","keywords":["animal","nature","circus"]},{"name":"mosquito","category":"animals_and_nature","char":"🦟","keywords":["animal","nature","insect","malaria"]},{"name":"mouse","category":"animals_and_nature","char":"🐭","keywords":["animal","nature","cheese_wedge","rodent"]},{"name":"mouse2","category":"animals_and_nature","char":"🐁","keywords":["animal","nature","rodent"]},{"name":"mushroom","category":"animals_and_nature","char":"🍄","keywords":["plant","vegetable"]},{"name":"new_moon","category":"animals_and_nature","char":"🌑","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"new_moon_with_face","category":"animals_and_nature","char":"🌚","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"ocean","category":"animals_and_nature","char":"🌊","keywords":["sea","water","wave","nature","tsunami","disaster"]},{"name":"octopus","category":"animals_and_nature","char":"🐙","keywords":["animal","creature","ocean","sea","nature","beach"]},{"name":"open_umbrella","category":"animals_and_nature","char":"☂","keywords":["weather","spring"]},{"name":"owl","category":"animals_and_nature","char":"🦉","keywords":["animal","nature","bird","hoot"]},{"name":"ox","category":"animals_and_nature","char":"🐂","keywords":["animal","cow","beef"]},{"name":"palm_tree","category":"animals_and_nature","char":"🌴","keywords":["plant","vegetable","nature","summer","beach","mojito","tropical"]},{"name":"panda_face","category":"animals_and_nature","char":"🐼","keywords":["animal","nature","panda"]},{"name":"parrot","category":"animals_and_nature","char":"🦜","keywords":["animal","nature","bird","pirate","talk"]},{"name":"partly_sunny","category":"animals_and_nature","char":"⛅","keywords":["weather","nature","cloudy","morning","fall","spring"]},{"name":"paw_prints","category":"animals_and_nature","char":"🐾","keywords":["animal","tracking","footprints","dog","cat","pet","feet"]},{"name":"peacock","category":"animals_and_nature","char":"🦚","keywords":["animal","nature","peahen","bird"]},{"name":"penguin","category":"animals_and_nature","char":"🐧","keywords":["animal","nature"]},{"name":"pig","category":"animals_and_nature","char":"🐷","keywords":["animal","oink","nature"]},{"name":"pig2","category":"animals_and_nature","char":"🐖","keywords":["animal","nature"]},{"name":"pig_nose","category":"animals_and_nature","char":"🐽","keywords":["animal","oink"]},{"name":"poodle","category":"animals_and_nature","char":"🐩","keywords":["dog","animal","101","nature","pet"]},{"name":"rabbit","category":"animals_and_nature","char":"🐰","keywords":["animal","nature","pet","spring","magic","bunny"]},{"name":"rabbit2","category":"animals_and_nature","char":"🐇","keywords":["animal","nature","pet","magic","spring"]},{"name":"raccoon","category":"animals_and_nature","char":"🦝","keywords":["animal","nature"]},{"name":"racehorse","category":"animals_and_nature","char":"🐎","keywords":["animal","gamble","luck"]},{"name":"ram","category":"animals_and_nature","char":"🐏","keywords":["animal","sheep","nature"]},{"name":"rat","category":"animals_and_nature","char":"🐀","keywords":["animal","mouse","rodent"]},{"name":"rhinoceros","category":"animals_and_nature","char":"🦏","keywords":["animal","nature","horn"]},{"name":"rooster","category":"animals_and_nature","char":"🐓","keywords":["animal","nature","chicken"]},{"name":"rose","category":"animals_and_nature","char":"🌹","keywords":["flowers","valentines","love","spring"]},{"name":"sauropod","category":"animals_and_nature","char":"🦕","keywords":["animal","nature","dinosaur","brachiosaurus","brontosaurus","diplodocus","extinct"]},{"name":"scorpion","category":"animals_and_nature","char":"🦂","keywords":["animal","arachnid"]},{"name":"see_no_evil","category":"animals_and_nature","char":"🙈","keywords":["monkey","animal","nature","haha"]},{"name":"seedling","category":"animals_and_nature","char":"🌱","keywords":["plant","nature","grass","lawn","spring"]},{"name":"shamrock","category":"animals_and_nature","char":"☘","keywords":["vegetable","plant","nature","irish","clover"]},{"name":"shark","category":"animals_and_nature","char":"🦈","keywords":["animal","nature","fish","sea","ocean","jaws","fins","beach"]},{"name":"sheep","category":"animals_and_nature","char":"🐑","keywords":["animal","nature","wool","shipit"]},{"name":"shell","category":"animals_and_nature","char":"🐚","keywords":["nature","sea","beach"]},{"name":"shrimp","category":"animals_and_nature","char":"🦐","keywords":["animal","ocean","nature","seafood"]},{"name":"snail","category":"animals_and_nature","char":"🐌","keywords":["slow","animal","shell"]},{"name":"snake","category":"animals_and_nature","char":"🐍","keywords":["animal","evil","nature","hiss","python"]},{"name":"snowflake","category":"animals_and_nature","char":"❄️","keywords":["winter","season","cold","weather","christmas","xmas"]},{"name":"snowman","category":"animals_and_nature","char":"⛄","keywords":["winter","season","cold","weather","christmas","xmas","frozen","without_snow"]},{"name":"snowman_with_snow","category":"animals_and_nature","char":"☃","keywords":["winter","season","cold","weather","christmas","xmas","frozen"]},{"name":"sparkles","category":"animals_and_nature","char":"✨","keywords":["stars","shine","shiny","cool","awesome","good","magic"]},{"name":"speak_no_evil","category":"animals_and_nature","char":"🙊","keywords":["monkey","animal","nature","omg"]},{"name":"spider","category":"animals_and_nature","char":"🕷","keywords":["animal","arachnid"]},{"name":"spider_web","category":"animals_and_nature","char":"🕸","keywords":["animal","insect","arachnid","silk"]},{"name":"squid","category":"animals_and_nature","char":"🦑","keywords":["animal","nature","ocean","sea"]},{"name":"star","category":"animals_and_nature","char":"⭐","keywords":["night","yellow"]},{"name":"star2","category":"animals_and_nature","char":"🌟","keywords":["night","sparkle","awesome","good","magic"]},{"name":"sun_behind_large_cloud","category":"animals_and_nature","char":"🌥","keywords":["weather"]},{"name":"sun_behind_rain_cloud","category":"animals_and_nature","char":"🌦","keywords":["weather"]},{"name":"sun_behind_small_cloud","category":"animals_and_nature","char":"🌤","keywords":["weather"]},{"name":"sun_with_face","category":"animals_and_nature","char":"🌞","keywords":["nature","morning","sky"]},{"name":"sunflower","category":"animals_and_nature","char":"🌻","keywords":["nature","plant","fall"]},{"name":"sunny","category":"animals_and_nature","char":"☀️","keywords":["weather","nature","brightness","summer","beach","spring"]},{"name":"swan","category":"animals_and_nature","char":"🦢","keywords":["animal","nature","bird"]},{"name":"sweat_drops","category":"animals_and_nature","char":"💦","keywords":["water","drip","oops"]},{"name":"t-rex","category":"animals_and_nature","char":"🦖","keywords":["animal","nature","dinosaur","tyrannosaurus","extinct"]},{"name":"tanabata_tree","category":"animals_and_nature","char":"🎋","keywords":["plant","nature","branch","summer"]},{"name":"tiger","category":"animals_and_nature","char":"🐯","keywords":["animal","cat","danger","wild","nature","roar"]},{"name":"tiger2","category":"animals_and_nature","char":"🐅","keywords":["animal","nature","roar"]},{"name":"tornado","category":"animals_and_nature","char":"🌪","keywords":["weather","cyclone","twister"]},{"name":"tropical_fish","category":"animals_and_nature","char":"🐠","keywords":["animal","swim","ocean","beach","nemo"]},{"name":"tulip","category":"animals_and_nature","char":"🌷","keywords":["flowers","plant","nature","summer","spring"]},{"name":"turkey","category":"animals_and_nature","char":"🦃","keywords":["animal","bird"]},{"name":"turtle","category":"animals_and_nature","char":"🐢","keywords":["animal","slow","nature","tortoise"]},{"name":"umbrella","category":"animals_and_nature","char":"☔","keywords":["rainy","weather","spring"]},{"name":"unicorn","category":"animals_and_nature","char":"🦄","keywords":["animal","nature","mystical"]},{"name":"waning_crescent_moon","category":"animals_and_nature","char":"🌘","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"waning_gibbous_moon","category":"animals_and_nature","char":"🌖","keywords":["nature","twilight","planet","space","night","evening","sleep","waxing_gibbous_moon"]},{"name":"water_buffalo","category":"animals_and_nature","char":"🐃","keywords":["animal","nature","ox","cow"]},{"name":"waxing_crescent_moon","category":"animals_and_nature","char":"🌒","keywords":["nature","twilight","planet","space","night","evening","sleep"]},{"name":"waxing_gibbous_moon","category":"animals_and_nature","char":"🌔","keywords":["nature","night","sky","gray","twilight","planet","space","evening","sleep"]},{"name":"whale","category":"animals_and_nature","char":"🐳","keywords":["animal","nature","sea","ocean"]},{"name":"whale2","category":"animals_and_nature","char":"🐋","keywords":["animal","nature","sea","ocean"]},{"name":"wilted_flower","category":"animals_and_nature","char":"🥀","keywords":["plant","nature","flower"]},{"name":"wind_face","category":"animals_and_nature","char":"🌬","keywords":["gust","air"]},{"name":"wolf","category":"animals_and_nature","char":"🐺","keywords":["animal","nature","wild"]},{"name":"zap","category":"animals_and_nature","char":"⚡","keywords":["thunder","weather","lightning bolt","fast"]},{"name":"zebra","category":"animals_and_nature","char":"🦓","keywords":["animal","nature","stripes","safari"]}] 2 | --------------------------------------------------------------------------------