change_the_subject 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1512dad6ec282f50dd9891ac10f0304eef7e566f202af7e0b869c0c101d24ffa
4
- data.tar.gz: 602152e6fdad2ec73359bb994bf2f1bc6728311f143d9c20dba20f698eb7b381
3
+ metadata.gz: f6e373737bb3c1301c451f662a9946ef5a6802350b62e5d9b3a6b77a22502677
4
+ data.tar.gz: a02f0e85465c778a9c2b23a34baf994878d98bf7e591fa347c88ddbb7139bf8e
5
5
  SHA512:
6
- metadata.gz: 96a3e99d821468d4e08a528e724ddf8ee8c294db1484c1018990529e38876a864e74f533932aef78ed227994412bbb388c49c8872c155f5f617d935767a0b1d2
7
- data.tar.gz: f3df96cf53476044528c51315603e92345adb03e931b8d5b2d3b0bee1ae69431628cfc80a9a2984e9292af85a203734af1b7bc33f79fd052625f4b1de2e2a5ad
6
+ metadata.gz: e9c1afd0dde80243aad3f0950ccc8b3836bec7f2388a192ce0a3ebaea6d258ac02cdc0eaf8c9b8dfda00ad8e08a72d428bb1b9fdbbdb98f1f59966599a97205a
7
+ data.tar.gz: 8d6d05781d163a4c23bb556ce84b58fd5b013d3f2ef217e7524861e42751a9b91073f3a6784c29037bae07c863a14be4145ab3855cfff536f4794f127d0ea297
data/.circleci/config.yml CHANGED
@@ -36,4 +36,4 @@ workflows:
36
36
  - test:
37
37
  matrix:
38
38
  parameters:
39
- ruby: ["3.1.6", "3.2.6", "3.3.6"]
39
+ ruby: ["3.1.6", "3.2.6", "3.3.6", "3.4.1"]
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ .byebug_history
data/.rubocop.yml CHANGED
@@ -25,3 +25,6 @@ RSpec/MultipleExpectations:
25
25
  Style/StringLiterals:
26
26
  Enabled: true
27
27
  EnforcedStyle: double_quotes
28
+
29
+ Naming/RescuedExceptionsVariableName:
30
+ Enabled: false
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.1.6
1
+ ruby 3.4.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- change_the_subject (0.3.6)
4
+ change_the_subject (0.4.0)
5
5
  yaml
6
6
 
7
7
  GEM
@@ -12,22 +12,24 @@ GEM
12
12
  coderay (1.1.3)
13
13
  diff-lcs (1.5.0)
14
14
  docile (1.4.0)
15
- json (2.6.2)
15
+ json (2.10.1)
16
+ language_server-protocol (3.17.0.4)
17
+ lint_roller (1.1.0)
16
18
  method_source (1.0.0)
17
- parallel (1.22.1)
18
- parser (3.1.2.1)
19
+ parallel (1.26.3)
20
+ parser (3.3.7.1)
19
21
  ast (~> 2.4.1)
22
+ racc
20
23
  pry (0.14.1)
21
24
  coderay (~> 1.1)
22
25
  method_source (~> 1.0)
23
26
  pry-byebug (3.10.1)
24
27
  byebug (~> 11.0)
25
28
  pry (>= 0.13, < 0.15)
29
+ racc (1.8.1)
26
30
  rainbow (3.1.1)
27
31
  rake (13.0.6)
28
- regexp_parser (2.5.0)
29
- rexml (3.2.8)
30
- strscan (>= 3.0.9)
32
+ regexp_parser (2.10.0)
31
33
  rspec (3.11.0)
32
34
  rspec-core (~> 3.11.0)
33
35
  rspec-expectations (~> 3.11.0)
@@ -41,30 +43,32 @@ GEM
41
43
  diff-lcs (>= 1.2.0, < 2.0)
42
44
  rspec-support (~> 3.11.0)
