     }
 }
 
-//extension KeymochiKeyboardViewController: SentimentAnalysisDelegate{
-//    func getSentiment(_: SentimentKeyboard, getSentimentFor phrase: String) {
-//        phrase = getPhrase
-//    }
-//    self.printSentiment(phrase)
-//}

			defaults.set(false, forKey: KeymochiKeyboardViewController.kHasAssessedEmotion)
		} else if !hasAssessedEmotion && keepUsingTime > keepUsingThreshold {
			promptAssessmentSheet()
            if let sentence = textDocumentProxy.documentContextBeforeInput?.components(separatedBy: " "){
                print ("sentence in switchAssesmentState is", sentence)
                sentiment = getSentiment(wordArr: sentence)
            }
            

		}
		defaults.set(Date(), forKey: KeymochiKeyboardViewController.kLastOpenTime)

        motionManager.stopDeviceMotionUpdates()
        if hasAssessedEmotion {
//            DataManager.sharedInatance.dumpCurrentData(withEmotion: emotion!, sentiment: Float(sentiment))
            if let sentence = textDocumentProxy.documentContextBeforeInput?.components(separatedBy: " "){
                print ("sentence in view did disppear is", sentence)
                sentiment = getSentiment(wordArr: sentence)
            }
            DataManager.sharedInatance.dumpCurrentData(withEmotion: emotion!, withSentiment: sentiment)
//            WordRater.sharedInstance.returnValence(str:sentence)
            
