{"id":15487961,"url":"https://github.com/dblock/objc-ngram","last_synced_at":"2025-09-20T05:32:49.567Z","repository":{"id":14509036,"uuid":"17222582","full_name":"dblock/objc-ngram","owner":"dblock","description":"Rudimentary ngram search in ObjectiveC.","archived":false,"fork":false,"pushed_at":"2014-03-29T16:20:43.000Z","size":771,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-09T20:09:51.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/dblock.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-26T19:39:00.000Z","updated_at":"2020-01-18T14:41:56.000Z","dependencies_parsed_at":"2022-08-27T09:40:56.686Z","dependency_job_id":null,"html_url":"https://github.com/dblock/objc-ngram","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fobjc-ngram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fobjc-ngram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fobjc-ngram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fobjc-ngram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dblock","download_url":"https://codeload.github.com/dblock/objc-ngram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233566907,"owners_count":18695286,"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":[],"created_at":"2024-10-02T06:45:11.290Z","updated_at":"2025-09-20T05:32:44.259Z","avatar_url":"https://github.com/dblock.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# objc-ngram\n\n[![Build Status](https://travis-ci.org/dblock/objc-ngram.png)](https://travis-ci.org/dblock/objc-ngram)\n[![Version](http://cocoapod-badges.herokuapp.com/v/objc-ngram/badge.png)](http://cocoadocs.org/docsets/objc-ngram)\n[![Platform](http://cocoapod-badges.herokuapp.com/p/objc-ngram/badge.png)](http://cocoadocs.org/docsets/objc-ngram)\n\n## Demo\n\nTo run the example project, run `pod try objc-ngram`.\n\nThe demo loads [sentences.txt](Demo/Data/sentences.txt) and lets you search for free-formed text in it.\n\n![demo](Screenshots/objc-ngram.gif)\n\n## Installation\n\nobjc-ngram is available through [CocoaPods](http://cocoapods.org), to install it add the following line to your Podfile:\n\n    pod \"objc-ngram\"\n\n## Usage\n\nImport `OCNDictionary`.\n\n``` objc\n#import \u003cobjc-ngram/OCNDictionary.h\u003e\n```\n\nCreate an `OCNDictionary` and add objects to it with a given key. The key must be a string and is split into 3-grams.\n\n``` objc\nOCNDictionary *dict = [OCNDictionary dictionary];\n[dict addObject:@\"red brown fox\" forKey:@\"red brown fox\"];\n[dict addObject:@\"white big bear\" forKey:@\"white big bear\"];\n[dict addObject:@\"hiding rabbit\" forKey:@\"hiding\"];\n\nNSArray *results = [dict matchObjectsForKey:@\"white fox\"];\nfor (OCNObjectScore *result in results) {\n  NSLog(@\"'%@' has a score of %f\", result.object, result.score);\n}\n```\n\nThis will output the following.\n\n```\n'white big bear' has a score of 1.416667\n'red brown fox' has a score of 0.181818\n```\n\nYou can create a `OCNDictionary` with a different n-gram size.\n\n``` objc\nOCNDictionary *dict = [OCNDictionary dictionaryWithNgramWidth:4];\n```\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n## License\n\nThe objc-ngram library is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fobjc-ngram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdblock%2Fobjc-ngram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fobjc-ngram/lists"}