def autotag_configs(config): done = [] for at_config in config.prefs.autotag: yield at_config done.append(at_config.match_tag) for tid, tag_info in config.tags.iteritems(): auto_tagging = tag_info.auto_tag if (tid not in done and auto_tagging.lower() not in ('', 'off', 'false')): at_config = ConfigDict(_rules=AUTO_TAG_CONFIG) at_config.match_tag = tid at_config.tagger = auto_tagging yield at_config
def autotag_configs(config): done = [] for at_config in config.prefs.autotag: yield at_config done.append(at_config.match_tag) taggers = [k for k in TAGGERS.keys() if k != '_default'] if not taggers: return for tid, tag_info in config.tags.iteritems(): auto_tagging = (tag_info.auto_tag or '') if (tid not in done and auto_tagging.lower() not in AUTO_TAG_DISABLED): at_config = ConfigDict(_rules=AUTO_TAG_CONFIG) at_config.match_tag = tid if auto_tagging not in taggers: auto_tagging = taggers[0] at_config.tagger = auto_tagging at_config.trainer = auto_tagging yield at_config