In [1]:
from collatex import *
json_input = {
"witnesses" : [
{
"id": "A",
"tokens": [
{ "t" : "the" },
{ "t" : "black" },
{ "t" : "dog" }
]
},
{
"id": "B",
"tokens": [
{ "t" : "the" },
{ "t" : "black", "tag" : "emph" },
{ "t" : "dingo" }
]
}
]
}
collate_pretokenized_json(json_input, output="html2")
In [2]:
def match_properties(token1_data, token2_data):
return token1_data == token2_data
collate_pretokenized_json(json_input, properties_filter=match_properties, output="html2")
In [ ]: