traject 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -4
- data/lib/traject/indexer.rb +11 -0
- data/lib/traject/version.rb +1 -1
- data/test/indexer/macros_marc21_test.rb +0 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -14,10 +14,11 @@ Based on both the successes and failures of previous MARC indexing attempts -- i
|
|
14
14
|
Traject aims to:
|
15
15
|
|
16
16
|
* Be simple and straightforward for simple use cases, hopefully being accessible even to non-rubyists, although it's in ruby
|
17
|
-
* Be composed of modular and re-composible elements, to provide flexibility for non-common use cases. You should be able to
|
17
|
+
* Be composed of modular and re-composible elements, to provide flexibility for non-common use cases. You should be able to
|
18
18
|
do your own thing wherever you want, without having to give up
|
19
|
-
the already implemented parts you still do want, mixing and matching at
|
20
|
-
*
|
19
|
+
the already implemented parts you still do want, mixing and matching at will.
|
20
|
+
* Easily support re-use and sharing of mapping rules, within an installation and between organizations.
|
21
|
+
* Have a parsimonious or 'elegant' internal architecture, only a few architectural concepts to understand that everything else is built on, to hopefully make the internals easy to work with and maintain.
|
21
22
|
|
22
23
|
|
23
24
|
## Installation
|
@@ -330,7 +331,7 @@ and/or extra files in ./docs -- as appropriate for what needs to be docs.
|
|
330
331
|
* Reading Marc8. It can't do it yet. Easiest way would be using Marc4j to read, or using it as a transcoder anyway. Don't really want to write marc8 transcoder in ruby.
|
331
332
|
|
332
333
|
* We need something like `to_field`, but without actually being
|
333
|
-
for mapping to a specific output field. For generic pre or post-processing, or multi-output-field logic. `before_record do &block`, `after_record do &block` , `on_each_record do &block`, one or more of those.
|
334
|
+
for mapping to a specific output field. For generic pre or post-processing, or multi-output-field logic. `before_record do &block`, `after_record do &block` , `on_each_record do &block`, one or more of those.
|
334
335
|
|
335
336
|
* Unicode normalization. Has to normalize to NFKC on way out to index. Except for serialized marc field and other exceptions? Except maybe don't have to, rely on solr analyzer to do it?
|
336
337
|
|
data/lib/traject/indexer.rb
CHANGED
@@ -5,6 +5,9 @@ require 'traject/qualified_const_get'
|
|
5
5
|
require 'traject/marc_reader'
|
6
6
|
require 'traject/json_writer'
|
7
7
|
require 'traject/solrj_writer'
|
8
|
+
|
9
|
+
require 'traject/macros/marc21'
|
10
|
+
require 'traject/macros/basic'
|
8
11
|
#
|
9
12
|
# == Readers and Writers
|
10
13
|
#
|
@@ -44,6 +47,14 @@ class Traject::Indexer
|
|
44
47
|
|
45
48
|
attr_writer :reader_class, :writer_class
|
46
49
|
|
50
|
+
# For now we hard-code these basic macro's included
|
51
|
+
# TODO, make these added with extend per-indexer,
|
52
|
+
# added by default but easily turned off (or have other
|
53
|
+
# default macro modules provided)
|
54
|
+
include Traject::Macros::Marc21
|
55
|
+
include Traject::Macros::Basic
|
56
|
+
|
57
|
+
|
47
58
|
def initialize
|
48
59
|
@settings = Settings.new(self.class.default_settings)
|
49
60
|
@index_steps = []
|
data/lib/traject/version.rb
CHANGED