Esempio n. 1
0
    def add_meta_test(self):
        set_meta_attr(self.t, DATA_PROV, DATA_SRC_ATTR, INTENT_META_SOURCE)
        set_meta_attr(self.t, DATA_PROV, DATA_METH_ATTR, INTENT_ALN_GIZA)

        self.assertEqual(find_meta_attr(self.t, DATA_PROV, DATA_METH_ATTR), INTENT_ALN_GIZA)
        self.assertEqual(find_meta_attr(self.t, DATA_PROV, DATA_SRC_ATTR), INTENT_META_SOURCE)

        self.assertEqual(len(self.t.metadata), 1)
        self.assertEqual(len(self.t.metadata[0].metas), 1)
Esempio n. 2
0
    def timestamp_test(self):
        set_meta_attr(self.t, DATA_PROV, DATA_SRC_ATTR, INTENT_META_SOURCE)

        self.assertIsNotNone(get_meta_timestamp(find_meta(self.t, DATA_PROV)))
Esempio n. 3
0
def add_split_metadata(igt, source_id):
    set_meta_attr(igt, DATA_PROV, DUPLICATE_ATTR, source_id, metadata_type=EDITOR_METADATA_TYPE)
Esempio n. 4
0
def add_editor_metadata(igt):
    ct = cleaned_tier(igt)
    nt = normalized_tier(igt)
    for tier in [ct, nt]:
        if tier is not None:
            set_meta_attr(tier, DATA_PROV, DATA_SRC_ATTR, EDITOR_DATA_SRC, metadata_type=EDITOR_METADATA_TYPE)
Esempio n. 5
0
def set_rating(inst, user, rating, reason):
    set_meta_attr(inst, RATING_META_TYPE, USER_META_ATTR, user, metadata_type=EDITOR_METADATA_TYPE)
    set_meta_attr(inst, RATING_META_TYPE, QUALITY_META_ATTR, RATINGS.get(rating), metadata_type=EDITOR_METADATA_TYPE)
    set_meta_attr(inst, RATING_META_TYPE, REASON_META_ATTR, reason, metadata_type=EDITOR_METADATA_TYPE)
Esempio n. 6
0
def set_comment(inst, user, comment):
    set_meta_text(inst, COMMENT_META_TYPE, comment, metadata_type=EDITOR_METADATA_TYPE)
    set_meta_attr(inst, COMMENT_META_TYPE, USER_META_ATTR, user, metadata_type=EDITOR_METADATA_TYPE)