瀏覽代碼

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()



Loading…
取消
儲存