Open physikerwelt opened 1 month ago
old code
def is_jfm(hit) -> bool: try: return hit["_source"]["database"] == "JFM" except KeyError: return False def append_set_info(hit, parent, doc): classification = collect_info_for_hit(hit, "classification") sets = {""} for v in str(classification).split(";"): sets.add(v.strip()[0:2]) sets.remove("") if is_jfm(hit): sets.add("JFM") # sorted is required for integration tests for s in sorted(sets): node = doc.createElement("setSpec") node.appendChild(doc.createTextNode(s)) parent.appendChild(node)
old code