mirror of
https://github.com/qurator-spk/modstool.git
synced 2025-08-16 13:09:53 +02:00
🧹 MODS: Handle mods:languageTerm with authority=iso639-2/rfc3066
This commit is contained in:
parent
5f1c1f68a7
commit
64aafbb88c
2 changed files with 13 additions and 0 deletions
|
@ -187,6 +187,18 @@ class TagGroup:
|
|||
warnings.warn("Changed scriptTerm authority to lower case")
|
||||
return self
|
||||
|
||||
def fix_language_term(self) -> TagGroup:
|
||||
for e in self.group:
|
||||
if e.attrib["authority"] == "iso639-2":
|
||||
e.attrib["authority"] = "iso639-2b"
|
||||
warnings.warn("Changed languageTerm authority to iso639-2b")
|
||||
if e.attrib["authority"] == "rfc3066":
|
||||
if e.text == "de":
|
||||
e.attrib["authority"] = "iso639-2b"
|
||||
e.text = "deu"
|
||||
warnings.warn("Changed languageTerm authority from rfc3066 to iso639-2b")
|
||||
return self
|
||||
|
||||
def add_missing_type_text(self) -> TagGroup:
|
||||
for e in self.group:
|
||||
if not e.attrib.get("type") == "text":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue