A fast and lightweight solution to finding synonyms for words, built as a category on NSString.
Drag and drop the .h/.m files for NSString+RNSynonyms
into your project. I'll setup a podspec if someone opens an issue for it.
Grab an API key from Big Huge Labs here. Explore the docs, send me some pull requests!
To find all possible synonyms for a word.
NSString *word = @"developer";
[word findSynonymsWithCompletion:^(NSArray *words, NSError *error) {
// "creator","photographic equipment"
}];
To find all possible synonyms for a word based on its usage. Usages can be either
- noun
- verb
- adjective
- adverb
NSString *word = @"phone";
[word findSynonymsWithUsage:@"verb" completion:^(NSArray *words, NSError *error) {
// "call","telephone","call up","ring","telecommunicate"
}];
To find all possible synonyms for a word.
NSString *word = @"important";
NSString *sentence = @"The important thing to remember about WWDC is that it is a developer conference.";
[word findSynonymsInContextSentence:sentence completion:^(NSArray *words, NSError *error) {
// "of import","significant","crucial","authoritative"
}];
This small project makes use of NSLinguisticsTagger
. Check out the docs and for more reading, NSHipster.
- @nystrorm on Twitter
- @rnystrom on Github
- rnystrom [at] whoisryannystrom [dot] com
Licensed under MIT, see LICENSE.