You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply change start = time.clock() to start = time.perf_counter() in the file: thulac/character/CBTaggingDecoder.py, the program will run well
Modifying the source code isn't a good practice, since that means you cannot migrate your code to a another device. Try this instead(before the official fix this):
import time
if not hasattr(time, 'clock'):
setattr(time,'clock',time.perf_counter)
Then your code will run well no matter on a Python<3.8 or a Python>=3.8.
Simply change start = time.clock() to start = time.perf_counter() in the file: thulac/character/CBTaggingDecoder.py, the program will run well
Modifying the source code isn't a good practice, since that means you cannot migrate your code to a another device. Try this instead(before the official fix this):
import time
if not hasattr(time, 'clock'):
setattr(time,'clock',time.perf_counter)
Then your code will run well no matter on a Python<3.8 or a Python>=3.8.
Activity
dovecho commentedon Mar 9, 2020
Simply change
start = time.clock()tostart = time.perf_counter()in the file:thulac/character/CBTaggingDecoder.py, the program will run wellHannibalXZX commentedon Apr 21, 2020
我也有这个问题,但是在2.7版本可以运行。你可以尝试改成2.7,也可以把相应的函数替换为3.8版本的
use time.perf_counter or time.process_time instead time.clock()
改完以后,我这边3.8版本,运行成功。
fncokg commentedon Aug 21, 2021
Modifying the source code isn't a good practice, since that means you cannot migrate your code to a another device. Try this instead(before the official fix this):
Then your code will run well no matter on a Python<3.8 or a Python>=3.8.
YunfangHou commentedon Dec 30, 2021
It works. Thank you.