Skip to content

Commit

Permalink
Merge pull request #54 from seasidesparrow/multi_issues.20240223
Browse files Browse the repository at this point in the history
adds copyright to tagged output
  • Loading branch information
seasidesparrow authored Feb 23, 2024
2 parents 50f8b28 + fece2a2 commit 2fc718b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions adsmanparse/classic_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def _clean_string(self, data):
data = re.sub(r"&[rl]squo;", "\'", data)
data = re.sub(r"&[rl]dquo;", "\"", data)
data = re.sub(r" ", " ", data)
data = re.sub(r"‌", " ", data)
return data

def __init__(self, **kwargs):
Expand All @@ -43,6 +44,7 @@ def __init__(self, **kwargs):
('language', {'tag': 'M'}),
('comments', {'tag': 'X', 'join': '; '}),
('source', {'tag': 'G'}),
('copyright', {'tag': 'C'}),
('uatkeys', {'tag': 'U', 'join': ', '}),
('keywords', {'tag': 'K', 'join': ', '}),
('subjectcategory', {'tag': 'Q', 'join': '; '}),
Expand Down
5 changes: 5 additions & 0 deletions adsmanparse/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ def _get_bibcode(self, bibstem=None):
except Exception as err:
print('Couldnt make a bibcode: %s' % str(err))

def _get_copyright(self):
copyright_statement=self.data.get("copyright", {}).get("statement", None)
if copyright_statement:
self.output["copyright"] = copyright_statement

def _special_handling(self, bibstem=None):
# Special data handling rules on a per-bibstem basis
Expand Down Expand Up @@ -397,3 +401,4 @@ def translate(self, data=None, publisher=None, bibstem=None, parsedfile=False):
self._get_properties(parsedfile)
self._get_publication()
self._get_bibcode(bibstem=bibstem)
self._get_copyright()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
git+https://github.com/adsabs/ADSIngestParser@v0.9.13
git+https://github.com/adsabs/ADSIngestEnrichment@v0.9.5
git+https://github.com/adsabs/ADSIngestEnrichment@v0.9.6
adsputils==1.5.2
habanero==0.7.4
namedentities==1.9.4
Expand Down

0 comments on commit 2fc718b

Please sign in to comment.