Example #1
0
def default_annotation():
    fproc = FileProcessor()
    db = Database()
    relation_button = RelationButton()

    return fproc.output_annotated_str(
        db) + '\n' + relation_button.output_relation_plain(db)
Example #2
0
def update_relation():
    data = request.json
    db = Database()
    relation_button = RelationButton()
    relation_button.add_relation(db, data['domain'], data['range'],
                                 data['relation'])

    return {
        'output': relation_button.output_relation_plain(db),
        'relations': relation_button.get_relations(db)
    }
Example #3
0
def save_file():
    db = Database()
    fproc = FileProcessor()
    relation_button = RelationButton()

    data = request.json
    save_path = './annotated_results'
    complete_name = os.path.join(save_path, data['filename'])

    text_file = open(complete_name, "w")
    text_file.write(
        fproc.output_annotated_str(db) + '\n' +
        relation_button.output_relation_plain(db))
    text_file.close()