Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

BibCheck: new plugin #290

Open
wants to merge 1 commit into
base: prod
Choose a base branch
from
Open

Conversation

tsgit
Copy link

@tsgit tsgit commented Dec 17, 2015

* plugin remove_subfield_matching

* removes subfield matching regexp or entire tag

Signed-off-by: Thorsten Schwander [email protected]

@ksachs
Copy link

ksachs commented Dec 17, 2015

Allow for additional filter?

for pos, val in record.iterfield(subfield):
if subfieldre.match(val):
count = 0
for spos, _ in record.iterfield(subfield[0:5] + '%'):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the end:

count  = len(record[pos[0][0:3]][pos[1]][0])

and wouldn't it be better if bibcheck learns to delete empty subfields (and empty tags)?

    * plugin remove_subfield_matching

    * removes subfield matching regexp or entire tag

    * optionally filter by subfield

Signed-off-by: Thorsten Schwander <[email protected]>
@tsgit
Copy link
Author

tsgit commented Dec 21, 2015

added optional subfield_filter, although the regexp itself should probably sufficiently specific to match no more than what should be removed.

Also, if the subfield filter specifies a provenance and there are no other subfields, only the matching subfield will be removed and the provenance stays behind. In this case remove_entire_tag would be a more appropriate action -- but that should be a separate plugin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants