Latest 0.1.1
Homepage https://github.com/barclay/NSString-IndefiniteArticle
License MIT
Authors

A simple category to extend NSString to determine indefinite article usage (a|an) for a given word.

This work was loosely cribbed off of both @rossmeissl’s ruby implementation and @rigoneri’s javascript one _(which, ultimately was based
on Lingua::EN::Inflect)_.

Installation

We recommend installing with CocoaPods.

pod 'NSString+IndefiniteArticle'

Alternatively, you can just copy the category from the Source directory into your project. And there’s a suite of examples in the Tests directory too, if you’re into that sort of thing.

Usage

The categoy provides both instance and static methods to determine if a given word should have an a, or an article.

For example:

// static methods:
[NSString indefiniteArticleForString:@"elipis"] //  -> @"an"
[NSString indefiniteArticleForString:@"taco"]   //  -> @"a"  

// or you can call it on a given string:                       
[@"historic event" indefiniteArticle]           // -> @"a"
[@"USB cable" indefiniteArticle]                // -> @"a"

Author

Barclay Loftus (@barclay) http://github.com/barclay

License

This work is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NSString+IndefiniteArticle",
    "version": "0.1.1",
    "summary": "An NSString category for providing an indefinite articles (a|an)",
    "description": "                    An NSString category for providing indefinite articles (a|an)n                    for a given string.nn                    For example:nn                    *  `[NSString indefiniteArticleForString:@"elipis"] => @"an"`n                    *  `[NSString indefiniteArticleForString:@"taco"] => @"a"`nn                    or you can call it on a given string:nn                    * `[@"historic event" indefiniteArticle] => @"a"`n                    * `[@"800 lb gorilla" indefiniteArticle] => @"an"`nn",
    "homepage": "https://github.com/barclay/NSString-IndefiniteArticle",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "barclay loftus": "[email protected]"
    },
    "social_media_url": "http://twitter.com/barclay",
    "source": {
        "git": "https://github.com/barclay/NSString-IndefiniteArticle.git",
        "tag": "0.1.1"
    },
    "source_files": [
        "Source",
        "Source/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This