Skip to content

rnystrom/NSString-RNSynonyms

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

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