Skip to content

A fast and lightweight solution to finding synonyms for words, built as a category on NSString.

License

Notifications You must be signed in to change notification settings

rnystrom/NSString-RNSynonyms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NSString+RNSynonyms

A fast and lightweight solution to finding synonyms for words, built as a category on NSString.

Installation

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.

API Key

Grab an API key from Big Huge Labs here. Explore the docs, send me some pull requests!

Usage

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"
}];

Reading

This small project makes use of NSLinguisticsTagger. Check out the docs and for more reading, NSHipster.

Contact

License

Licensed under MIT, see LICENSE.

About

A fast and lightweight solution to finding synonyms for words, built as a category on NSString.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published