naconormalizer 0.9.1-java → 1.0.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/naconormalizer.rb +4 -8
- data/lib/naconormalizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 695756555bfd9ce0db0445d90f7852d770ca1491
|
4
|
+
data.tar.gz: 90bf84941f22a8fa2ce5b6d63eaca5ff45577651
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27534fed85f3c6cc1b13c502115ebb8cf3ee24d8be069f8d322929c6035600a8b2aea033209860564334ebabdc25a236335fe59b1d890dab470be6b443d84472
|
7
|
+
data.tar.gz: 7dd3fc83525a47ef0bc4ffb85a3de5b17177c5467d5601506f1d5c711163d5abbbb1e096135e51d22f1989d716144fd5e0cd2146a8ee582b9407a46de354a86a
|
data/README.md
CHANGED
data/lib/naconormalizer.rb
CHANGED
@@ -17,13 +17,11 @@ class NacoNormalizer
|
|
17
17
|
|
18
18
|
OCLCNormalizer = org.oclc.util::NacoNormalize
|
19
19
|
|
20
|
-
Defaults = { :
|
20
|
+
Defaults = { :keep_first_comma => true }
|
21
21
|
|
22
22
|
# Create a new normalizer that will use the passed options (if any)
|
23
23
|
# @param [Hash] opts The hash of options
|
24
|
-
# @option opts [Boolean] :
|
25
|
-
# @option opts [Boolean] :keep_first_comma (true) Keep the first comma, useful for Lastname,Firstname data
|
26
|
-
# @option opts [Boolean] :strip_html (true) Strip any spurious HTML out of the passed string when normalizing
|
24
|
+
# @option opts [Boolean] :keep_first_comma (true) Keep the first comma. Defaults, for Lastname,Firstname name data
|
27
25
|
#
|
28
26
|
# @example
|
29
27
|
# author_normalizer = NacoNormalizer.new
|
@@ -34,16 +32,14 @@ class NacoNormalizer
|
|
34
32
|
|
35
33
|
def initialize(opts={})
|
36
34
|
opts = opts.merge(Defaults)
|
37
|
-
@keep_caps = opts[:keep_caps]
|
38
|
-
@strip_html = opts[:strip_html]
|
39
35
|
@keep_first_comma = opts[:keep_first_comma]
|
40
36
|
end
|
41
37
|
|
42
38
|
# Normalize a string using the options passed to the constructor
|
43
39
|
# @param [String] str The string to normalize
|
44
40
|
# @return [String] The normalized string
|
45
|
-
def normalize(str, keep_first_comma = @keep_first_comma
|
46
|
-
OCLCNormalizer.
|
41
|
+
def normalize(str, keep_first_comma = @keep_first_comma )
|
42
|
+
OCLCNormalizer.nacoNormalize2007(str, keep_first_comma)
|
47
43
|
end
|
48
44
|
|
49
45
|
end
|