{"id":21390710,"url":"https://github.com/liderman/text-generator","last_synced_at":"2025-07-13T17:30:40.145Z","repository":{"id":46103263,"uuid":"66399779","full_name":"liderman/text-generator","owner":"liderman","description":"Golang text generator for generate SEO texts","archived":false,"fork":false,"pushed_at":"2021-11-14T20:31:32.000Z","size":13,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T11:04:18.367Z","etag":null,"topics":["generator","golang","search","seo","seo-optimization","text","text-generation","text-generator","textpattern"],"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/liderman.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}},"created_at":"2016-08-23T20:13:28.000Z","updated_at":"2024-11-04T00:03:13.000Z","dependencies_parsed_at":"2022-09-26T18:30:30.225Z","dependency_job_id":null,"html_url":"https://github.com/liderman/text-generator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/liderman/text-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liderman%2Ftext-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liderman%2Ftext-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liderman%2Ftext-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liderman%2Ftext-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liderman","download_url":"https://codeload.github.com/liderman/text-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liderman%2Ftext-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265178284,"owners_count":23723228,"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":["generator","golang","search","seo","seo-optimization","text","text-generation","text-generator","textpattern"],"created_at":"2024-11-22T13:19:14.310Z","updated_at":"2025-07-13T17:30:39.906Z","avatar_url":"https://github.com/liderman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text-generator\nFast text generator on a mask.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/liderman/text-generator)](https://goreportcard.com/report/github.com/liderman/text-generator)\n[![codecov](https://codecov.io/gh/liderman/text-generator/branch/master/graph/badge.svg?token=53NH949TQY)](https://codecov.io/gh/liderman/text-generator)\n[![Go Reference](https://pkg.go.dev/badge/github.com/liderman/text-generator.svg)](https://pkg.go.dev/github.com/liderman/text-generator)\n[![Release](https://img.shields.io/github/release/liderman/text-generator.svg?style=flat-square)](https://github.com/liderman/text-generator/releases/latest)\n\n\nWritten in Golang. I do not use regular expressions and the fastest. I covered tests and simple! Supporting recursive text generation rules.\n\nInstallation\n-----------\n\tgo get github.com/liderman/text-generator\n\nUsage\n-----------\nAn example of a simple template text generation:\n```go\ntg := textgenerator.New()\ntemplate := \"Good {morning|day}!\"\n\nfmt.Print(tg.Generate(template))\n// Displays: Good morning!\n\nfmt.Print(tg.Generate(template))\n// Displays: Good day!\n```\n\nAn example of a complex generation template text:\n```go\ntg := textgenerator.New()\ntemplate := \"{Good {morning|evening|day}|Goodnight|Hello}, {friend|brother}! {How are you|What's new with you}?\"\n\nfmt.Print(tg.Generate(template))\n// Displays: Good morning, friend! How are you?\n\nfmt.Print(tg.Generate(template))\n// Displays: Good day, brother! What's new with you?\n\nfmt.Print(tg.Generate(template))\n// Displays: Hello, friend! How are you?\n...\n```\n\nRequirements\n-----------\n\n* Need at least `go1.14` or newer.\n\nFeatures\n-----------\n\n* Without external dependencies\n* Fast (does not use regular expressions)\n* Simple\n* Supports caching\n* Covered with tests\n\nDocumentation\n-----------\n\nYou can read package documentation [here](https://pkg.go.dev/github.com/liderman/text-generator).\n\nTesting\n-----------\nUnit-tests:\n```bash\ngo test -v -race ./...\n```\n\nRun linter:\n```bash\ndocker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.40 golangci-lint run -v\n```\n\nBenchmarks\n-----------\n```bash\ngo test -test.bench . -benchmem -benchtime=10s\n```\nThe test result on computer MacBook Pro 2020 (Intel Core i5):\n```\ngoos: darwin\ngoarch: amd64\npkg: github.com/liderman/text-generator\nBenchmarkGenerateEasyText-8             22446540               531 ns/op             200 B/op          8 allocs/op\nBenchmarkGenerateComplexText-8           4721838              2552 ns/op            1351 B/op         24 allocs/op\nPASS\nok      github.com/liderman/text-generator      27.227s\n```\n\nCONTRIBUTE\n-----------\n* write code\n* run `go fmt ./...`\n* run all linters and tests (see above)\n* create a PR describing the changes\n\nLICENSE\n-----------\nMIT\n\nAUTHOR\n-----------\nKonstantin Osipov \u003ck.osipov.msk@gmail.com\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliderman%2Ftext-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliderman%2Ftext-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliderman%2Ftext-generator/lists"}