{"id":17617393,"url":"https://github.com/forpelevin/gomoji","last_synced_at":"2025-05-15T04:02:39.315Z","repository":{"id":39752234,"uuid":"325214621","full_name":"forPelevin/gomoji","owner":"forPelevin","description":"Helpful functions to work with emoji in Golang","archived":false,"fork":false,"pushed_at":"2025-02-15T19:27:16.000Z","size":303,"stargazers_count":206,"open_issues_count":2,"forks_count":29,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-15T00:48:48.675Z","etag":null,"topics":["emoji","go","golang","strings"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forPelevin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-29T07:15:06.000Z","updated_at":"2025-03-25T17:04:57.000Z","dependencies_parsed_at":"2025-03-03T16:00:51.683Z","dependency_job_id":"f47c0b88-7311-437c-9020-a405a58d3a93","html_url":"https://github.com/forPelevin/gomoji","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forPelevin%2Fgomoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forPelevin%2Fgomoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forPelevin%2Fgomoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forPelevin%2Fgomoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forPelevin","download_url":"https://codeload.github.com/forPelevin/gomoji/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986279,"owners_count":21194025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emoji","go","golang","strings"],"created_at":"2024-10-22T19:13:25.554Z","updated_at":"2025-04-15T00:49:04.601Z","avatar_url":"https://github.com/forPelevin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoMoji 🔥\n\n![Tests](https://github.com/forPelevin/gomoji/actions/workflows/tests.yml/badge.svg) [![Go Report](https://goreportcard.com/badge/github.com/forPelevin/gomoji)](https://goreportcard.com/report/github.com/forPelevin/gomoji) [![codecov](https://codecov.io/gh/forPelevin/gomoji/branch/github-actions/graph/badge.svg?token=34X68AXAMS)](https://codecov.io/gh/forPelevin/gomoji)\n\nA high-performance Go library for working with emojis in strings, offering fast emoji detection, manipulation, and information retrieval.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Features](#features)\n- [Usage Examples](#usage-examples)\n  - [Check for Emojis](#check-for-emojis)\n  - [Find All Emojis](#find-all-emojis)\n  - [Remove Emojis](#remove-emojis)\n  - [Replace Emojis](#replace-emojis)\n  - [Get Emoji Information](#get-emoji-information)\n- [API Documentation](#api-documentation)\n- [Performance](#performance)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\n### Prerequisites\n\n- Go 1.11 or higher (for module support)\n\n### Installing\n\n```sh\ngo get -u github.com/forPelevin/gomoji\n```\n\n## Features\n\n- 🔎 Fast emoji detection in strings\n- 👪 Find all emoji occurrences with detailed information\n- 🌐 Access comprehensive emoji database\n- 🧹 Remove emojis from strings\n- ↔️ Replace emojis with custom characters\n- ↕️ Custom emoji replacement functions\n- 🧐 Detailed emoji information lookup\n\n## Usage Examples\n\n### Check for Emojis\n\n```go\npackage main\n\nimport \"github.com/forPelevin/gomoji\"\n\nfunc main() {\n    hasEmoji := gomoji.ContainsEmoji(\"hello world 🤗\")\n    println(hasEmoji) // true\n}\n```\n\n### Find All Emojis\n\n```go\nemojis := gomoji.FindAll(\"🧖 hello 🦋 world\")\n// Returns slice of Emoji structs with detailed information\n```\n\n### Remove Emojis\n\n```go\ncleaned := gomoji.RemoveEmojis(\"🧖 hello 🦋 world\")\nprintln(cleaned) // \"hello world\"\n```\n\n### Replace Emojis\n\n```go\n// Replace with a specific character\nreplaced := gomoji.ReplaceEmojisWith(\"🧖 hello 🦋 world\", '_')\nprintln(replaced) // \"_ hello _ world\"\n\n// Replace with custom function\ncustomReplaced := gomoji.ReplaceEmojisWithFunc(\"🧖 hello 🦋 world\", func(em Emoji) string {\n    return em.Slug\n})\nprintln(customReplaced) // \"person-in-steamy-room hello butterfly world\"\n```\n\n### Get Emoji Information\n\n```go\ninfo, err := gomoji.GetInfo(\"🦋\")\nif err == nil {\n    println(info.Slug)        // \"butterfly\"\n    println(info.UnicodeName) // \"E3.0 butterfly\"\n    println(info.Group)       // \"Animals \u0026 Nature\"\n}\n```\n\n## API Documentation\n\n### Emoji Structure\n\n```go\ntype Emoji struct {\n    Slug        string `json:\"slug\"`        // Unique identifier\n    Character   string `json:\"character\"`   // The emoji character\n    UnicodeName string `json:\"unicode_name\"` // Official Unicode name\n    CodePoint   string `json:\"code_point\"`  // Unicode code point\n    Group       string `json:\"group\"`       // Emoji group category\n    SubGroup    string `json:\"sub_group\"`   // Emoji subgroup category\n}\n```\n\n### Core Functions\n\n- `ContainsEmoji(s string) bool` - Checks if a string contains any emoji\n- `FindAll(s string) []Emoji` - Finds all unique emojis in a string\n- `RemoveEmojis(s string) string` - Removes all emojis from a string\n- `ReplaceEmojisWith(s string, c rune) string` - Replaces emojis with a specified character\n- `GetInfo(emoji string) (Emoji, error)` - Gets detailed information about an emoji\n- `AllEmojis() []Emoji` - Returns all available emojis\n\n## Performance\n\nGoMoji is designed for high performance, with parallel processing capabilities for optimal speed. Here are the key benchmarks:\n\n| Operation         | Sequential Performance | Parallel Performance | Allocations           |\n| ----------------- | ---------------------- | -------------------- | --------------------- |\n| Contains Emoji    | 57.49 ns/op            | 7.167 ns/op          | 0 B/op, 0 allocs/op   |\n| Remove Emojis     | 1454 ns/op             | 201.4 ns/op          | 68 B/op, 2 allocs/op  |\n| Find All          | 1494 ns/op             | 313.8 ns/op          | 288 B/op, 2 allocs/op |\n| Get Info          | 8.591 ns/op            | 1.139 ns/op          | 0 B/op, 0 allocs/op   |\n| Replace With Slug | 3822 ns/op             | 602.4 ns/op          | 160 B/op, 3 allocs/op |\n\nFull benchmark details:\n\n```\ngo test -bench=. -benchmem -v -run Benchmark ./...\ngoos: darwin\ngoarch: arm64\npkg: github.com/forPelevin/gomoji\ncpu: Apple M1 Pro\nBenchmarkContainsEmojiParallel-10               164229604                7.167 ns/op           0 B/op             0 allocs/op\nBenchmarkContainsEmoji-10                       20967183                57.49 ns/op            0 B/op             0 allocs/op\nBenchmarkReplaceEmojisWithSlugParallel-10        2160638               602.4 ns/op           160 B/op             3 allocs/op\nBenchmarkReplaceEmojisWithSlug-10                 309879              3822 ns/op             160 B/op             3 allocs/op\nBenchmarkRemoveEmojisParallel-10                 5794255               201.4 ns/op            68 B/op             2 allocs/op\nBenchmarkRemoveEmojis-10                          830334              1454 ns/op              68 B/op             2 allocs/op\nBenchmarkGetInfoParallel-10                     989043939                1.139 ns/op           0 B/op             0 allocs/op\nBenchmarkGetInfo-10                             139558108                8.591 ns/op           0 B/op             0 allocs/op\nBenchmarkFindAllParallel-10                      4029028               313.8 ns/op           288 B/op             2 allocs/op\nBenchmarkFindAll-10                               751990              1494 ns/op             288 B/op             2 allocs/op\n```\n\n\u003e Note: Benchmarks were performed on Apple M1 Pro processor. Your results may vary depending on hardware.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Contact\n\nVlad Gukasov [@vgukasov](https://www.facebook.com/vgukasov)\n\n## License\n\nGoMoji is available under the MIT [License](/LICENSE).\nGoMoji source code is available under the MIT [License](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforpelevin%2Fgomoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforpelevin%2Fgomoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforpelevin%2Fgomoji/lists"}