     }
     
     func candidates() -> [EmojiCandidate!]! {
-        return []
+        let prefixMatches = EmojiInputEngine.binarySearch(EmojiInputEngine.normalize(keyword), array: sortedKeywords)
+        var candidates:[EmojiCandidate!]! = []
+        for match in prefixMatches {
+            let emojis = keywordIndex[match]!
+            candidates.appendContentsOf(emojis.map({
+                return EmojiCandidate(emoji: $0)
+            }))
+        }
+        return candidates
     }
     
     /// 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 emoji keys, e.g. "face": ["smile", "sad", ...]
    private let keywordIndex:[String:[String]!]!
    // Sorted keywords
    private let sortedKeywords:[String]!
    

    }
    
    init(emojis: [Emoji!]!) {
        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)
                } else {
                    keywordIndex[normalizedKeyword] = [emoji]
                }
            }
        }
