isi-rb 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +111 -0
- data/README +126 -0
- data/Rakefile +56 -0
- data/bin/isi2bibtex +9 -0
- data/html/classes/ARGF.html +127 -0
- data/html/classes/ARGF.src/M000004.html +53 -0
- data/html/classes/ISI_record.html +182 -0
- data/html/classes/ISI_record.src/M000001.html +19 -0
- data/html/classes/ISI_record.src/M000002.html +42 -0
- data/html/classes/ISI_record.src/M000003.html +34 -0
- data/html/created.rid +1 -0
- data/html/files/README.html +282 -0
- data/html/files/lib/isi_rb.html +132 -0
- data/html/fr_class_index.html +28 -0
- data/html/fr_file_index.html +28 -0
- data/html/fr_method_index.html +30 -0
- data/html/index.html +24 -0
- data/html/rdoc-style.css +208 -0
- data/isi-rb.gemspec +29 -0
- data/lib/isi.rb +201 -0
- data/setup.rb +1585 -0
- data/tests/isi_test.rb +13 -0
- metadata +84 -0
data/ChangeLog
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
2007-04-26 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
2
|
+
|
3
|
+
* ChangeLog: New file.
|
4
|
+
|
5
|
+
2007-04-25 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
6
|
+
|
7
|
+
* isi.rb: version 1.0.6
|
8
|
+
|
9
|
+
* isi.rb: NR
|
10
|
+
|
11
|
+
2006-12-25 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
12
|
+
|
13
|
+
* isi.rb: version 1.0.4
|
14
|
+
|
15
|
+
* isi.rb: Author = {#{fmt(and_separated_authors)}},
|
16
|
+
|
17
|
+
* isi.rb: fmt()
|
18
|
+
|
19
|
+
2006-11-06 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
20
|
+
|
21
|
+
* isi.rb version 1.0.2
|
22
|
+
|
23
|
+
* isi.rb: New tag DI
|
24
|
+
|
25
|
+
2006-08-24 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
26
|
+
|
27
|
+
* isi.rb version 1.0.1
|
28
|
+
|
29
|
+
* isi.rb: URL -> ReprintURL
|
30
|
+
|
31
|
+
2006-08-17 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
32
|
+
|
33
|
+
* isi.rb version 1.0.0
|
34
|
+
|
35
|
+
* isi.rb: def ARGF.read_an_ISI_record
|
36
|
+
# singleton method (instance method associated only with ARGF)
|
37
|
+
|
38
|
+
2006-08-10 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
39
|
+
|
40
|
+
* isi.rb version 0.9b
|
41
|
+
|
42
|
+
* isi.rb: correct link to ((<"Perl version of isi2bibtex in CTAN"|URL:http://www.ctan.org/tex-archive/biblio/bibtex/utils/isi2bibtex/>)).
|
43
|
+
|
44
|
+
2006-04-24 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
45
|
+
|
46
|
+
* isi.rb version 0.9a
|
47
|
+
|
48
|
+
* isi.rb: correct link to ((<"Text::Format"|URL:http://rubyforge.org/projects/text-format/>))
|
49
|
+
|
50
|
+
2006-02-23 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
51
|
+
|
52
|
+
* isi.rb: version 0.9
|
53
|
+
|
54
|
+
* isi.rb: # F The number of Author(s) 1:1, 2:not 1 (default)
|
55
|
+
|
56
|
+
* isi.rb: ji2journal
|
57
|
+
|
58
|
+
* isi.rb: PRB, PRL, etc.
|
59
|
+
|
60
|
+
2005-04-13 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
61
|
+
|
62
|
+
* isi.rb: version 0.8 is announced at fj.sources, fj.comp.lang.ruby and fj.comp.texhax.
|
63
|
+
|
64
|
+
* isi.rb: ISI_record#to_tohoku_DB(id, name)
|
65
|
+
|
66
|
+
* isi.rb: <--- isi2bibtex.rb
|
67
|
+
|
68
|
+
2005-03-30 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
69
|
+
|
70
|
+
* isi2bibtex.rb: version 0.7
|
71
|
+
|
72
|
+
* isi2bibtex.rb: tag LA
|
73
|
+
|
74
|
+
2004-06-18 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
75
|
+
|
76
|
+
* isi2bibtex.rb: ISI_record#fmt()
|
77
|
+
|
78
|
+
* isi2bibtex.rb: version 0.6 is released!
|
79
|
+
|
80
|
+
2004-06-17 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
81
|
+
|
82
|
+
* isi2bibtex.rb: version 0.5 is released!
|
83
|
+
|
84
|
+
* isi2bibtex.rb: require ((<"Text::Format"|URL:http://rubyforge.org/projects/text-format/>))
|
85
|
+
by Austin Ziegler.
|
86
|
+
|
87
|
+
* isi2bibtex.rb: Title, Keywords, NewKeywords, and Abstract are nicely
|
88
|
+
formated into fixed-width.
|
89
|
+
|
90
|
+
2004-06-09 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
91
|
+
|
92
|
+
* isi2bibtex.rb: version 0.4
|
93
|
+
|
94
|
+
* isi2bibtex.rb: simplified.
|
95
|
+
|
96
|
+
* isi2bibtex.rb: tags are sorted.
|
97
|
+
|
98
|
+
* isi2bibtex.rb: Reports "Filename:LineNumber: ..." when unknown tags are found.
|
99
|
+
|
100
|
+
2004-06-07 NISHIMATSU Takeshi <takeshi@physics.rutgers.edu>
|
101
|
+
|
102
|
+
* isi2bibtex.rb: version 0.3 is released!
|
103
|
+
|
104
|
+
* isi2bibtex.rb: Format of ref_name is changed to author:[authors:]journal:volume:page:year.
|
105
|
+
|
106
|
+
* isi2bibtex.rb: Names of authors such like "de Haas, WJ" and "van Alphen, PM"
|
107
|
+
are now available.
|
108
|
+
|
109
|
+
* isi2bibtex.rb: AR tag (article number of new APS journals) is now available.
|
110
|
+
|
111
|
+
* isi2bibtex.rb: It is O.K. in the case of "BP art. no., EP 125111".
|
data/README
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
= isi-rb
|
2
|
+
|
3
|
+
== What is isi-rb?
|
4
|
+
isi-rb converts ISI Export Format to BibTeX Format.
|
5
|
+
This is a Ruby script. You can use isi-rb as a library.
|
6
|
+
|
7
|
+
ISI Web of Science, http://portal.isiknowledge.com,
|
8
|
+
provides their bibliographic information in ISI Export Format.
|
9
|
+
You can get the tagged Marked List in Web of Science by
|
10
|
+
pushing the [SAVE TO FILE] button.
|
11
|
+
|
12
|
+
== Where is the homepage of isi-rb?
|
13
|
+
http://isi-rb.rubyforge.org
|
14
|
+
|
15
|
+
== Where can I download isi-rb?
|
16
|
+
Go to http://rubyforge.org/projects/isi-rb .
|
17
|
+
|
18
|
+
== How can I install isi-rb?
|
19
|
+
There are three different ways to install isi.rb.
|
20
|
+
=== I. Simple way
|
21
|
+
Installing this package is as simple as:
|
22
|
+
$ ruby setup.rb
|
23
|
+
=== II. RubyGems users can take an easy way
|
24
|
+
There is an easier way, if you are a RubyGems user:
|
25
|
+
$ gem install isi-rb
|
26
|
+
=== III. Another simple way; just copy isi.rb
|
27
|
+
Just copy isi.rb into your working directory which contains
|
28
|
+
your saved "Marked List", e.g. savedrecs.txt.
|
29
|
+
$ cp lib/isi.rb ~/your/working/directory/
|
30
|
+
$ cd ~/your/working/directory/
|
31
|
+
$ ruby isi.rb savedrecs1.txt savedrecs2.txt
|
32
|
+
$ ruby isi.rb < savedrecs.txt > savedrecs.bib
|
33
|
+
Lsat two lines are examples of usage for this installation way.
|
34
|
+
|
35
|
+
== How can I use it?
|
36
|
+
=== Save the marked records to an output file in ISI Web of Science
|
37
|
+
Mark the articles in ISI Web of Science. Then, view and save the
|
38
|
+
marked records to an output file (savedrecs.txt). I recommend to
|
39
|
+
check "Author(s)", "Title", "Source", "abstract*", "keywords" and
|
40
|
+
"source abbreviation" as the fields to include in the output file.
|
41
|
+
=== Here are some examples
|
42
|
+
% isi2bibtex savedrecs.txt
|
43
|
+
% isi2bibtex savedrecs1.txt savedrecs2.txt > savedrecs.bib
|
44
|
+
% isi2bibtex < savedrecs.txt > savedrecs.bib
|
45
|
+
% cat savedrecs.txt | isi2bibtex > savedrecs.bib
|
46
|
+
=== You can use isi-rb as a library.
|
47
|
+
T.B.A.
|
48
|
+
|
49
|
+
== Copying
|
50
|
+
isi-rb is distributed in the hope that
|
51
|
+
it will be useful, but WITHOUT ANY WARRANTY.
|
52
|
+
You can copy, modify and redistribute isi-rb,
|
53
|
+
but only under the conditions described in
|
54
|
+
the GNU General Public License (the "GPL").
|
55
|
+
|
56
|
+
== Thanks to contributer(s)!
|
57
|
+
* Marcin Dulak
|
58
|
+
|
59
|
+
== Who is the author?
|
60
|
+
NISHIMATSU Takeshi <t-nissie{at}imr.tohoku.ac.jp>
|
61
|
+
|
62
|
+
== Why did he write it?
|
63
|
+
Because he do not like the output format of the Perl version.
|
64
|
+
|
65
|
+
== Is there a Perl version?
|
66
|
+
Yes.
|
67
|
+
You can find the Perl version by Jonathan Swinton, Ben Bolker, Anthony Stone, John J. Lee
|
68
|
+
in CTAN http://www.ctan.org/tex-archive/biblio/bibtex/utils/isi2bibtex .
|
69
|
+
|
70
|
+
== I do not like the output format of isi-rb, neither!
|
71
|
+
The output format is defined in the source code WYSIWYGly.
|
72
|
+
So you can change by yourself easily.
|
73
|
+
|
74
|
+
== Meanings of tags in ISI Export Format:
|
75
|
+
See http://isibasic.com/help/helpprn.html .
|
76
|
+
=== file-unique tags
|
77
|
+
FN: File type. The file starts with 'FN ISI Export Format'
|
78
|
+
VR: Version number of ISI export file format
|
79
|
+
EF: End of file
|
80
|
+
=== normal tags
|
81
|
+
AB: Abstract
|
82
|
+
AF: Authors Full (AU Foo, BAR -> AF Foo, B. A. R.; AU Nishimatsu, T -> AF Nishimatsu Takeshi)
|
83
|
+
AR: Article number of new APS journals
|
84
|
+
AU: Authors
|
85
|
+
BP: Beginning page
|
86
|
+
C1: Research addresses
|
87
|
+
CR: Cited references
|
88
|
+
DE: Original keywords
|
89
|
+
DI: DOI
|
90
|
+
DT: Document type
|
91
|
+
EP: Ending page
|
92
|
+
ER: end of a record
|
93
|
+
GA: ISI document delivery number
|
94
|
+
ID: New keywords given by ISI
|
95
|
+
IS: issue
|
96
|
+
J9: 29-character journal title abbreviation
|
97
|
+
JI: ISO journal title abbreviation
|
98
|
+
LA: Language
|
99
|
+
NR: Cited reference count
|
100
|
+
PD: Publication date e.g. "JUN 8" or "JUL"
|
101
|
+
PG: the number of pages
|
102
|
+
PI: Publisher city
|
103
|
+
PN: Part number
|
104
|
+
PT: Publication type (e.g., book, journal, book in series)
|
105
|
+
PU: Publisher
|
106
|
+
PY: Publication year
|
107
|
+
RP: Reprint address
|
108
|
+
SE: Book series title
|
109
|
+
SI: Special issue
|
110
|
+
SN: ISSN
|
111
|
+
SO: journal title, in full
|
112
|
+
SU: Supplement
|
113
|
+
TC: Times cited
|
114
|
+
TI: Title
|
115
|
+
UT: ISI unique article identifier
|
116
|
+
VL: Volume
|
117
|
+
WP: Publisher web address
|
118
|
+
=== isi-rb original tags
|
119
|
+
UR: URL
|
120
|
+
|
121
|
+
== Known bugs
|
122
|
+
* none.
|
123
|
+
|
124
|
+
== TODO
|
125
|
+
* Write papers, not tools for writing papers.
|
126
|
+
* tests/isi_test.rb
|
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#! /usr/bin/env rake
|
2
|
+
# -*-Ruby-*-
|
3
|
+
# Time-stamp: <2007-04-28 18:58:58 t-nissie>
|
4
|
+
# Author: Takeshi Nishimatsu
|
5
|
+
##
|
6
|
+
$LOAD_PATH.unshift('lib')
|
7
|
+
|
8
|
+
require 'rubygems'
|
9
|
+
require 'rake/gempackagetask'
|
10
|
+
require 'rake/testtask'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
require 'rake/contrib/rubyforgepublisher'
|
13
|
+
require 'isi.rb'
|
14
|
+
require 'archive/tar/minitar'
|
15
|
+
require 'zlib'
|
16
|
+
|
17
|
+
spec = eval(File.read("isi-rb.gemspec"))
|
18
|
+
spec.version = ISI_RB_VERSION
|
19
|
+
RDOC_OPTS = %w(--title isi-rb --main README --line-numbers)
|
20
|
+
spec.rdoc_options = RDOC_OPTS
|
21
|
+
|
22
|
+
desc "Build the RubyGem for isi-rb"
|
23
|
+
task :gem => [ :test ]
|
24
|
+
Rake::GemPackageTask.new(spec) do |g|
|
25
|
+
g.need_tar = true
|
26
|
+
g.need_zip = true
|
27
|
+
g.package_dir = ".."
|
28
|
+
end
|
29
|
+
|
30
|
+
task :default => [ :test ]
|
31
|
+
|
32
|
+
desc "Run the unit and functional tests"
|
33
|
+
task :test
|
34
|
+
Rake::TestTask.new do |t|
|
35
|
+
t.test_files = FileList['tests/*.rb']
|
36
|
+
t.verbose = true
|
37
|
+
end
|
38
|
+
|
39
|
+
Rake::RDocTask.new do |rdoc|
|
40
|
+
rdoc.rdoc_dir = 'html'
|
41
|
+
rdoc.options = RDOC_OPTS
|
42
|
+
if ENV['DOC_FILES']
|
43
|
+
rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
|
44
|
+
else
|
45
|
+
rdoc.rdoc_files.include('README')
|
46
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
desc "Build Packages"
|
51
|
+
task :package => [ :rdoc ]
|
52
|
+
|
53
|
+
desc "Publish to RubyForge"
|
54
|
+
task :rubyforge => [ :package ] do
|
55
|
+
Rake::RubyForgePublisher.new('isi-rb', 't-nissie').upload
|
56
|
+
end
|
data/bin/isi2bibtex
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: ARGF</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">ARGF</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
<div id="method-list">
|
76
|
+
<h3 class="section-bar">Methods</h3>
|
77
|
+
|
78
|
+
<div class="name-list">
|
79
|
+
<a href="#M000004">read_an_ISI_record</a>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
<!-- if includes -->
|
87
|
+
|
88
|
+
<div id="section">
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if method_list -->
|
98
|
+
<div id="methods">
|
99
|
+
<h3 class="section-bar">Public Class methods</h3>
|
100
|
+
|
101
|
+
<div id="method-M000004" class="method-detail">
|
102
|
+
<a name="M000004"></a>
|
103
|
+
|
104
|
+
<div class="method-heading">
|
105
|
+
<a href="ARGF.src/M000004.html" target="Code" class="method-signature"
|
106
|
+
onclick="popupCode('ARGF.src/M000004.html');return false;">
|
107
|
+
<span class="method-name">read_an_ISI_record</span><span class="method-args">()</span>
|
108
|
+
</a>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div class="method-description">
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
<div id="validator-badges">
|
123
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
</body>
|
127
|
+
</html>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>read_an_ISI_record (ARGF)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/isi.rb, line 157</span>
|
14
|
+
157: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">ARGF</span>.<span class="ruby-identifier">read_an_ISI_record</span>
|
15
|
+
158: <span class="ruby-comment cmt"># singleton method (instance method associated only with ARGF)</span>
|
16
|
+
159: <span class="ruby-identifier">hash</span> = {}
|
17
|
+
160: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">line</span> = <span class="ruby-identifier">gets</span>
|
18
|
+
161: <span class="ruby-comment cmt">#===== a few special cases</span>
|
19
|
+
162: <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
|
+
163: <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
|
+
164: <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
|
+
165: <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
|
+
166: <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
|
+
167: <span class="ruby-identifier">line</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">gets</span>
|
25
|
+
168: <span class="ruby-keyword kw">end</span>
|
26
|
+
169: <span class="ruby-comment cmt">#===== Normal tags</span>
|
27
|
+
170: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">line</span>
|
28
|
+
171: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^(AU|AF) /</span>
|
29
|
+
172: <span class="ruby-identifier">tag</span> = <span class="ruby-identifier">$1</span>
|
30
|
+
173: <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) /</span>,<span class="ruby-value str">''</span>)]
|
31
|
+
174: <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
|
+
175: <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
|
+
176: <span class="ruby-keyword kw">end</span>
|
34
|
+
177: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">tag</span>] = <span class="ruby-identifier">authors</span>
|
35
|
+
178: <span class="ruby-keyword kw">redo</span>
|
36
|
+
179: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^(NR|PG|PY|TC) (.*)$/</span>
|
37
|
+
180: <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
|
+
181: <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) (.*)$/</span>
|
39
|
+
182: <span class="ruby-identifier">tag</span> = <span class="ruby-identifier">$1</span>
|
40
|
+
183: <span class="ruby-identifier">str</span> = <span class="ruby-identifier">$2</span>
|
41
|
+
184: <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
|
+
185: <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
|
+
186: <span class="ruby-keyword kw">end</span>
|
44
|
+
187: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">tag</span>] = <span class="ruby-identifier">str</span>
|
45
|
+
188: <span class="ruby-keyword kw">redo</span>
|
46
|
+
189: <span class="ruby-keyword kw">else</span>
|
47
|
+
190: <span class="ruby-constant">STDERR</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{$FILENAME}:#{file.lineno}: Unknown tag: #{line}"</span>
|
48
|
+
191: <span class="ruby-keyword kw">end</span>
|
49
|
+
192: <span class="ruby-keyword kw">end</span>
|
50
|
+
193: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
51
|
+
194: <span class="ruby-keyword kw">end</span></pre>
|
52
|
+
</body>
|
53
|
+
</html>
|