43
45
  rspec-support (3.11.1)
44
- rubocop (1.36.0)
46
+ rubocop (1.72.0)
45
47
  json (~> 2.3)
48
+ language_server-protocol (~> 3.17.0.2)
49
+ lint_roller (~> 1.1.0)
46
50
  parallel (~> 1.10)
47
- parser (>= 3.1.2.1)
51
+ parser (>= 3.3.0.2)
48
52
  rainbow (>= 2.2.2, < 4.0)
49
- regexp_parser (>= 1.8, < 3.0)
50
- rexml (>= 3.2.5, < 4.0)
51
- rubocop-ast (>= 1.20.1, < 2.0)
53
+ regexp_parser (>= 2.9.3, < 3.0)
54
+ rubocop-ast (>= 1.38.0, < 2.0)
52
55
  ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 3.0)
54
- rubocop-ast (1.21.0)
55
- parser (>= 3.1.1.0)
56
+ unicode-display_width (>= 2.4.0, < 4.0)
57
+ rubocop-ast (1.38.0)
58
+ parser (>= 3.3.1.0)
56
59
  rubocop-rspec (2.13.1)
57
60
  rubocop (~> 1.33)
58
- ruby-progressbar (1.11.0)
61
+ ruby-progressbar (1.13.0)
59
62
  simplecov (0.21.2)
60
63
  docile (~> 1.1)
61
64
  simplecov-html (~> 0.11)
62
65
  simplecov_json_formatter (~> 0.1)
63
66
  simplecov-html (0.12.3)
64
67
  simplecov_json_formatter (0.1.4)
65
- strscan (3.1.0)
66
- unicode-display_width (2.3.0)
67
- yaml (0.2.1)
68
+ unicode-display_width (3.1.4)
69
+ unicode-emoji (~> 4.0, >= 4.0.4)
70
+ unicode-emoji (4.0.4)
71
+ yaml (0.4.0)
68
72
 
69
73
  PLATFORMS
70
74
  arm64-darwin-21
@@ -77,7 +81,7 @@ DEPENDENCIES
77
81
  pry-byebug
78
82
  rake (~> 13.0)
79
83
  rspec (~> 3.0)
80
- rubocop (= 1.36)
84
+ rubocop (= 1.72)
81
85
  rubocop-rspec
82
86
  simplecov
83
87
 
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_development_dependency "rake", "~> 13.0"
32
32
  spec.add_development_dependency "rspec", "~> 3.0"
33
- spec.add_development_dependency "rubocop", "1.36"
33
+ spec.add_development_dependency "rubocop", "1.72"
34
34
  spec.add_development_dependency "rubocop-rspec"
35
35
  spec.add_development_dependency "simplecov"
36
36
  end
