|
|
@ -26,6 +26,7 @@ class SkeExample:
|
|
|
|
self.mid = ""
|
|
|
|
self.mid = ""
|
|
|
|
self.s_id = ""
|
|
|
|
self.s_id = ""
|
|
|
|
self.gf2_good = None
|
|
|
|
self.gf2_good = None
|
|
|
|
|
|
|
|
self.gf2_check = False
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def fromLine(line):
|
|
|
|
def fromLine(line):
|
|
|
@ -58,15 +59,7 @@ class SkeCollocation:
|
|
|
|
def __init__(self, data):
|
|
|
|
def __init__(self, data):
|
|
|
|
self.word = data.word
|
|
|
|
self.word = data.word
|
|
|
|
self.frequency = data.count
|
|
|
|
self.frequency = data.count
|
|
|
|
|
|
|
|
self.structure_name, self.structure_id = convert_structure(data.gramrel, data.lempos)
|
|
|
|
info = convert_structure(data.gramrel)
|
|
|
|
|
|
|
|
if info is None:
|
|
|
|
|
|
|
|
self.structure_name = None
|
|
|
|
|
|
|
|
self.structure_id = None
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.structure_name = info[0]
|
|
|
|
|
|
|
|
self.structure_id = info[1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.other = {"score": data.score, "cm": data.cm}
|
|
|
|
self.other = {"score": data.score, "cm": data.cm}
|
|
|
|
|
|
|
|
|
|
|
@ -148,7 +141,7 @@ class SkeModal(ClickMessage):
|
|
|
|
elif type(data) is list:
|
|
|
|
elif type(data) is list:
|
|
|
|
window.console.log(data)
|
|
|
|
window.console.log(data)
|
|
|
|
# check if gf2 examples are loaded or not
|
|
|
|
# check if gf2 examples are loaded or not
|
|
|
|
if data[0].gf2_good is None:
|
|
|
|
if not data[0].gf2_check and type(data[0]) is SkeExample:
|
|
|
|
# we get the data, we have to match it with available data on our gf2 examples API
|
|
|
|
# we get the data, we have to match it with available data on our gf2 examples API
|
|
|
|
match_gf2_examples(data, page_num, search_term, ske_index)
|
|
|
|
match_gf2_examples(data, page_num, search_term, ske_index)
|
|
|
|
|
|
|
|
|
|
|
@ -169,12 +162,18 @@ class SkeModalGf2Update(SkeModal):
|
|
|
|
example.gf_good = False
|
|
|
|
example.gf_good = False
|
|
|
|
data_dict[example.s_id] = example
|
|
|
|
data_dict[example.s_id] = example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bad_response = dict(response_data["bad"])
|
|
|
|
|
|
|
|
for gf_sid, gf_data in bad_response.items():
|
|
|
|
|
|
|
|
data_dict[gf_sid].gf2_good = None
|
|
|
|
|
|
|
|
data_dict[gf_sid].gf2_check = True
|
|
|
|
|
|
|
|
|
|
|
|
good_response = dict(response_data["good"])
|
|
|
|
good_response = dict(response_data["good"])
|
|
|
|
for gf_sid, gf_data in good_response.items():
|
|
|
|
for gf_sid, gf_data in good_response.items():
|
|
|
|
data_dict[gf_sid].left = gf_data.left
|
|
|
|
data_dict[gf_sid].left = gf_data.left
|
|
|
|
data_dict[gf_sid].mid = gf_data.mid
|
|
|
|
data_dict[gf_sid].mid = gf_data.mid
|
|
|
|
data_dict[gf_sid].right = gf_data.right
|
|
|
|
data_dict[gf_sid].right = gf_data.right
|
|
|
|
data_dict[gf_sid].gf2_good = True
|
|
|
|
data_dict[gf_sid].gf2_good = True
|
|
|
|
|
|
|
|
data_dict[gf_sid].gf2_check = True
|
|
|
|
|
|
|
|
|
|
|
|
# changed data_dict, now we can redraw!
|
|
|
|
# changed data_dict, now we can redraw!
|
|
|
|
# just let it do its thing in update_model
|
|
|
|
# just let it do its thing in update_model
|
|
|
@ -225,6 +224,8 @@ class SkeInsert(DataChgClickMessage):
|
|
|
|
console.log("You really should not be here, my lady")
|
|
|
|
console.log("You really should not be here, my lady")
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.reset()
|
|
|
|
|
|
|
|
|
|
|
|
def _as_corpus_example(self, example):
|
|
|
|
def _as_corpus_example(self, example):
|
|
|
|
new_example = Example()
|
|
|
|
new_example = Example()
|
|
|
|
new_example.inner = CorpusExample()
|
|
|
|
new_example.inner = CorpusExample()
|
|
|
|