|
@@ -35,7 +35,7 @@ class News():
|
|
|
a.parse()
|
|
a.parse()
|
|
|
except Exception:
|
|
except Exception:
|
|
|
print("ERROR parsing/downloading article")
|
|
print("ERROR parsing/downloading article")
|
|
|
- ERROR=True
|
|
|
|
|
|
|
+ self.ERROR=True
|
|
|
return
|
|
return
|
|
|
a.nlp()
|
|
a.nlp()
|
|
|
a.authors=self.dedup([self.fix_author(value) for value in a.authors if not self.isComment(value) and not self.isNoise(value)])
|
|
a.authors=self.dedup([self.fix_author(value) for value in a.authors if not self.isComment(value) and not self.isNoise(value)])
|
|
@@ -47,6 +47,7 @@ class News():
|
|
|
self.TEXT=a.text
|
|
self.TEXT=a.text
|
|
|
self.TITLE=a.title
|
|
self.TITLE=a.title
|
|
|
self.HTML=htmlmin.minify(a.article_html,remove_empty_space=True)
|
|
self.HTML=htmlmin.minify(a.article_html,remove_empty_space=True)
|
|
|
|
|
+ self.ERROR=False
|
|
|
lowertext=self.TEXT.lower()
|
|
lowertext=self.TEXT.lower()
|
|
|
for k in kw:
|
|
for k in kw:
|
|
|
#if re.match(k["pattern"], self.TEXT): #FIXME regex vs string in string
|
|
#if re.match(k["pattern"], self.TEXT): #FIXME regex vs string in string
|
|
@@ -69,6 +70,7 @@ class News():
|
|
|
"weight": self.WEIGHT_SUM,
|
|
"weight": self.WEIGHT_SUM,
|
|
|
"kw": self.MATCHING_KW,
|
|
"kw": self.MATCHING_KW,
|
|
|
"html": self.HTML,
|
|
"html": self.HTML,
|
|
|
|
|
+ "error": self.ERROR,
|
|
|
"title": self.TITLE
|
|
"title": self.TITLE
|
|
|
}
|
|
}
|
|
|
|
|
|