@@ -1,112 +1,113 @@
1
- "Illegal aliens":
2
- replacement: "Undocumented immigrants"
3
- rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
4
- "Women illegal aliens":
5
- replacement: "Women undocumented immigrants"
6
- rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
7
- "Illegal aliens in literature":
8
- replacement: "Undocumented immigrants in literature"
9
- rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
10
- "Children of illegal aliens":
11
- replacement: "Children of undocumented immigrants"
12
- rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
13
- "Illegal alien children":
14
- replacement: "Undocumented immigrant children"
15
- rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
16
- "Illegal immigration":
17
- replacement: "Undocumented immigrants"
18
- rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
19
- "Illegal immigration in literature":
20
- replacement: "Undocumented immigrants in literature"
21
- rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
22
- "Alien criminals":
23
- replacement: "Noncitizen criminals"
24
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
25
- "Aliens":
26
- replacement: "Noncitizens"
27
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
28
- "Aliens in art":
29
- replacement: "Noncitizens in art"
30
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
31
- "Aliens in literature":
32
- replacement: "Noncitizens in literature"
33
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
34
- "Aliens in mass media":
35
- replacement: "Noncitizens in mass media"
36
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
37
- "Church work with aliens":
38
- replacement: "Church work with noncitizens"
39
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
40
- "Officials and employees, Alien":
41
- replacement: "Officials and employees, Noncitizen"
42
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
43
- "Aliens (Greek law)":
44
- replacement: "Noncitizens (Greek law)"
45
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
46
- "Aliens (Roman law)":
47
- replacement: "Noncitizens (Roman law)"
48
- rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
49
- "Child slaves":
50
- replacement: "Enslaved children"
51
- rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources."
52
- "Indian slaves":
53
- replacement: "Enslaved Indigenous peoples"
54
- rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help.\" Capitalization of \"Indigenous\" appears to be preferred by those from Indigenous communities, for example see https://www.lib.sfu.ca/about/branches-depts/slc/writing/inclusive-antiracist-writing/bipoc and https://www.ictinc.ca/blog/indigenous-peoples-terminology-guidelines-for-usage. As this is a broad term, when possible, one should include the name of the community(ies) or nation(s) of the people in the record. "
55
- "Older slaves":
56
- replacement: "Enslaved older people"
57
- rationale: "The use of \"enslaved\" falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources. \"Older people\" is the current LC preferred term: https://id.loc.gov/search/?q=memberOf:http://id.loc.gov/authorities/demographicTerms/collection_LCDGT_Age. "
58
- "Slaves":
59
- replacement: "Enslaved persons"
60
- rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources."
61
- "Women slaves":
62
- replacement: "Enslaved women"
63
- rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources."
64
- "East Indians":
65
- replacement: "Indians (India)"
66
- rationale: "\"East Indians\" is anachronistic and confusing to researchers. \"East\" is not used with \"Indians\" by the people who live in India, people who once lived in India, or even by the former colonizers of India at this point in time."
67
- "Indians":
68
- replacement: "Indigenous peoples of the Western Hemisphere"
69
- rationale: "Using the scope note from the LCSH term, rather than the term \"Indians,\" is more accurate and less offensive for so many people under this large geographical umbrella."
70
- "Indians of Central America":
71
- replacement: "Indigenous peoples of Central America"
72
- rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
73
- "Indians of Mexico":
74
- replacement: "Indigenous peoples of Mexico"
75
- rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
76
- "Indians of North America":
77
- replacement: "Indigenous peoples of North America"
78
- rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
79
- "Indians of South America":
80
- replacement: "Indigenous peoples of South America"
81
- rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
82
- "Indians of the West Indies":
83
- replacement: "Indigenous peoples of the West Indies"
84
- rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
85
- "Gender identity disorders":
86
- replacement: "Gender dysphoria"
87
- rationale: '"Gender identity disorder" was removed from the DSM -- the primary diagnostic manual used by psychiatric and psychological professionals in the U.S. -- nearly a decade ago, and replaced with "Gender dysphoria."'
88
- "Gender identity disorders in children":
89
- replacement: "Gender dysphoria in children"
90
- rationale: '"Gender identity disorder" was removed from the DSM -- the primary diagnostic manual used by psychiatric and psychological professionals in the U.S. -- nearly a decade ago, and replaced with "Gender dysphoria."'
91
- "Gender identity disorders in adolescence":
92
- replacement: "Gender dysphoria in adolescence"
93
- rationale: '"Gender identity disorder" was removed from the DSM -- the primary diagnostic manual used by psychiatric and psychological professionals in the U.S. -- nearly a decade ago, and replaced with "Gender dysphoria."'
94
- "Gays":
95
- replacement: "Gay people"
96
- rationale: "This subject heading has been updated by the Library of Congress, but some partner records have not yet been updated to reflect this."
97
- # The following term will match if the first two subfields in the field are "Japanese Americans" and "Evacuation and relocation, 1942-1945"
98
- ["Japanese Americans", "Evacuation and relocation, 1942-1945"]:
99
- replacement: ["Japanese Americans", "Forced removal and internment, 1942-1945"]
100
- rationale: "This subject heading has been updated by the Library of Congress, but some partner records have not yet been updated to reflect this."
101
- ["Aleuts", "Evacuation and relocation, 1942-1945"]:
102
- replacement: ["Aleuts", "Forced removal and internment, 1942-1945"]
103
- rationale: "This subject heading has been updated by the Library of Congress, but some partner records have not yet been updated to reflect this."
104
- ["German Americans", "Evacuation and relocation, 1942-1945"]:
105
- replacement: ["German Americans", "Forced removal and internment, 1942-1945"]
106
- rationale: "This subject heading has been updated by the Library of Congress, but some partner records have not yet been updated to reflect this."
107
- ["Italian Americans", "Evacuation and relocation, 1942-1945"]:
108
- replacement: ["Italian Americans", "Forced removal and internment, 1942-1945"]
109
- rationale: "This subject heading has been updated by the Library of Congress, but some partner records have not yet been updated to reflect this."
110
- "Convict labor":
111
- replacement: "Prison labor"
112
- rationale: "Prison labor is currently listed in LCSH as a variant of the authorized heading Convict labor. However, Convict labor appears to have become less commonly used and prison labor to have a broader historical scope. This title change was recommended by the Prison Teaching Initiative at Princeton."
1
+ main_term:
2
+ "Illegal aliens":
3
+ replacement: "Undocumented immigrants"
4
+ rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
5
+ "Women illegal aliens":
6
+ replacement: "Women undocumented immigrants"
7
+ rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
8
+ "Illegal aliens in literature":
9
+ replacement: "Undocumented immigrants in literature"
10
+ rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
11
+ "Children of illegal aliens":
12
+ replacement: "Children of undocumented immigrants"
13
+ rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
14
+ "Illegal alien children":
15
+ replacement: "Undocumented immigrant children"
16
+ rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
17
+ "Illegal immigration":
18
+ replacement: "Undocumented immigrants"
19
+ rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
20
+ "Illegal immigration in literature":
21
+ replacement: "Undocumented immigrants in literature"
22
+ rationale: "The term immigrant or undocumented/unauthorized immigrants are the terms LoC proposed as replacements for illegal aliens and other uses of the world alien in LCSH."
23
+ "Alien criminals":
24
+ replacement: "Noncitizen criminals"
25
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
26
+ "Aliens":
27
+ replacement: "Noncitizens"
28
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
29
+ "Aliens in art":
30
+ replacement: "Noncitizens in art"
31
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
32
+ "Aliens in literature":
33
+ replacement: "Noncitizens in literature"
34
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
35
+ "Aliens in mass media":
36
+ replacement: "Noncitizens in mass media"
37
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
38
+ "Church work with aliens":
39
+ replacement: "Church work with noncitizens"
40
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
41
+ "Officials and employees, Alien":
42
+ replacement: "Officials and employees, Noncitizen"
43
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
44
+ "Aliens (Greek law)":
45
+ replacement: "Noncitizens (Greek law)"
46
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
47
+ "Aliens (Roman law)":
48
+ replacement: "Noncitizens (Roman law)"
49
+ rationale: "The term Noncitizen is the term LoC proposed as replacements for aliens and other uses of the word alien in LCSH."
50
+ "Child slaves":
51
+ replacement: "Enslaved children"
52
+ rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources."
53
+ "Indian slaves":
54
+ replacement: "Enslaved Indigenous peoples"
55
+ rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help.\" Capitalization of \"Indigenous\" appears to be preferred by those from Indigenous communities, for example see https://www.lib.sfu.ca/about/branches-depts/slc/writing/inclusive-antiracist-writing/bipoc and https://www.ictinc.ca/blog/indigenous-peoples-terminology-guidelines-for-usage. As this is a broad term, when possible, one should include the name of the community(ies) or nation(s) of the people in the record. "
56
+ "Older slaves":
57
+ replacement: "Enslaved older people"
58
+ rationale: "The use of \"enslaved\" falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources. \"Older people\" is the current LC preferred term: https://id.loc.gov/search/?q=memberOf:http://id.loc.gov/authorities/demographicTerms/collection_LCDGT_Age. "
59
+ "Slaves":
60
+ replacement: "Enslaved persons"
61
+ rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources."
62
+ "Women slaves":
63
+ replacement: "Enslaved women"
64
+ rationale: "In addition to its usage by TRLN, this term falls in line with recommendations included in the community-sourced document P. Gabrielle Foreman, et al. \"Writing about Slavery/Teaching About Slavery: This Might Help\" and Archives for Black Lives in Philadelphia Anti-Racist Description Resources."
65
+ "East Indians":
66
+ replacement: "Indians (India)"
67
+ rationale: "\"East Indians\" is anachronistic and confusing to researchers. \"East\" is not used with \"Indians\" by the people who live in India, people who once lived in India, or even by the former colonizers of India at this point in time."
68
+ "Indians":
69
+ replacement: "Indigenous peoples of the Western Hemisphere"
70
+ rationale: "Using the scope note from the LCSH term, rather than the term \"Indians,\" is more accurate and less offensive for so many people under this large geographical umbrella."
71
+ "Indians of Central America":
72
+ replacement: "Indigenous peoples of Central America"
73
+ rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
74
+ "Indians of Mexico":
75
+ replacement: "Indigenous peoples of Mexico"
76
+ rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
77
+ "Indians of North America":
78
+ replacement: "Indigenous peoples of North America"
79
+ rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
80
+ "Indians of South America":
81
+ replacement: "Indigenous peoples of South America"
82
+ rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
83
+ "Indians of the West Indies":
84
+ replacement: "Indigenous peoples of the West Indies"
85
+ rationale: "This term is used by TRLN; according to our research, this terminology is preferred and widely regarded as a more inclusive term. It is important to include the geographic region in the subject term when possible, as there are Indigenous peoples throughout the world. When possible, it is respectful to also include the name of the community(ies) or nation(s) of the people in the record, for example \"Chumash,\" \"Tonkawa,\" \"Rapa Nui,\" \"Huetar.\""
86
+ "Gender identity disorders":
87
+ replacement: "Gender dysphoria"
88
+ rationale: '"Gender identity disorder" was removed from the DSM -- the primary diagnostic manual used by psychiatric and psychological professionals in the U.S. -- nearly a decade ago, and replaced with "Gender dysphoria."'
89
+ "Gender identity disorders in children":
90
+ replacement: "Gender dysphoria in children"
91
+ rationale: '"Gender identity disorder" was removed from the DSM -- the primary diagnostic manual used by psychiatric and psychological professionals in the U.S. -- nearly a decade ago, and replaced with "Gender dysphoria."'
92
+ "Gender identity disorders in adolescence":
93
+ replacement: "Gender dysphoria in adolescence"
94
+ rationale: '"Gender identity disorder" was removed from the DSM -- the primary diagnostic manual used by psychiatric and psychological professionals in the U.S. -- nearly a decade ago, and replaced with "Gender dysphoria."'
95
+ "Gays":
96
+ replacement: "Gay people"
97
+ rationale: "This subject heading has been updated by the Library of Congress, but some partner records have not yet been updated to reflect this."
98
+ "Convict labor":
99
+ replacement: "Prison labor"
100
+ rationale: "Prison labor is currently listed in LCSH as a variant of the authorized heading Convict labor. However, Convict labor appears to have become less commonly used and prison labor to have a broader historical scope. This title change was recommended by the Prison Teaching Initiative at Princeton."
101
+ "McKinley, Mount (Alaska)":
102
+ replacement: "Denali, Mount (Alaska)"
103
+ rationale: 'Denali is one of many long-standing Native names for this mountain, the name in common usage in Alaska, and the name with the most literary warrant. The Alaska Legislature has consistently requested that this mountain be called "Denali" since 1975, which was reaffirmed again in 2025. On the other hand, the name Mount McKinley had only been in use since 1896, in honor of a man who never set foot in Alaska or had any connection to the mountain. LCSH changed the authorized heading to "Denali, Mount (Alaska)" in 2015, and there is no need to change it back to the less common, less accurate name.'
104
+ "America, Gulf of":
105
+ replacement: "Mexico, Gulf of"
106
+ rationale: 'The term "Mexico, Gulf of" reflects literary warrant as well as colloquial usage patterns, and the term "America, Gulf of" is politically contested.'
107
+ subdivision:
108
+ "America, Gulf of":
109
+ replacement: "Mexico, Gulf of"
110
+ rationale: 'The term "Mexico, Gulf of" reflects literary warrant as well as colloquial usage patterns, and the term "America, Gulf of" is politically contested.'
111
+ "Evacuation and relocation, 1942-1945":
112
+ replacement: "Forced removal and internment, 1942-1945"
113
+ rationale: "This subdivision has been updated by the Library of Congress, but some partner records have not yet been updated to reflect this."
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ChangeTheSubject
4
- VERSION = "0.3.6"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -20,22 +20,23 @@ class ChangeTheSubject
20
20
  @separators = separators || ["—"]
