<commit_before># YAJL (Objective-C Wrapper)

YAJL.framework is an Objective-C wrapper around the [YAJL](http://lloyd.github.com/yajl/) SAX-style JSON parser.

## Download

### Mac OS X

[YAJL-0.2.6.zip](http://rel.me.s3.amazonaws.com/yajl/YAJL-0.2.6.zip) *YAJL.framework* (2009/10/07)

### iPhone

[libYAJLIPhone-0.2.6.zip](https://rel.me.s3.amazonaws.com/yajl/libYAJLIPhone-0.2.6.zip) *Static Library for iPhone OS 3.0 Simulator & Device* (2009/10/07)

## Install (Mac OS X)

There are two options. You can install it globally in /Library/Frameworks or with a little extra effort embed it with your project.

### Installing in /Library/Frameworks

- Copy `YAJL.framework` to `/Library/Frameworks/`
- In the target Info window, General tab:
	- Add a linked library, under `Mac OS X 10.5 SDK` section, select `YAJL.framework`

### Installing in your project

- Copy `YAJL.framework` to your project directory (maybe in MyProject/Frameworks/.)
- Add the `YAJL.framekwork` files (from MyProject/Frameworks/) to your target. It should be visible as a `Linked Framework` in the target. 
- Under Build Settings, add `@loader_path/../Frameworks` to `Runpath Search Paths` 
- Add `New Build Phase` | `New Copy Files Build Phase`. 
	- Change the Destination to `Frameworks`.
	- Drag `YAJL.framework` into the the build phase
	- Make sure the copy phase appears before any `Run Script` phases 

## Install (iPhone)

- Add files (from static library build) to project.
- Under 'Other Linker Flags' in the Test target, add -ObjC and -all_load (So NSObject+YAJL category is loaded).

## Usage

To parse JSON from an NSString or NSData:

	#import "NSObject+YAJL.h"

	NSData *JSONData = [NSData dataWithContentsOfFile:@"example.json"];
	NSArray *arrayFromData = [JSONData yajl_JSON];
	
	NSString *JSONString = @"[\"Test\"]";<commit_msg>Changing download link<commit_after># YAJL (Objective-C Wrapper)

YAJL.framework is an Objective-C wrapper around the [YAJL](http://lloyd.github.com/yajl/) SAX-style JSON parser.

## Download

### Mac OS X

[YAJL-0.2.6.zip](http://rel.me.s3.amazonaws.com/yajl/YAJL-0.2.6.zip) *YAJL.framework* (2009/10/07)

### iPhone

[libYAJLIPhone-0.2.6.zip](http://rel.me.s3.amazonaws.com/yajl/libYAJLIPhone-0.2.6.zip) *Static Library for iPhone OS 3.0 Simulator & Device* (2009/10/07)

## Install (Mac OS X)

There are two options. You can install it globally in /Library/Frameworks or with a little extra effort embed it with your project.

### Installing in /Library/Frameworks

- Copy `YAJL.framework` to `/Library/Frameworks/`
- In the target Info window, General tab:
	- Add a linked library, under `Mac OS X 10.5 SDK` section, select `YAJL.framework`

### Installing in your project

- Copy `YAJL.framework` to your project directory (maybe in MyProject/Frameworks/.)
- Add the `YAJL.framekwork` files (from MyProject/Frameworks/) to your target. It should be visible as a `Linked Framework` in the target. 
- Under Build Settings, add `@loader_path/../Frameworks` to `Runpath Search Paths` 
- Add `New Build Phase` | `New Copy Files Build Phase`. 
	- Change the Destination to `Frameworks`.
	- Drag `YAJL.framework` into the the build phase
	- Make sure the copy phase appears before any `Run Script` phases 

## Install (iPhone)

- Add files (from static library build) to project.
- Under 'Other Linker Flags' in the Test target, add `-ObjC` and `-all_load` (So NSObject+YAJL category is loaded).

## Usage

To parse JSON from an NSString or NSData:

	#import "NSObject+YAJL.h"

	NSData *JSONData = [NSData dataWithContentsOfFile:@"example.json"];
	NSArray *arrayFromData = [JSONData yajl_JSON];
	
	NSString *JSONString = @"[\"Test\"]";
{'fraction_non_alphanumeric': 0.12534209085933223, 'fraction_numerical': 0.019157088122605363, 'mean_word_length': 4.027510316368638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '846039', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1231, 'n_words': 419}