<commit_before># Linq To Objective-C

Bringing a Linq-style fluent query API to Objective-C.

This project contains a collection of `NSArray` methods that allow you to execute query using a fluent syntax, inspired by Linq. In order to use *Linq to Objective-C* simply copy the `NSArray+LinqExtensions.h`and `NSArray+LinqExtensions.m` files into your project and import the header within any file where you wish to use the API.

As an example of the types of query this API makes possible, let's say you have an array of `Person` instances, each with a `surname` property. The following query will create a sorted, comma-separated list of the unique surnames from the array:

```objc
Selector surnameSelector = ^id(id person){
    return [person name];
};

Accumulator csvAccumulator = ^id(id item, id aggregate) {
    return [NSString stringWithFormat:@"%@, %@", aggregate, item];
};

NSArray* surnamesList = [[[[people select:surnameSelector]
                                   sort]
                                   distinct]
                                   aggregate:csvAccumulator];
```

For a detailed discussion of the history of Linq and why I implemented this API, see the [related blog post](http://www.scottlogic.co.uk/blog/colin/2013/02/linq-to-objective-c/).

#Licence

The code within project is made available under the standard MIT licence, see the included licence file.

# API Overview


`NSArray` methods:
<commit_msg>Updated documentation<commit_after># Linq To Objective-C

Bringing a Linq-style fluent query API to Objective-C.

This project contains a collection of `NSArray` and `NSDictionary` methods that allow you to execute queries using a fluent syntax, inspired by [Linq](http://msdn.microsoft.com/en-us/library/vstudio/bb397926.aspx). In order to use *Linq to Objective-C* simply copy the `NSArray+LinqExtensions.h`, `NSArray+LinqExtensions.m`, `NSDictionary+LinqExtensions.h` and `NSDictionary+LinqExtensions.m` files into your project and import the header within any file where you wish to use the API.

Alternatively, you can include these files via [CocoaPods](http://cocoapods.org/).

As an example of the types of query this API makes possible, let's say you have an array of `Person` instances, each with a `surname` property. The following query will create a sorted, comma-separated list of the unique surnames from the array:

```objc
Selector surnameSelector = ^id(id person){
    return [person name];
};

Accumulator csvAccumulator = ^id(id item, id aggregate) {
    return [NSString stringWithFormat:@"%@, %@", aggregate, item];
};

NSArray* surnamesList = [[[[people select:surnameSelector]
                                   sort]
                                   distinct]
                                   aggregate:csvAccumulator];
```

For a detailed discussion of the history of Linq and why I implemented this API, see the [related blog post](http://www.scottlogic.co.uk/blog/colin/2013/02/linq-to-objective-c/).

#Licence

The code within project is made available under the standard MIT licence, see the included licence file.

# API Overview


`NSArray` methods:

{'fraction_non_alphanumeric': 0.08506555804285257, 'fraction_numerical': 0.005756315957787016, 'mean_word_length': 3.462196861626248, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '545896', 'n_tokens_mistral': 899, 'n_tokens_neox': 851, 'n_words': 360}