     }
     
     init(emojis: [Emoji!]!) {
-        var keywordIndex = [String:[String]]()
+        var keywordIndex = [String:[Emoji!]!]()
         for emoji in emojis {
             var keywords = emoji.keywords
             keywords.append(emoji.key)
             for keyword in keywords {
                 let normalizedKeyword = EmojiInputEngine.normalize(keyword)
                 if keywordIndex[normalizedKeyword] != nil {
-                    keywordIndex[normalizedKeyword]?.append(emoji.key)
+                    keywordIndex[normalizedKeyword]?.append(emoji)
                 } else {
-                    keywordIndex[normalizedKeyword] = [emoji.key]
+                    keywordIndex[normalizedKeyword] = [emoji]
                 }
             }
         }

    }
    
    func candidates() -> [EmojiCandidate!]! {
        return []
    }
    
    /// Do binary search for finding spefic prefix in string array

class EmojiInputEngine : EmojiInputEngineProtocol {
    private var _keyword:String!
    private let emojis:[Emoji!]!
    // map from keyword to emojis, e.g. "face": ["smile", "sad", ...]
    private let keywordIndex:[String:[Emoji!]!]!
    // Sorted keywords
    private let sortedKeywords:[String]!
    
