286a864220a00732d382a75051e11877acf13c3f,deeppavlov/models/tokenizers/nltk_tokenizer.py,NLTKTokenizer,__init__,#NLTKTokenizer#Any#Any#,24
Before Change
super().__init__(**kwargs)
if download:
nltk.download()
self.tokenizer = getattr(nltk.tokenize, tokenizer, None)
if not callable(self.tokenizer):
raise AttributeError("Tokenizer {} is not defined in nltk.tokenizer".format(tokenizer))
def infer(self, instance, *args, **kwargs):
After Change
@register("nltk_tokenizer")
class NLTKTokenizer(Inferable):
def __init__(self, save_path=None, download=False, tokenizer="wordpunct_tokenize", *args, **kwargs):
super().__init__(save_path=save_path)
if download:
nltk.download()
self.tokenizer = getattr(nltk.tok enize, tokenizer, None)
if not callable(self.tokenizer):
raise AttributeError("Tokenizer {} is not defined in nltk.tokenizer".format(tokenizer))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: deepmipt/DeepPavlov
Commit Name: 286a864220a00732d382a75051e11877acf13c3f
Time: 2018-01-24
Author: ol.gure@gmail.com
File Name: deeppavlov/models/tokenizers/nltk_tokenizer.py
Class Name: NLTKTokenizer
Method Name: __init__
Project Name: ilastik/ilastik
Commit Name: fc6a17128062165de4776a563f62e60df2461c2a
Time: 2020-04-27
Author: tom.fogaca@gmail.com
File Name: ilastik/applets/dataSelection/datasetInfoEditorWidget.py
Class Name: DatasetInfoEditorWidget
Method Name: accept
Project Name: ilastik/ilastik
Commit Name: 41d9e8fdbbf8ae4d6f93bb061603831c0608d394
Time: 2020-05-13
Author: tom.fogaca@gmail.com
File Name: ilastik/applets/dataSelection/datasetInfoEditorWidget.py
Class Name: DatasetInfoEditorWidget
Method Name: accept