浏览代码

Merge pull request #114 from jayvdb/tokenizer_loading

Lazy loading of pure Python tokenizer
tags/v0.4.1
Ben Kurtovic 9 年前
父节点
当前提交
dcca42abb0
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      mwparserfromhell/parser/__init__.py

+ 2
- 1
mwparserfromhell/parser/__init__.py 查看文件

@@ -40,11 +40,11 @@ class ParserError(Exception):


from .builder import Builder
from .tokenizer import Tokenizer
try:
from ._tokenizer import CTokenizer
use_c = True
except ImportError:
from .tokenizer import Tokenizer
CTokenizer = None
use_c = False

@@ -70,6 +70,7 @@ class Parser(object):
if use_c and CTokenizer:
self._tokenizer = CTokenizer()
else:
from .tokenizer import Tokenizer
self._tokenizer = Tokenizer()
self._builder = Builder()



正在加载...
取消
保存