21
21
  end
22
22
 
23
- def terms_mapping
24
- @terms_mapping ||= config
23
+ def main_term_mapping
24
+ @main_term_mapping ||= config["main_term"]
25
+ end
26
+
27
+ def subdivision_term_mapping
28
+ @subdivision_term_mapping ||= config["subdivision"]
25
29
  end
26
30
 
27
31
  # Given an array of subject terms, replace the ones that need replacing
28
32
  # @param [<String>] subject_terms
29
33
  # @return [<String>]
30
34
  def fix(subject_terms:)
31
- return [] if subject_terms.nil?
32
-
33
- subject_terms = subject_terms.compact.reject(&:empty?)
34
- return [] if subject_terms.empty? || subject_terms.nil?
35
-
36
- subject_terms.map do |term|
35
+ subject_terms.compact.reject(&:empty?).map do |term|
37
36
  replacement = check_for_replacement(term: term)
38
- replacement unless replacement.empty?
37
+ subdivision_replacement = check_for_replacement_subdivision(term: replacement)
38
+
39
+ subdivision_replacement unless subdivision_replacement.empty?
39
40
  end.compact.uniq
40
41
  end
41
42
 
@@ -46,7 +47,7 @@ class ChangeTheSubject
46
47
  def check_for_replacement(term:)
