Exemple #1
0
 def get_title(cat):
     return title_to_uri(re.sub('^Category:', '', cat['title']),
                         category=True)
Exemple #2
0
 def node_to_type_char(title):
     uri = title_to_uri(title, category=True)
     return 'Class' if is_class(uri) else 'Individual'
Exemple #3
0
 def _parse_line(self, line):
     title_and_label = line.strip().split(' -> ')[-1]
     title_, label = title_and_label.strip().split()
     topic = title_to_uri(title_.strip().replace('_', ' '), category=True)
     label = self._parse_label(label.strip())
     return topic, label
Exemple #4
0
 def parse_line(line):
     title, label = line.strip().split()
     topic = title_to_uri(title.replace('_', ' '), category=True)
     type_ = NodeType.by_name(translate_label[label])
     return topic, type_