Commit 769fad63 authored by Jeremy Hylton's avatar Jeremy Hylton

Use underscore for internal methods

parent dbdffd61
...@@ -16,10 +16,10 @@ class HTMLWordSplitter: ...@@ -16,10 +16,10 @@ class HTMLWordSplitter:
def process(self, text): def process(self, text):
splat = [] splat = []
for t in text: for t in text:
splat += self.split(t) splat += self._split(t)
return splat return splat
def split(self, text): def _split(self, text):
text = text.lower() text = text.lower()
remove = ["<[^>]*>", remove = ["<[^>]*>",
"&[A-Za-z]+;", "&[A-Za-z]+;",
...@@ -27,7 +27,7 @@ class HTMLWordSplitter: ...@@ -27,7 +27,7 @@ class HTMLWordSplitter:
for pat in remove: for pat in remove:
text = re.sub(pat, " ", text) text = re.sub(pat, " ", text)
rx = re.compile("[A-Za-z]") rx = re.compile("[A-Za-z]")
return [word for word in text.split() return [word for word in text._split()
if len(word) > 1 and rx.search(word)] if len(word) > 1 and rx.search(word)]
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment