def main(): path_project = os.path.abspath( os.path.join(os.getcwd(), os.pardir, os.pardir)) print path_project # usr_dict_path = path_project+"/resourse/toothICD10_freq" log_path = path_project + '/tmp/log' path = path_project + "/input" # log(log_path).info("this is a test") # logger =mylogger.log_file(log_path) logger1 = mylogger.log_console_and_file(log_path) my_segmentation(path, logger1)
import datetime from nltk.tag.stanford import StanfordPOSTagger from kg.util.file import load_json from kg.util.string import cut_list from kg.books.analysis_items import extract_item_properties import codecs import re import nltk from kg.util.mylogger import log_console_and_file from multiprocessing import Pool import multiprocessing import threading path_project = os.path.abspath(os.path.join(os.getcwd(), os.pardir, os.pardir)) path_log_output = path_project + os.sep + "output" + os.sep + "log_regular_verify.txt" logger = log_console_and_file(path_log_output) tag_time_all = 0 find_candidate_time = 0 def load_patterns(path): return load_json(path) def compare_similar_pos(sent_pos1, sent_pos2): cnt_same_word = 0 cnt_same_pos = 0 i = 0 j = 0 while i < len(sent_pos1) and j < len(sent_pos2): # print sent_pos1[i][0],sent_pos2[j][0]
#encoding=utf-8 ''' Created on 2016年11月4日 @author: feifei ''' import kg.util.mylogger from kg.util import mylogger import os def test(log_path,mylogger1): mylogger1.info("this is a test") # logger_mycrawler.debug("test debug") # logger_mycrawler.info("test info") # logger_mycrawler.warning("test warning") if __name__=="__main__": path_project = os.path.abspath(os.path.join(os.getcwd(), os.pardir, os.pardir)) log_path = path_project+'/tmp/log' logger_mycrawler=mylogger.log_console_and_file(log_path) test(log_path,logger_mycrawler)