<commit_before>//
//  ViewController.swift
//  Ji
//
//  Created by <NAME> on 2015-07-18.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

	override func viewDidLoad() {
		super.viewDidLoad()
		
		// Init with data
		let googleIndexData = NSData(contentsOfURL: NSURL(string: "http://www.google.com")!)!
		let jiGoogleIndexDoc = Ji(htmlData: googleIndexData)!
		
		let nodes = jiGoogleIndexDoc.searchWithXPathQuery("//body")
		println("tag name: \(nodes?.first?.name)")
		
		// Init with URL
		let jiAppleSupportDoc = Ji(htmlURL: NSURL(string: "http://www.apple.com/support")!)
		let titleNode = jiAppleSupportDoc?.searchWithXPathQuery("//head/title")?.first
		println("title: \(titleNode?.content)")
		
		// Init with String
		let xmlString = "<?xml version='1.0' encoding='UTF-8'?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>"
		let xmlDoc = Ji(xmlString: xmlString)
		let bodyNode = xmlDoc?.rootNode?.firstChildWithName("body")
		println("body: \(bodyNode?.content)")
	}
}<commit_msg>Updated sample code<commit_after>//
//  ViewController.swift
//  Ji
//
//  Created by <NAME> on 2015-07-18.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

	override func viewDidLoad() {
		super.viewDidLoad()
		
		// Init with data
		let googleIndexData = NSData(contentsOfURL: NSURL(string: "http://www.google.com")!)
		if let googleIndexData = googleIndexData {
			let jiGoogleIndexDoc = Ji(htmlData: googleIndexData)!
			
			let nodes = jiGoogleIndexDoc.searchWithXPathQuery("//body")
			println("tag name: \(nodes?.first?.name)")
		} else {
			println("google.com is inaccessible")
		}
		
		// Init with URL
		let jiAppleSupportDoc = Ji(htmlURL: NSURL(string: "http://www.apple.com/support")!)
		let titleNode = jiAppleSupportDoc?.searchWithXPathQuery("//head/title")?.first
		println("title: \(titleNode?.content)")
		
		// Init with String
		let xmlString = "<?xml version='1.0' encoding='UTF-8'?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>"
		let xmlDoc = Ji(xmlString: xmlString)
		let bodyNode = xmlDoc?.rootNode?.firstChildWithName("body")
		println("body: \(bodyNode?.content)")
	}
}
{'fraction_non_alphanumeric': 0.1651023890784983, 'fraction_numerical': 0.012798634812286689, 'mean_word_length': 4.281531531531532, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 2, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6475228', 'n_tokens_mistral': 855, 'n_tokens_neox': 761, 'n_words': 162}