From 25839b51277c72415d1e4a16267adc9b9de507ce Mon Sep 17 00:00:00 2001 From: ZoeyYoung Date: Wed, 21 Aug 2013 19:46:14 +0800 Subject: [PATCH] fix bug --- jieba/finalseg/__init__.py | 2 +- jieba/posseg/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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