1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 """
21 Parser for the ISI format returned by the Web of Knowledge.
22 """
23
24 import logging
25
26 from Pyblio.Parsers.Syntax import ISI
27 from Pyblio import Attribute
28
30
31
32
33
34
35 doctype_mapping = {
36 'J': '@'
37 }
38
39 log = logging.getLogger('pyblio.import.isi')
40
42 self._page_start = None
43
44 - def do_PT(self, line, tag, data):
49
50 - def do_DT(self, line, tag, data):
53
54 - def do_ID(self, line, tag, data):
55
56 for kw in data.split(';'):
57 self.record.add('keyword', kw.strip(), Attribute.Text)
58
59 - def do_AU(self, line, tag, data):
62
63 - def do_TI(self, line, tag, data):
66
67 - def do_UT(self, line, tag, data):
68
69 if ':' in data:
70 source, uid = data.split(':')
71 if source == 'ISI':
72 self.record.add('ut', uid, Attribute.ID)
73
74 - def do_AB(self, line, tag, data):
77
78 - def do_SO(self, line, tag, data):
81
82 - def do_JI(self, line, tag, data):
84 - def do_J9(self, line, tag, data):
86
87 - def do_PY(self, line, tag, data):
90
91 - def do_SE(self, line, tag, data):
94
95 - def do_VL(self, line, tag, data):
98
99 - def do_IS(self, line, tag, data):
102
103 - def do_SN(self, line, tag, data):
106
107 - def do_C1(self, line, tag, data):
110 - def do_RP(self, line, tag, data):
113
114 - def do_BP(self, line, tag, data):
115 self._page_start = data
116 - def do_EP(self, line, tag, data):
117 if self._page_start is not None:
118 if self._page_start == data:
119 page_range = data
120 else:
121 page_range = self._page_start + '-' + data
122 self.record.add('source.pages', page_range, Attribute.Text)
123
129