mirror of
https://github.com/qurator-spk/modstool.git
synced 2025-08-14 12:09:52 +02:00
🧹 MODS: Add missing type='text' for mods:placeTerm
This commit is contained in:
parent
2c47a34c14
commit
2f00dfcce0
2 changed files with 8 additions and 0 deletions
|
@ -187,6 +187,13 @@ class TagGroup:
|
|||
warnings.warn("Changed scriptTerm authority to lower case")
|
||||
return self
|
||||
|
||||
def add_missing_type_text(self) -> TagGroup:
|
||||
for e in self.group:
|
||||
if not e.attrib.get("type") == "text":
|
||||
e.attrib["type"] = "text"
|
||||
warnings.warn("Added type='text')")
|
||||
return self
|
||||
|
||||
def merge_sub_tags_to_set(self) -> dict:
|
||||
from .mods4pandas import mods_to_dict
|
||||
|
||||
|
|
|
@ -99,6 +99,7 @@ def mods_to_dict(mods, raise_errors=True):
|
|||
value["placeTerm"] = (
|
||||
TagGroup(tag, group)
|
||||
.is_singleton()
|
||||
.add_missing_type_text()
|
||||
.has_attributes({"type": "text"})
|
||||
.text()
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue