|
|
@ -58,7 +58,15 @@ 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)
|
|
|
|
|
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
|
|
|
@ -220,7 +228,7 @@ class SkeInsert(DataChgClickMessage):
|
|
|
|
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()
|
|
|
|
new_example.inner.other_attributes["exampleId"] = example.s_id
|
|
|
|
new_example.inner.other_attributes["example_id"] = example.s_id
|
|
|
|
new_example.inner.cluster = ExampleClusters.first_empty_cluster()
|
|
|
|
new_example.inner.cluster = ExampleClusters.first_empty_cluster()
|
|
|
|
|
|
|
|
|
|
|
|
lex_left = ComponentLexeme()
|
|
|
|
lex_left = ComponentLexeme()
|
|
|
@ -229,7 +237,7 @@ class SkeInsert(DataChgClickMessage):
|
|
|
|
|
|
|
|
|
|
|
|
lex_mid = ComponentLexeme()
|
|
|
|
lex_mid = ComponentLexeme()
|
|
|
|
lex_mid.text = example["mid"]
|
|
|
|
lex_mid.text = example["mid"]
|
|
|
|
lex_mid.role = "headword"
|
|
|
|
lex_mid.role = "collocation"
|
|
|
|
|
|
|
|
|
|
|
|
lex_right = ComponentLexeme()
|
|
|
|
lex_right = ComponentLexeme()
|
|
|
|
lex_right.text = example["right"]
|
|
|
|
lex_right.text = example["right"]
|
|
|
@ -243,6 +251,7 @@ class SkeInsert(DataChgClickMessage):
|
|
|
|
new_collocation.inner = MultiwordExample()
|
|
|
|
new_collocation.inner = MultiwordExample()
|
|
|
|
|
|
|
|
|
|
|
|
new_collocation.inner.other_attributes["structure_id"] = example.structure_id
|
|
|
|
new_collocation.inner.other_attributes["structure_id"] = example.structure_id
|
|
|
|
|
|
|
|
new_collocation.inner.other_attributes["structureName"] = example.structure_name
|
|
|
|
new_collocation.inner.other_attributes["logDice"] = example.other["score"]
|
|
|
|
new_collocation.inner.other_attributes["logDice"] = example.other["score"]
|
|
|
|
new_collocation.inner.other_attributes["frequency"] = example.frequency
|
|
|
|
new_collocation.inner.other_attributes["frequency"] = example.frequency
|
|
|
|
new_collocation.inner.type = "collocation"
|
|
|
|
new_collocation.inner.type = "collocation"
|
|
|
@ -253,7 +262,7 @@ class SkeInsert(DataChgClickMessage):
|
|
|
|
|
|
|
|
|
|
|
|
lex_mid = ComponentLexeme()
|
|
|
|
lex_mid = ComponentLexeme()
|
|
|
|
lex_mid.text = example.word
|
|
|
|
lex_mid.text = example.word
|
|
|
|
lex_mid.role = "headword"
|
|
|
|
lex_mid.role = "collocation"
|
|
|
|
|
|
|
|
|
|
|
|
lex_right = ComponentLexeme()
|
|
|
|
lex_right = ComponentLexeme()
|
|
|
|
lex_right.text = ""
|
|
|
|
lex_right.text = ""
|
|
|
|