MCPcopy Create free account
hub / github.com/chengsen/PyTorch_TextGCN / __init__

Method __init__

data_processor.py:11–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10class StringProcess(object):
11 def __init__(self):
12 self.other_char = re.compile(r"[^A-Za-z0-9(),!?\'\`]", flags=0)
13 self.num = re.compile(r"[+-]?\d+\.?\d*", flags=0)
14 # self.url = re.compile(r"[a-z]*[:.]+\S+|\n|\s+", flags=0)
15 self.url = re.compile(
16 r"(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]", flags=0)
17 self.stop_words = None
18 self.nlp = None
19
20 def clean_str(self, string):
21 string = re.sub(self.other_char, " ", string)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected