MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / CustomLanguageVars

Class CustomLanguageVars

DeepSpeedExample/tools/preprocess_data.py:39–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38# https://stackoverflow.com/questions/33139531/preserve-empty-lines-with-nltks-punkt-tokenizer
39class CustomLanguageVars(nltk.tokenize.punkt.PunktLanguageVars):
40
41 _period_context_fmt = r"""
42 \S* # some word material
43 %(SentEndChars)s # a potential sentence ending
44 \s* # <-- THIS is what I changed
45 (?=(?P<after_tok>
46 %(NonWord)s # either other punctuation
47 |
48 (?P<next_tok>\S+) # <-- Normally you would have \s+ here
49 ))"""
50
51class IdentitySplitter(object):
52 def tokenize(self, *text):

Callers 1

initializerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected