 //
 
 import Foundation
+
+private let AllEmojiArray: [Emoji] = {
+    guard let path = NSBundle(forClass: EmojiFetchOperation.self).pathForResource("AllEmoji", ofType: "json"),
+        data = NSData(contentsOfFile: path),
+        jsonObject = try? NSJSONSerialization.JSONObjectWithData(data, options: []),
+        jsonDictionaries = jsonObject as? [JSONDictionary] else { return [] }
+
+    return jsonDictionaries.flatMap { Emoji(dictionary: $0) }
+}()
+
+private let AllEmojiDictionary: [String: Emoji]  = {
+    var dictionary = Dictionary<String, Emoji>(minimumCapacity:AllEmojiArray.count)
+    AllEmojiArray.forEach {
+        dictionary[$0.character] = $0
+    }
+    return dictionary
+}()
 
 public struct EmojiFetcher {
 

    }

    public func isEmojiRepresentedByString(string: String) -> Bool {
        return EmojiFetchOperation.emojiDictionary[string] != nil
    }
}

private final class EmojiFetchOperation: NSOperation {

    static let allEmoji: [Emoji] = {
        guard let path = NSBundle(forClass: EmojiFetchOperation.self).pathForResource("AllEmoji", ofType: "json"),
            data = NSData(contentsOfFile: path),
            jsonObject = try? NSJSONSerialization.JSONObjectWithData(data, options: []),
            jsonDictionaries = jsonObject as? [JSONDictionary] else { return [] }

        return jsonDictionaries.flatMap { Emoji(dictionary: $0) }
    }()

    static let emojiDictionary: [String: Emoji]  = {
        var dictionary = Dictionary<String, Emoji>(minimumCapacity:EmojiFetchOperation.allEmoji.count)
        EmojiFetchOperation.allEmoji.forEach {
            dictionary[$0.character] = $0
        }
        return dictionary
    }()


    // MARK: - Properties



            return validResult
        }
        guard !cancelled else { return [] }

        return results
    }
}