47
48
  separators.each do |separator|
48
49
  subterms = term.split(separator)
49
- replacement = replacement_config_for_subterms(subterms)
50
+ replacement = replacement_config_for_main_terms(subterms)
50
51
  next unless replacement
51
52
 
52
53
  new_terms = replacement_terms(replacement)
@@ -58,13 +59,47 @@ class ChangeTheSubject
58
59
  term
59
60
  end
60
61
 
62
+ def check_for_replacement_subdivision(term:)
63
+ separators.each do |separator|
64
+ next unless term.include?(separator)
65
+
66
+ return replace_subdivisions(term: term, separator: separator)
67
+ end
68
+ term
69
+ end
70
+
71
+ def replace_subdivisions(term:, separator:)
72
+ subterms = term.split(separator)
73
+ subterms.each.with_index do |sub_term, index|
74
+ next if index.zero?
75
+
76
+ term_config = subdivision_term_mapping[sub_term]
77
+ next unless term_config
78
+
79
+ subterms[index] = term_config["replacement"]
80
+ end
81
+
82
+ subterms.join(separator)
83
+ end
84
+
85
+ def self.config_yaml
86
+ change_the_subject_erb = ERB.new(File.read(change_the_subject_config_file)).result
87
+ YAML.safe_load(change_the_subject_erb, aliases: true)
88
+ rescue StandardError, SyntaxError => error
89
+ raise Error, "#{change_the_subject_config_file} was found, but could not be parsed. \n#{error.inspect}"
90
+ end
91
+
92
+ def self.change_the_subject_config_file
93
+ File.join(File.dirname(__FILE__), "../", "config", "change_the_subject.yml")
94
+ end
95
+
61
96
  private
