def test_simplified_user_dictionary(self):
    user_dic = UserDictionary(user_dict=os.path.join(parent_dir, 'tests/user_simpledic.csv'), enc='utf8', type='simpledic', connections=connections)
    self.assertEqual(1, len(user_dic.lookup('東京スカイツリー'.encode('utf8'))))
    dic_dir = os.path.join(parent_dir, 'tests/userdic_simple')
    user_dic.save(to_dir=os.path.join(parent_dir, 'tests/userdic_simple'))
    self.assertTrue(os.path.exists(os.path.join(dic_dir, FILE_USER_FST_DATA)))
    self.assertTrue(os.path.exists(os.path.join(dic_dir, FILE_USER_ENTRIES_DATA)))
    compiled_user_dic = CompiledUserDictionary(dic_dir, connections=connections)
    self.assertEqual(1, len(compiled_user_dic.lookup('とうきょうスカイツリー駅'.encode('utf8'))))
def test_simplified_user_dictionary(self):
    user_dic = UserDictionary(user_dict=os.path.join(parent_dir, 'tests/user_simpledic.csv'), enc='utf8', type='simpledic', connections=connections)
    self.assertEqual(1, len(user_dic.lookup('東京スカイツリー'.encode('utf8'))))
    dic_dir = os.path.join(parent_dir, 'tests/userdic_simple')
    user_dic.save(to_dir=os.path.join(parent_dir, 'tests/userdic_simple'))
    self.assertTrue(os.path.exists(os.path.join(dic_dir, FILE_USER_FST_DATA)))
    self.assertTrue(os.path.exists(os.path.join(dic_dir, FILE_USER_ENTRIES_DATA)))
    compiled_user_dic = CompiledUserDictionary(dic_dir, connections=connections)
    self.assertEqual(1, len(compiled_user_dic.lookup('とうきょうスカイツリー駅'.encode('utf8'))))