isi 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +24 -4
- data/bin/isi2kakenhi +35 -0
- data/bin/isi2timescited +36 -0
- data/bin/isi2tohoku +38 -0
- data/html/classes/ARGF.src/M000004.html +39 -39
- data/html/classes/ISI_record.html +1 -1
- data/html/classes/ISI_record.src/M000002.html +2 -2
- data/html/created.rid +1 -1
- data/html/files/README.html +45 -5
- data/html/files/lib/isi_rb.html +4 -4
- data/isi.gemspec +2 -2
- data/lib/isi.rb +37 -4
- metadata +5 -2
data/README
CHANGED
@@ -23,9 +23,15 @@ isi-X.Y.Z.tgz package can be installed as:
|
|
23
23
|
$ cd isi-X.Y.Z
|
24
24
|
$ su
|
25
25
|
# ruby setup.rb
|
26
|
+
Note that the text-format library (http://rubyforge.org/projects/text-format) is required.
|
26
27
|
=== II. RubyGems users can take an easy way
|
27
28
|
There is an easy way, if you are a RubyGems user:
|
28
|
-
$
|
29
|
+
$ su
|
30
|
+
# gem install isi
|
31
|
+
If you do not have the text-format library, gem will download and install the library
|
32
|
+
automatically. The gem server is busy sometimes. If you fail in downloading, please
|
33
|
+
try again.
|
34
|
+
|
29
35
|
=== III. Simple way; just copy isi.rb
|
30
36
|
Just copy lib/isi.rb (isi-X.Y.Z.rb) into your working directory which contains
|
31
37
|
your saved "Marked List", e.g. savedrecs.txt.
|
@@ -36,19 +42,33 @@ your saved "Marked List", e.g. savedrecs.txt.
|
|
36
42
|
$ ruby isi.rb < savedrecs.txt > savedrecs.bib
|
37
43
|
Last two lines are examples of usage for this installation way.
|
38
44
|
|
39
|
-
Note that
|
45
|
+
Note that the text-format library (http://rubyforge.org/projects/text-format) is required.
|
40
46
|
|
41
47
|
== How can I use it?
|
42
48
|
=== Save the marked records to an output file in ISI Web of Science
|
43
49
|
Mark the articles in ISI Web of Science. Then, view and save the
|
44
50
|
marked records to an output file (savedrecs.txt). I recommend to
|
45
|
-
check "Author(s)", "Title", "Source", "abstract*", "keywords"
|
46
|
-
"source abbreviation" as the fields to include
|
51
|
+
check "Author(s)", "Title", "Source", "abstract*", "keywords",
|
52
|
+
"times cited" and "source abbreviation" as the fields to include
|
53
|
+
in the output file.
|
47
54
|
=== Here are some examples
|
48
55
|
$ isi2bibtex savedrecs.txt
|
49
56
|
$ isi2bibtex savedrecs1.txt savedrecs2.txt > savedrecs.bib
|
50
57
|
$ isi2bibtex < savedrecs.txt > savedrecs.bib
|
51
58
|
$ cat savedrecs.txt | isi2bibtex > savedrecs.bib
|
59
|
+
=== Some other useful executables
|
60
|
+
For KakenhiLaTeX http://osksn2.hep.sci.osaka-u.ac.jp/~taku/kakenhiLaTeX/
|
61
|
+
$ isi2kakenhi --help
|
62
|
+
$ isi2kakenhi --name-regexp='(H\. Yukawa|Hideki Yukawa)' savedrecs.txt > papers.tex
|
63
|
+
For the database of "Academic Research Staff at Tohoku University" http://db.tohoku.ac.jp/whois/TunvTopE.html
|
64
|
+
$ isi2tohoku --help
|
65
|
+
$ isi2tohoku --id 12345678 --name 'Example Name' savedrecs.txt
|
66
|
+
For summing the number of times cited
|
67
|
+
$ isi2timescited MyAllPapers.isi
|
68
|
+
1997 10
|
69
|
+
:
|
70
|
+
2007 0
|
71
|
+
total 88
|
52
72
|
=== You can use isi as a library.
|
53
73
|
Here is an example:
|
54
74
|
#!/usr/bin/env ruby
|
data/bin/isi2kakenhi
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# isi2kakenhi -*-Ruby-*-
|
3
|
+
# Time-stamp: <2007-10-11 20:46:11 takeshi>
|
4
|
+
# Description: isi2kakenhi is an ISI Export Format to KakenhiLaTeX Format converter.
|
5
|
+
# Project homepage: http://isi-rb.rubyforge.org/
|
6
|
+
# KakenhiLaTeX homepage: http://osksn2.hep.sci.osaka-u.ac.jp/~taku/kakenhiLaTeX/
|
7
|
+
# Usage: isi2kakenhi --name-regexp='(H\. Yukawa|Hideki Yukawa)' savedrecs.txt > papers.tex
|
8
|
+
# Author: Takeshi Nishimatsu
|
9
|
+
##
|
10
|
+
require "isi"
|
11
|
+
require "optparse"
|
12
|
+
|
13
|
+
class ISI_record
|
14
|
+
def to_kakenhi(name_regexp)
|
15
|
+
"\\item \"#{@hash['TI']}\",
|
16
|
+
#{fmt(comma_and_separated_authors.sub(name_regexp,'\underline{\1}'))},
|
17
|
+
#{ji2journal} {\\bf #{@hash['VL']}}, #{pages} (#{@hash['PY']}).\n"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
name_regexp=/(T\. Nishimatsu|Takeshi Nishimatsu)/
|
22
|
+
|
23
|
+
opts = OptionParser.new
|
24
|
+
def opts.usage
|
25
|
+
return to_s.sub(/options/,'options] [filename(s)')
|
26
|
+
end
|
27
|
+
opts.on("-n YOUR_NAME","--name-regexp YOUR_NAME_REGEXP",
|
28
|
+
"Regular expression of your name. Example: --name-regexp='(H\\. Yukawa|Hideki Yukawa)'"){|v| name_regexp=Regexp.new(v)}
|
29
|
+
opts.on_tail("-h", "--help", "Show this message"){puts opts.usage; exit}
|
30
|
+
|
31
|
+
opts.parse!(ARGV)
|
32
|
+
|
33
|
+
while rec = ARGF.read_an_ISI_record
|
34
|
+
print rec.to_kakenhi(name_regexp)
|
35
|
+
end
|
data/bin/isi2timescited
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# isi2timescited -*-Ruby-*-
|
3
|
+
# Time-stamp: <2007-08-26 12:50:04 takeshi>
|
4
|
+
# Author: Takeshi Nishimatsu
|
5
|
+
# Usage: isi2timescited MyAllPapers.isi
|
6
|
+
##
|
7
|
+
require "isi"
|
8
|
+
require "date"
|
9
|
+
|
10
|
+
class ISI_record
|
11
|
+
public
|
12
|
+
def citation_profile(times_cited_per_year)
|
13
|
+
times_cited_per_year[@hash['PY']] += @hash['TC']
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
tcpy = Array.new(2100,0)
|
18
|
+
|
19
|
+
while rec = ARGF.read_an_ISI_record
|
20
|
+
rec.citation_profile(tcpy)
|
21
|
+
end
|
22
|
+
|
23
|
+
flag=false
|
24
|
+
total=0
|
25
|
+
(1950..Date.today.year).each do |y|
|
26
|
+
if flag or tcpy[y]>0
|
27
|
+
flag=true
|
28
|
+
printf("%4i %5i\n", y, tcpy[y])
|
29
|
+
total += tcpy[y]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
printf("total%5i\n", total)
|
33
|
+
|
34
|
+
#Local variables:
|
35
|
+
# compile-command: "ruby -r 'rubygems' isi2timescited /home/takeshi/references/isi/TakeshiNishimatsuAll.isi"
|
36
|
+
#End:
|
data/bin/isi2tohoku
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# isi2tohoku -*-Ruby-*-
|
3
|
+
# It may be useful for adding your record to the database of academic
|
4
|
+
# research staff at Tohoku University, http://db.tohoku.ac.jp/whois/ .
|
5
|
+
# Time-stamp: <2007-08-26 13:06:50 takeshi>
|
6
|
+
# Author: Takeshi Nishimatsu
|
7
|
+
# Usage: isi2tohoku --id 12345678 --name 'Example Name' savedrecs.txt
|
8
|
+
##
|
9
|
+
require "isi"
|
10
|
+
require "optparse"
|
11
|
+
|
12
|
+
tohoku_id = 0
|
13
|
+
name = ENV['USER'] || ENV['LOGNAME'] || Etc.getlogin || Etc.getpwuid.name
|
14
|
+
|
15
|
+
opts = OptionParser.new
|
16
|
+
def opts.usage
|
17
|
+
return to_s.sub(/options/,'options] [filename(s)')
|
18
|
+
end
|
19
|
+
opts.on("-i YOUR_ID","--id YOUR_ID",
|
20
|
+
Integer, "Specify your 8-digit ID number"){|v| tohoku_id=v}
|
21
|
+
opts.on("-n YOUR_NAME","--name YOUR_NAME","Specify your name"){|v| name=v}
|
22
|
+
opts.on_tail("-h", "--help", "Show this message"){puts opts.usage; exit}
|
23
|
+
|
24
|
+
opts.parse!(ARGV)
|
25
|
+
|
26
|
+
if tohoku_id<10000000 or 99999999<tohoku_id
|
27
|
+
STDERR << "#{$0}:#{__LINE__}: You should specify your 8-digit ID number with --id option.\n"
|
28
|
+
STDERR << opts.usage
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
|
32
|
+
while rec = ARGF.read_an_ISI_record
|
33
|
+
print rec.to_tohoku_DB(tohoku_id,name)
|
34
|
+
end
|
35
|
+
|
36
|
+
#Local variables:
|
37
|
+
# compile-command: "ruby -r 'rubygems' isi2tohoku --help"
|
38
|
+
#End:
|
@@ -10,44 +10,44 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/isi.rb, line
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/isi.rb, line 194</span>
|
14
|
+
194: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">ARGF</span>.<span class="ruby-identifier">read_an_ISI_record</span>
|
15
|
+
195: <span class="ruby-comment cmt"># singleton method (instance method associated only with ARGF)</span>
|
16
|
+
196: <span class="ruby-identifier">hash</span> = {}
|
17
|
+
197: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">line</span> = <span class="ruby-identifier">gets</span>
|
18
|
+
198: <span class="ruby-comment cmt">#===== a few special cases</span>
|
19
|
+
199: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ISI_record</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^ER/</span>
|
20
|
+
200: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(EF|FN|VR)/</span> <span class="ruby-comment cmt"># ignore file-unique tags</span>
|
21
|
+
201: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\s*$/</span> <span class="ruby-comment cmt"># ignore blank lines</span>
|
22
|
+
202: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\!$/</span>
|
23
|
+
203: <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp!</span>.<span class="ruby-identifier">chop!</span> <span class="ruby-comment cmt"># continued to next line if the line ends with "!"</span>
|
24
|
+
204: <span class="ruby-identifier">line</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">gets</span>
|
25
|
+
205: <span class="ruby-keyword kw">end</span>
|
26
|
+
206: <span class="ruby-comment cmt">#===== Normal tags</span>
|
27
|
+
207: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">line</span>
|
28
|
+
208: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^(AU|AF|CR) /</span>
|
29
|
+
209: <span class="ruby-identifier">tag</span> = <span class="ruby-identifier">$1</span>
|
30
|
+
210: <span class="ruby-identifier">authors</span> = [<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^(AU|AF|CR) /</span>,<span class="ruby-value str">''</span>)]
|
31
|
+
211: <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">line</span> = <span class="ruby-identifier">gets</span>) <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^ /</span>
|
32
|
+
212: <span class="ruby-identifier">authors</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^ /</span>,<span class="ruby-value str">''</span>))
|
33
|
+
213: <span class="ruby-keyword kw">end</span>
|
34
|
+
214: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">tag</span>] = <span class="ruby-identifier">authors</span>
|
35
|
+
215: <span class="ruby-keyword kw">redo</span>
|
36
|
+
216: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^(NR|PG|PY|TC) (.*)$/</span>
|
37
|
+
217: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">$1</span>] = <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">to_i</span>
|
38
|
+
218: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^(TI|AB|DE|ID|SO|PT|JI|BP|EP|AR|PD|VL|IS|GA|PI|PU|PN|PA|J9|UT|DT|C1|RP|SI|SE|SN|SU|LA|DI|SC) (.*)$/</span>
|
39
|
+
219: <span class="ruby-identifier">tag</span> = <span class="ruby-identifier">$1</span>
|
40
|
+
220: <span class="ruby-identifier">str</span> = <span class="ruby-identifier">$2</span>
|
41
|
+
221: <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">line</span> = <span class="ruby-identifier">gets</span>) <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^ /</span>
|
42
|
+
222: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^ /</span>,<span class="ruby-value str">''</span>)
|
43
|
+
223: <span class="ruby-keyword kw">end</span>
|
44
|
+
224: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">tag</span>] = <span class="ruby-identifier">str</span>
|
45
|
+
225: <span class="ruby-keyword kw">redo</span>
|
46
|
+
226: <span class="ruby-keyword kw">else</span>
|
47
|
+
227: <span class="ruby-constant">STDERR</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{$FILENAME}:#{file.lineno}: Unknown tag: #{line}"</span>
|
48
|
+
228: <span class="ruby-keyword kw">end</span>
|
49
|
+
229: <span class="ruby-keyword kw">end</span>
|
50
|
+
230: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
51
|
+
231: <span class="ruby-keyword kw">end</span></pre>
|
52
52
|
</body>
|
53
53
|
</html>
|
@@ -159,7 +159,7 @@
|
|
159
159
|
<div class="method-heading">
|
160
160
|
<a href="ISI_record.src/M000002.html" target="Code" class="method-signature"
|
161
161
|
onclick="popupCode('ISI_record.src/M000002.html');return false;">
|
162
|
-
<span class="method-name">to_tohoku_DB</span><span class="method-args">(
|
162
|
+
<span class="method-name">to_tohoku_DB</span><span class="method-args">(tohoku_id, name)</span>
|
163
163
|
</a>
|
164
164
|
</div>
|
165
165
|
|
@@ -11,8 +11,8 @@
|
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre> <span class="ruby-comment cmt"># File lib/isi.rb, line 17</span>
|
14
|
-
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_tohoku_DB</span>(<span class="ruby-identifier">
|
15
|
-
18: <span class="ruby-node">"#{
|
14
|
+
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_tohoku_DB</span>(<span class="ruby-identifier">tohoku_id</span>, <span class="ruby-identifier">name</span>)
|
15
|
+
18: <span class="ruby-node">"#{tohoku_id}\t"</span> <span class="ruby-operator">+</span> <span class="ruby-comment cmt"># A ID</span>
|
16
16
|
19: <span class="ruby-node">"#{name}\t"</span> <span class="ruby-operator">+</span> <span class="ruby-comment cmt"># B Name</span>
|
17
17
|
20: <span class="ruby-node">"#{@hash['TI']}\t"</span> <span class="ruby-operator">+</span> <span class="ruby-comment cmt"># C Title</span>
|
18
18
|
21: <span class="ruby-node">"#{@hash['TI']}\t"</span> <span class="ruby-operator">+</span> <span class="ruby-comment cmt"># D Title in English</span>
|
data/html/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Thu, 11 Oct 2007 20:46:40 -0400
|
data/html/files/README.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Thu Oct 11 20:46:00 -0400 2007</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -105,13 +105,24 @@ isi-X.Y.Z.tgz package can be installed as:
|
|
105
105
|
$ su
|
106
106
|
# ruby setup.rb
|
107
107
|
</pre>
|
108
|
+
<p>
|
109
|
+
Note that the text-format library (<a
|
110
|
+
href="http://rubyforge.org/projects/text-format">rubyforge.org/projects/text-format</a>)
|
111
|
+
is required.
|
112
|
+
</p>
|
108
113
|
<h3>II. RubyGems users can take an easy way</h3>
|
109
114
|
<p>
|
110
115
|
There is an easy way, if you are a RubyGems user:
|
111
116
|
</p>
|
112
117
|
<pre>
|
113
|
-
$
|
118
|
+
$ su
|
119
|
+
# gem install isi
|
114
120
|
</pre>
|
121
|
+
<p>
|
122
|
+
If you do not have the text-format library, gem will download and install
|
123
|
+
the library automatically. The gem server is busy sometimes. If you fail in
|
124
|
+
downloading, please try again.
|
125
|
+
</p>
|
115
126
|
<h3>III. Simple way; just copy isi.rb</h3>
|
116
127
|
<p>
|
117
128
|
Just copy lib/isi.rb (isi-X.Y.Z.rb) into your working directory which
|
@@ -128,7 +139,7 @@ contains your saved "Marked List", e.g. savedrecs.txt.
|
|
128
139
|
Last two lines are examples of usage for this installation way.
|
129
140
|
</p>
|
130
141
|
<p>
|
131
|
-
Note that
|
142
|
+
Note that the text-format library (<a
|
132
143
|
href="http://rubyforge.org/projects/text-format">rubyforge.org/projects/text-format</a>)
|
133
144
|
is required.
|
134
145
|
</p>
|
@@ -138,8 +149,9 @@ is required.
|
|
138
149
|
Mark the articles in ISI Web of Science. Then, view and save the marked
|
139
150
|
records to an output file (savedrecs.txt). I recommend to check
|
140
151
|
"Author(s)", "Title", "Source",
|
141
|
-
"abstract*", "keywords"
|
142
|
-
abbreviation" as the fields to include in the output
|
152
|
+
"abstract*", "keywords", "times cited" and
|
153
|
+
"source abbreviation" as the fields to include in the output
|
154
|
+
file.
|
143
155
|
</p>
|
144
156
|
<h3>Here are some examples</h3>
|
145
157
|
<pre>
|
@@ -148,6 +160,34 @@ abbreviation" as the fields to include in the output file.
|
|
148
160
|
$ isi2bibtex < savedrecs.txt > savedrecs.bib
|
149
161
|
$ cat savedrecs.txt | isi2bibtex > savedrecs.bib
|
150
162
|
</pre>
|
163
|
+
<h3>Some other useful executables</h3>
|
164
|
+
<p>
|
165
|
+
For KakenhiLaTeX <a
|
166
|
+
href="http://osksn2.hep.sci.osaka-u.ac.jp/~taku/kakenhiLaTeX">osksn2.hep.sci.osaka-u.ac.jp/~taku/kakenhiLaTeX</a>/
|
167
|
+
</p>
|
168
|
+
<pre>
|
169
|
+
$ isi2kakenhi --help
|
170
|
+
$ isi2kakenhi --name-regexp='(H\. Yukawa|Hideki Yukawa)' savedrecs.txt > papers.tex
|
171
|
+
</pre>
|
172
|
+
<p>
|
173
|
+
For the database of "Academic Research Staff at Tohoku
|
174
|
+
University" <a
|
175
|
+
href="http://db.tohoku.ac.jp/whois/TunvTopE.html">db.tohoku.ac.jp/whois/TunvTopE.html</a>
|
176
|
+
</p>
|
177
|
+
<pre>
|
178
|
+
$ isi2tohoku --help
|
179
|
+
$ isi2tohoku --id 12345678 --name 'Example Name' savedrecs.txt
|
180
|
+
</pre>
|
181
|
+
<p>
|
182
|
+
For summing the number of times cited
|
183
|
+
</p>
|
184
|
+
<pre>
|
185
|
+
$ isi2timescited MyAllPapers.isi
|
186
|
+
1997 10
|
187
|
+
:
|
188
|
+
2007 0
|
189
|
+
total 88
|
190
|
+
</pre>
|
151
191
|
<h3>You can use isi as a library.</h3>
|
152
192
|
<p>
|
153
193
|
Here is an example:
|
data/html/files/lib/isi_rb.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Thu Oct 11 19:46:25 -0400 2007</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
|
71
71
|
<div id="description">
|
72
72
|
<p>
|
73
|
-
Time-stamp: <2007-
|
73
|
+
Time-stamp: <2007-10-11 19:46:25 takeshi> Author: Takeshi Nishimatsu
|
74
74
|
Project homepage: <a
|
75
75
|
href="http://isi-rb.rubyforge.org">isi-rb.rubyforge.org</a>/ Usage: ruby
|
76
76
|
isi.rb savedrecs.txt > savedrecs.bib
|
@@ -105,10 +105,10 @@ isi.rb savedrecs.txt > savedrecs.bib
|
|
105
105
|
<tr class="top-aligned-row context-row">
|
106
106
|
<td class="context-item-name">ISI_RB_VERSION</td>
|
107
107
|
<td>=</td>
|
108
|
-
<td class="context-item-value">'1.1.
|
108
|
+
<td class="context-item-value">'1.1.4'</td>
|
109
109
|
<td width="3em"> </td>
|
110
110
|
<td class="context-item-desc">
|
111
|
-
Time-stamp: <2007-
|
111
|
+
Time-stamp: <2007-10-11 19:46:25 takeshi> Author: Takeshi Nishimatsu
|
112
112
|
Project homepage: <a
|
113
113
|
href="http://isi-rb.rubyforge.org">isi-rb.rubyforge.org</a>/ Usage: ruby
|
114
114
|
isi.rb savedrecs.txt > savedrecs.bib
|
data/isi.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# isi.gemspec -*-ruby-*-
|
2
|
-
# Time-stamp: <2007-
|
2
|
+
# Time-stamp: <2007-10-11 20:08:08 takeshi>
|
3
3
|
##
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.autorequire = 'lib/isi.rb'
|
6
6
|
s.name = 'isi'
|
7
7
|
|
8
8
|
s.bindir = 'bin'
|
9
|
-
s.executables = ['isi2bibtex']
|
9
|
+
s.executables = ['isi2bibtex', 'isi2kakenhi', 'isi2timescited', 'isi2tohoku']
|
10
10
|
s.default_executable= 'isi2bibtex'
|
11
11
|
|
12
12
|
s.summary = 'ISI Export Format to BibTeX Format converter. (Formerly named isi.rb or isi2bibtex.rb.)'
|
data/lib/isi.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# Time-stamp: <2007-
|
2
|
+
# Time-stamp: <2007-10-11 19:46:25 takeshi>
|
3
3
|
# Author: Takeshi Nishimatsu
|
4
4
|
# Project homepage: http://isi-rb.rubyforge.org/
|
5
5
|
# Usage: ruby isi.rb savedrecs.txt > savedrecs.bib
|
6
6
|
##
|
7
|
-
ISI_RB_VERSION = '1.1.
|
7
|
+
ISI_RB_VERSION = '1.1.4'
|
8
8
|
require 'text/format' # http://rubyforge.org/projects/text-format/
|
9
9
|
class ISI_record
|
10
10
|
public
|
@@ -14,8 +14,8 @@ public
|
|
14
14
|
@@order += 1
|
15
15
|
end
|
16
16
|
|
17
|
-
def to_tohoku_DB(
|
18
|
-
"#{
|
17
|
+
def to_tohoku_DB(tohoku_id, name)
|
18
|
+
"#{tohoku_id}\t" + # A ID
|
19
19
|
"#{name}\t" + # B Name
|
20
20
|
"#{@hash['TI']}\t" + # C Title
|
21
21
|
"#{@hash['TI']}\t" + # D Title in English
|
@@ -133,6 +133,39 @@ private
|
|
133
133
|
return au
|
134
134
|
end
|
135
135
|
|
136
|
+
def comma_and_separated_authors(comma_before_and=false)
|
137
|
+
n_authors = (@hash['AF'] || @hash['AU']).size
|
138
|
+
au = ''
|
139
|
+
(@hash['AF'] || @hash['AU']).each_with_index do |name,i|
|
140
|
+
if i>0
|
141
|
+
if n_authors==2
|
142
|
+
au += ' and '
|
143
|
+
elsif i==n_authors-1
|
144
|
+
if comma_before_and
|
145
|
+
au += ', and '
|
146
|
+
else
|
147
|
+
au += ' and '
|
148
|
+
end
|
149
|
+
else
|
150
|
+
au += ', '
|
151
|
+
end
|
152
|
+
end
|
153
|
+
if name =~ /, /
|
154
|
+
family_name = $`
|
155
|
+
initials = $'
|
156
|
+
if @hash['AF']
|
157
|
+
au += initials + ' '
|
158
|
+
else
|
159
|
+
au += initials.scan(/\w/).join(". ") + '. ' # "ABC" -> "A. B. C. "
|
160
|
+
end
|
161
|
+
au += family_name
|
162
|
+
else
|
163
|
+
au += name
|
164
|
+
end
|
165
|
+
end
|
166
|
+
return au
|
167
|
+
end
|
168
|
+
|
136
169
|
def ref_name
|
137
170
|
rn = ''
|
138
171
|
@hash['AU'].each_with_index do |name,i|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: isi
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
7
|
-
date: 2007-
|
6
|
+
version: 1.1.4
|
7
|
+
date: 2007-10-11 00:00:00 -04:00
|
8
8
|
summary: ISI Export Format to BibTeX Format converter. (Formerly named isi.rb or isi2bibtex.rb.)
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -70,6 +70,9 @@ extra_rdoc_files:
|
|
70
70
|
- README
|
71
71
|
executables:
|
72
72
|
- isi2bibtex
|
73
|
+
- isi2kakenhi
|
74
|
+
- isi2timescited
|
75
|
+
- isi2tohoku
|
73
76
|
extensions: []
|
74
77
|
|
75
78
|
requirements: []
|