62
97
 
63
- def replacement_config_for_subterms(subterms)
64
- matching_key = terms_mapping.keys.find do |term_to_replace|
98
+ def replacement_config_for_main_terms(subterms)
99
+ matching_key = main_term_mapping.keys.find do |term_to_replace|
65
100
  term_matches_subterms?(term_to_replace, subterms)
66
101
  end
67
- return terms_mapping[matching_key] if matching_key
102
+ main_term_mapping[matching_key] if matching_key
68
103
  end
69
104
 
70
105
  def term_matches_subterms?(term, subterms)
@@ -79,17 +114,6 @@ class ChangeTheSubject
79
114
  end
80
115
 
81
116
  def config
82
- @config ||= config_yaml
83
- end
84
-
85
- def config_yaml
86
- change_the_subject_erb = ERB.new(File.read(change_the_subject_config_file)).result
87
- YAML.safe_load(change_the_subject_erb, aliases: true)
88
- rescue StandardError, SyntaxError => e
89
- raise Error, "#{change_the_subject_config_file} was found, but could not be parsed. \n#{e.inspect}"
90
- end
91
-
92
- def change_the_subject_config_file
93
- File.join(File.dirname(__FILE__), "../", "config", "change_the_subject.yml")
117
+ @config ||= ChangeTheSubject.config_yaml
94
118
  end
