diff --git a/jieba/finalseg/__init__.py b/jieba/finalseg/__init__.py index 831d8c2..50515b3 100644 --- a/jieba/finalseg/__init__.py +++ b/jieba/finalseg/__init__.py @@ -34,7 +34,7 @@ def load_model(): emit_p = {} abs_path = os.path.join(_curpath, PROB_EMIT_P) - with file(abs_path, 'rb') as f: + with open(abs_path, 'rb') as f: emit_p = marshal.load(f) f.closed diff --git a/jieba/posseg/__init__.py b/jieba/posseg/__init__.py index 19c0074..ac5b697 100644 --- a/jieba/posseg/__init__.py +++ b/jieba/posseg/__init__.py @@ -41,13 +41,13 @@ def load_model(f_name,isJython=True): emit_p = {} abs_path = os.path.join(_curpath, PROB_EMIT_P) - with file(abs_path, 'rb') as f: + with open(abs_path, 'rb') as f: emit_p = marshal.load(f) f.closed state = {} abs_path = os.path.join(_curpath, CHAR_STATE_TAB_P) - with file(abs_path, 'rb') as f: + with open(abs_path, 'rb') as f: state = marshal.load(f) f.closed