<commit_before>//
//  BezierPath.swift
//  BezierKit
//
//  Created by <NAME> on 7/31/18.
//  Copyright © 2018 <NAME>. All rights reserved.
//

import CoreGraphics
import Foundation

@objc(BezierKitPathFillRule) public enum PathFillRule: NSInteger {
    case winding=0, evenOdd
}

internal func windingCountImpliesContainment(_ count: Int, using rule: PathFillRule) -> Bool {
    switch rule {
    case .winding:
        return count != 0
    case .evenOdd:
        return count % 2 != 0
    }
}

@objc(BezierKitPath) public class Path: NSObject, NSCoding {
    
    private class PathApplierFunctionContext {
        var currentPoint: CGPoint? = nil
        var componentStartPoint: CGPoint? = nil
        
        var currentComponentPoints: [CGPoint] = []
        var currentComponentOrders: [Int] = []
        
        var components: [PathComponent] = []
        func finishUp() {
            if currentComponentPoints.isEmpty == false {
                components.append(PathComponent(points: currentComponentPoints, orders: currentComponentOrders))
                currentComponentPoints = []
                currentComponentOrders = []<commit_msg>fixed issue with edge case (should resolve unit test).<commit_after>//
//  BezierPath.swift
//  BezierKit
//
//  Created by <NAME> on 7/31/18.
//  Copyright © 2018 <NAME>. All rights reserved.
//

import CoreGraphics
import Foundation

@objc(BezierKitPathFillRule) public enum PathFillRule: NSInteger {
    case winding=0, evenOdd
}

internal func windingCountImpliesContainment(_ count: Int, using rule: PathFillRule) -> Bool {
    switch rule {
    case .winding:
        return count != 0
    case .evenOdd:
        return count % 2 != 0
    }
}

@objc(BezierKitPath) public class Path: NSObject, NSCoding {
    
    private class PathApplierFunctionContext {
        var currentPoint: CGPoint? = nil
        var componentStartPoint: CGPoint? = nil
        
        var currentComponentPoints: [CGPoint] = []
        var currentComponentOrders: [Int] = []
        
        var components: [PathComponent] = []
        func finishUp() {
            if currentComponentOrders.isEmpty == false {
                components.append(PathComponent(points: currentComponentPoints, orders: currentComponentOrders))
                currentComponentPoints = []
                currentComponentOrders = []
{'fraction_non_alphanumeric': 0.0931518502764781, 'fraction_numerical': 0.01105912377711612, 'mean_word_length': 2.596330275229358, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '490378', 'n_tokens_mistral': 684, 'n_tokens_neox': 641, 'n_words': 180}