{"id":25195951,"url":"https://github.com/simplisticated/wordy-for-ios","last_synced_at":"2025-12-12T06:20:35.384Z","repository":{"id":56927643,"uuid":"148450673","full_name":"simplisticated/Wordy-for-iOS","owner":"simplisticated","description":"String processor for iOS","archived":false,"fork":false,"pushed_at":"2018-09-17T14:54:32.000Z","size":197,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T08:34:40.963Z","etag":null,"topics":["ios","string","swift","text-processing"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplisticated.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":"2018-09-12T08:52:58.000Z","updated_at":"2023-04-04T14:42:59.000Z","dependencies_parsed_at":"2022-08-21T04:20:57.298Z","dependency_job_id":null,"html_url":"https://github.com/simplisticated/Wordy-for-iOS","commit_stats":null,"previous_names":["igormatyushkin014/wordy-for-ios"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FWordy-for-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FWordy-for-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FWordy-for-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FWordy-for-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplisticated","download_url":"https://codeload.github.com/simplisticated/Wordy-for-iOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208022,"owners_count":20901568,"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":["ios","string","swift","text-processing"],"created_at":"2025-02-10T01:39:11.910Z","updated_at":"2025-12-12T06:20:35.332Z","avatar_url":"https://github.com/simplisticated.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" \u003e\n\t\u003cimg src=\"/Images/logo_2048_600.png\" alt=\"Wordy\" title=\"Wordy\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://swift.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/Swift-4.1-orange.svg?style=flat\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://cocoapods.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/cocoapods/v/Wordy.svg\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://cocoapods.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/cocoapods/dt/Wordy.svg\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://tldrlegal.com/license/mit-license\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/License-Apache 2.0-blue.svg?style=flat\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n## At a Glance\n\n`Wordy` is a powerful text processor that provides an easy way to manage content in `String` object.\n\n## How To Get Started\n\n- Copy content of `Source` folder to your project.\n\nor\n\n- Use `Wordy` cocoapod\n\n## Requirements\n\n* iOS 9 and later\n* Xcode 9 and later\n* Swift 4.1\n\n## Usage\n\nEverything starts with `Wordy` class. This is your entry point to all tools provided by the library.\n\n### Text Effects\n\nLet's start with a very simple example of text effect:\n\n```swift\nlet filteredText = Wordy.effects(for: \"Hi!\")\n    .apply(effect: InversionEffect())\n    .result\n\nprint(filteredText) // \"!iH\"\n```\n\nThis is how it works: `Wordy.effects(for: _)` gives you an `EffectManager` instance configured for your source text. Then, you can apply some effects and retrieve the final text by `.result` call.\n\nIn the example above, the `InversionEffect` will be applied to the entire string. The same time, you can apply effect to a particular substring:\n\n```swift\nlet filteredText = Wordy.effects(for: \"Hi!\")\n    .apply(effect: InversionEffect(), startIndex: 0, endIndex: 1)\n    .result\n\nprint(filteredText) // \"iH!\"\n```\n\nYou can add as many effects as you want:\n\n```swift\nlet filteredText = Wordy.effects(for: \"This text will be rotated\")\n    .apply(effect: RotationEffect(rotation: .inverted))\n    .apply(effect: InversionEffect())\n    .result\n\nprint(filteredText) // \"рǝʇɐʇоɹ ǝq llıм ʇxǝʇ sıɥʇ\"\n```\n\n#### Case Effect\n\nRepresented by `CaseEffect` class. Changes case for the entire text or letters at particular positions.\n\nConstructor example:\n\n```swift\nCaseEffect(textCase: .firstUpperNextLower)\n```\n\n[`TextCase`](#text-case) is the only setting that defines `CaseEffect`'s behavior.\n\n#### Rotation Effect\n\nRepresented by `RotationEffect` class. Rotates letters. For example,\n\n`p` becomes `d`\n\nand\n\n`h` becomes `ɥ`.\n\n`RotationEffect` has two available constructors. The most detailed version of constructor:\n\n```swift\nRotationEffect(rotation: .inverted, caseSensitive: true)\n```\n\nThe first parameter is a [`TextRotation`](#text-rotation) value that defines the way to rotate symbols.\n\nThe second parameter of boolean type defines whether the rotation alrorithm should be case sensitive. If it equals to `false`, some uppercased symbols might become lowercased as a result of rotation.\n\nThe second constructor is a simplified version of the first one:\n\n```swift\nRotationEffect(rotation: .inverted)\n```\n\nIt's case sensitive by default. Usually, it's enough to use the second constructor excepting cases when you need more flexibility.\n\n#### Inversion Effect\n\nRepresented by `InversionEffect` class. Flips text from right to left, so\n\n`Hi!`\n\nturns into\n\n`!iH`\n\n`InversionEffect`'s constructor is very simple and doesn't require any parameters:\n\n```swift\nInversionEffect()\n```\n\n### Transliteration\n\nExample of transliteration:\n\n```java\nlet transliteratedText = Wordy.transliterate(from: .russian, to: .english)\n    .result(for: \"Привет!\")\n\nprint(transliteratedText) // \"Privet!\", which means \"Hi!\"\n```\n\nCurrently supported languages are:\n\n- English\n- Russian\n\n### Options\n\n#### Text Case\n\n`TextCase` is used as a setting for `CaseEffect` instance. Available values are:\n\n- `allUpper` - Makes the entire text uppercased.\n- `allLower` - Makes the entire text lowercased.\n- `firstUpperNextLower` - The first symbol is uppercased, other text is lowercased.\n- `firstLowerNextUpper` - The first symbol is lowercased, other text is uppercased.\n- `alternating(firstUppercased: Bool)`: If `firstUppercased` is `true`, odd symbols are uppercased, even symbols are lowercased. Otherwise, odd symbols are lowercased, even symbols are uppercased.\n\n#### Text Rotation\n\n`TextRotation` defines the conditions of symbol rotation. Available values:\n\n- `normal`: Forces all symbols to be rotated to normal position. It means that `ʎ` would become `y` and `h` would stay `h`.\n- `upsideDown`: Forces all symbols to be rotated upside down. In this case, `y` would turn into `ʎ`, but `ɥ` wouldn't change at all.\n- `inverted`: Normal symbols are forced to be rotated meanwhile rotated symbols become normal. So, `y` becomes `ʎ` and `ɥ` turns into `h`.\n\n#### Language\n\nThe `Language` type is used for transliterations. Possible values:\n\n- `english`\n- `russian`\n\n### Plugins\n\nYou can extend the functionality of `Wordy` without making changes to the library. Instead of sending pull request, simply create your own plugin.\n\nEach plugin is a subclass of the class named `Plugin`. Take a look at the example below:\n\n```java\nclass Repeat: Plugin {\n\n    override func result() -\u003e String {\n        return self.sourceText\n            + self.sourceText\n    }\n}\n```\n\nThis is a plugin that repeats the source text two times. All that you need to implement is the `result()` method that returns `String` with filtered text. It is the core of your plugin's implementation where you should put the logic. To access the source text, simply use `self.sourceText`.\n\nNow let's try to use the plugin:\n\n```java\nlet repeatedText = Wordy.plugin(Repeat.self, for: \"Test.\")\n    .result()\n\nprint(repeatedText) // \"Test.Test.\"\n```\n\nAs you can see, creating and using plugins for `Wordy` is quite easy. You can publish your plugins as separate library or send as a pull request if you want it to be included in the library after reviewal process.\n\n## License\n\n`Wordy` is available under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fwordy-for-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplisticated%2Fwordy-for-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fwordy-for-ios/lists"}