{"id":25195956,"url":"https://github.com/simplisticated/swiftypredictor","last_synced_at":"2025-05-08T17:04:27.702Z","repository":{"id":62456983,"uuid":"86951708","full_name":"simplisticated/SwiftyPredictor","owner":"simplisticated","description":"Swift API for Yandex.Predictor service.","archived":false,"fork":false,"pushed_at":"2017-12-24T17:37:44.000Z","size":92,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T17:04:07.054Z","etag":null,"topics":["cloud-computing","prediction","suggestion-engine","swift","text"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/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":"2017-04-02T00:24:00.000Z","updated_at":"2021-12-23T11:08:36.000Z","dependencies_parsed_at":"2022-11-02T00:17:03.849Z","dependency_job_id":null,"html_url":"https://github.com/simplisticated/SwiftyPredictor","commit_stats":null,"previous_names":["igormatyushkin014/swiftypredictor"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSwiftyPredictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSwiftyPredictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSwiftyPredictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FSwiftyPredictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplisticated","download_url":"https://codeload.github.com/simplisticated/SwiftyPredictor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253112072,"owners_count":21856070,"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":["cloud-computing","prediction","suggestion-engine","swift","text"],"created_at":"2025-02-10T01:39:12.472Z","updated_at":"2025-05-08T17:04:27.677Z","avatar_url":"https://github.com/simplisticated.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" \u003e\n  \u003cimg src=\"https://github.com/igormatyushkin014/SwiftyPredictor/raw/master/Images/logo_500_500.png\" alt=\"SwiftyPredictor\" title=\"SwiftyPredictor\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://swift.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://cocoapods.org\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/v/SwiftyPredictor.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://cocoapods.org\"\u003e\u003cimg src=\"https://img.shields.io/cocoapods/dt/SwiftyPredictor.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://tldrlegal.com/license/mit-license\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# At a Glance\n\n`SwiftyPredictor` simplifies work with [Yandex.Predictor](https://tech.yandex.ru/predictor) service in iOS.\n\n## How To Get Started\n\n- Copy content of `Source` folder to your project.\n\nor\n\n- Use `SwiftyPredictor` cocoapod.\n\n## Requirements\n\n* iOS 9.0 and later\n* Xcode 8 and later\n\n## Usage\n\nTo initialize predictor, simply write something like this:\n\n```swift\nlet predictor = Predictor(APIKey: \"some_api_key\")\n```\n\nAs you noticed, constructor requires API key. If you still don't have it, obtain new API key [here](https://tech.yandex.ru/keys/get/?service=pdct) (you'll need to authorize with Yandex account).\n\nNow you can make requests for text suggestions:\n\n```swift\npredictor.requestSuggestions(forQuery: \"how to \", inLanguage: .english, withLimit: 10) { (suggestions, error) in\n    for suggestion in suggestions {\n        print(suggestion.text)\n    }\n    \n    if error != nil {\n        print(\"Error: \\(error!)\")\n    }\n}\n```\n\nThe example above will print suggestions for phrase `how to `:\n- `get`\n- `make`\n- `use`\n- `buy`\n- `do`\n\nYou can change language by its identifier or predefined name:\n- `.english`\n- `.russian`\n- `.custom(identifier: \"es\")` - Spanish language\n- etc.\n\nIf you want to receive full list of supported languages, use `availableLanguages` method:\n\n```swift\npredictor.availableLanguages { (languages, error) in\n    for language in languages {\n        print(language.identifier)\n    }\n}\n```\n\nAll asynchronous requests made by `Predictor` instance are cancellable so you can stop them when it's needed:\n\n```swift\n/*\n * Obtain reference to request instance.\n */\n\nlet request = predictor.requestSuggestions(forQuery: \"how to \", inLanguage: .english, withLimit: 10) { (suggestions, error) in\n    // Do something with suggestions here...\n}\n\n/*\n * Cancel request when needed.\n */\n\nrequest.cancel()\n```\n\n## License\n\n`SwiftyPredictor` is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fswiftypredictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplisticated%2Fswiftypredictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fswiftypredictor/lists"}