forked from EvertonCa/SeleniumSemanticScraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Artigo.py
47 lines (40 loc) · 1.39 KB
/
Artigo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class Artigo:
def __init__(self, titulo, autores, publicado, data, citacoes, link, cite, bibtex, synopsis):
self.titulo = titulo
self.autores = autores
self.publicado_em = publicado
self.data = data
self.citacoes = citacoes
self.data_relativa = 0
self.citacoes_relativa = 0
self.cite_label = 0
self.total_factor = 0
self.impact_factor = " "
self.link = link
self.cite = cite
self.bibtex = bibtex
self.synopsis = synopsis
def __lt__(self, other):
return self.titulo < other
def __le__(self, other):
if isinstance(other, Artigo):
return self.titulo <= other.titulo
elif isinstance(other, (int, float, str)):
return self.titulo <= other
else:
return NotImplemented
def __ge__(self, other):
if isinstance(other, Artigo):
return self.titulo >= other.titulo
elif isinstance(other, (int, float, str)):
return self.titulo >= other
else:
return NotImplemented
def __eq__(self, other):
return hash((self.titulo, self.link)) == hash((other.titulo, other.link))
def __ne__(self, other):
return self.titulo != other
def __gt__(self, other):
return self.titulo > other
def __hash__(self):
return hash((self.titulo, self.link))