# Path: chat/config.py
# def getConfig(section, key):
#     config = ConfigParser()
#     path = os.path.split(os.path.realpath(__file__))[0] + '/conf/self.conf'
#     config.read(path, encoding='UTF-8')
#     return config.get(section, key)


import json
import socket
from .config import getConfig

# -*- coding: utf-8 -*-
"""Chat client. 聊天客户端。

Available functions:
- question_pack: Package the question as the JSON format specified by the server.
将问题打包为服务器指定的json格式。
- config_pack: Package the config info as the JSON format specified by the server.
将配置信息打包为服务器指定的json格式。
- match：Match the answers from the semantic knowledge database.
从语义知识数据库搜索答案。
- config：Configure the semantic knowledge database.
配置语义知识数据库。
"""

# from .mytools import time_me

mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = getConfig("nluclient", "host")

# Path: chat/config.py
# def getConfig(section, key):
#     config = ConfigParser()
#     path = os.path.split(os.path.realpath(__file__))[0] + '/conf/self.conf'
#     config.read(path, encoding='UTF-8')
#     return config.get(section, key)


# Path: chat/client.py
import json
import socket
from .config import getConfig

# -*- coding: utf-8 -*-
"""Chat client. 聊天客户端。

Available functions:
- question_pack: Package the question as the JSON format specified by the server.
将问题打包为服务器指定的json格式。
- config_pack: Package the config info as the JSON format specified by the server.
将配置信息打包为服务器指定的json格式。
- match：Match the answers from the semantic knowledge database.
从语义知识数据库搜索答案。
- config：Configure the semantic knowledge database.
配置语义知识数据库。
"""

# from .mytools import time_me

mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = getConfig("nluclient", "host")

port = int(getConfig("nluclient", "port"))
