2424
2525@cython .cclass
2626class Item :
27- index = cython .declare (cython .int , visibility = "readonly" )
28- count = cython .declare (cython .int , visibility = "readonly" )
29- doc_count = cython .declare (cython .int , visibility = "readonly" )
30-
3127 def __init__ (self , index : int , count : int , doc_count : int ):
3228 self .index = index
3329 self .count = count
@@ -36,8 +32,6 @@ def __init__(self, index: int, count: int, doc_count: int):
3632
3733@cython .cclass
3834class Word (Item ):
39- text = cython .declare (str , visibility = "readonly" )
40-
4135 def __init__ (self , text : str , index : int , count : int , doc_count : int ):
4236 super ().__init__ (index , count , doc_count )
4337 self .text = text
@@ -51,8 +45,6 @@ def __repr__(self):
5145
5246@cython .cclass
5347class Entity (Item ):
54- title = cython .declare (str , visibility = "readonly" )
55-
5648 def __init__ (self , title : str , index : int , count : int , doc_count : int ):
5749 super ().__init__ (index , count , doc_count )
5850 self .title = title
@@ -72,9 +64,9 @@ def __init__(
7264 redirect_dict : RecordTrie ,
7365 word_stats : np .ndarray ,
7466 entity_stats : np .ndarray ,
75- language : str ,
76- lowercase : bool ,
77- build_params : dict ,
67+ language : Optional [ str ] = None ,
68+ lowercase : Optional [ bool ] = None ,
69+ build_params : Optional [ dict ] = None ,
7870 min_paragraph_len : int = 0 ,
7971 uuid : str = "" ,
8072 ):
@@ -342,8 +334,8 @@ def load(target: Union[str, dict], mmap: bool = True) -> "Dictionary":
342334 return Dictionary (word_dict , entity_dict , redirect_dict , word_stats , entity_stats , ** target ["meta" ])
343335
344336
345- _dump_db : Optional [ DumpDB ] = None
346- _tokenizer : Optional [ BaseTokenizer ] = None
337+ _dump_db : DumpDB
338+ _tokenizer : BaseTokenizer
347339
348340
349341def _init_worker (dump_db : DumpDB , tokenizer : BaseTokenizer ):
0 commit comments