95
119
  end
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: change_the_subject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Kadel
8
8
  - Anna Headley
9
9
  - Trey Pendragon
10
10
  - Eliot Jordan
11
- autorequire:
12
11
  bindir: exe
13
12
  cert_chain: []
14
- date: 2024-12-09 00:00:00.000000000 Z
13
+ date: 2025-02-20 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: yaml
@@ -61,14 +60,14 @@ dependencies:
61
60
  requirements:
62
61
  - - '='
63
62
  - !ruby/object:Gem::Version
64
- version: '1.36'
63
+ version: '1.72'
65
64
  type: :development
66
65
  prerelease: false
67
66
  version_requirements: !ruby/object:Gem::Requirement
68
67
  requirements:
69
68
  - - '='
70
69
  - !ruby/object:Gem::Version
71
- version: '1.36'
70
+ version: '1.72'
72
71
  - !ruby/object:Gem::Dependency
73
72
  name: rubocop-rspec
74
73
  requirement: !ruby/object:Gem::Requirement
@@ -97,7 +96,6 @@ dependencies:
97
96
  - - ">="
98
97
  - !ruby/object:Gem::Version
99
98
  version: '0'
100
- description:
101
99
  email:
102
100
  - digital-library@princeton.libanswers.com
103
101
  executables: []
@@ -127,7 +125,6 @@ metadata:
127
125
  allowed_push_host: https://rubygems.org
128
126
  homepage_uri: https://github.com/pulibrary/change_the_subject
129
127
  source_code_uri: https://github.com/pulibrary/change_the_subject
130
- post_install_message:
131
128
  rdoc_options: []
132
129
  require_paths:
133
130
  - lib
@@ -142,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
139
  - !ruby/object:Gem::Version
143
140
  version: '0'
144
141
  requirements: []
145
- rubygems_version: 3.3.27
146
- signing_key:
142
+ rubygems_version: 3.6.2
147
143
  specification_version: 4
148
144
  summary: Provides configuration and utilities for replacing archaic subject terms
149
145
  with preferred subject terms