File size: 4,484 Bytes
995ef83
7f99ac0
73c2214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
995ef83
73c2214
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# modules/__init__.py

# modules/__init__.py

def load_auth_functions():
    from modules.auth.auth import authenticate_user, register_user
    return {
        'authenticate_user': authenticate_user,
        'register_user': register_user
    }

def load_database_function():
    from modules.database.database import (
        initialize_mongodb_connection,
        get_student_data,
        store_application_request,
        store_morphosyntax_result,
        store_semantic_result,
        store_discourse_analysis_result,
        store_chat_history,
        create_admin_user,
        create_student_user
    )
    return {
        'initialize_mongodb_connection': initialize_mongodb_connection, 
        'get_student_data': get_student_data, 
        'store_application_request': store_application_request, 
        'store_morphosyntax_result': store_morphosyntax_result,
        'store_semantic_result': store_semantic_result, 
        'store_discourse_analysis_result': store_discourse_analysis_result, 
        'store_chat_history': store_chat_history, 
        'create_admin_user': create_admin_user, 
        'create_student_user': create_student_user
    }

def load_ui_functions():
    from modules.ui.ui import (
        main,
        login_register_page,
        login_form,
        register_form,
        user_page,
        display_student_progress,
        display_morphosyntax_analysis_interface,
        display_semantic_analysis_interface,
        display_discourse_analysis_interface,
        display_chatbot_interface
    )
    return {
        'main': main, 
        'login_register_page': login_register_page,
        'login_form': login_form,
        'register_form': register_form,
        'user_page': user_page,
        'display_student_progress': display_student_progress,
        'display_morphosyntax_analysis_interface': display_morphosyntax_analysis_interface,
        'display_semantic_analysis_interface': display_semantic_analysis_interface,
        'display_discourse_analysis_interface': display_discourse_analysis_interface,
        'display_chatbot_interface': display_chatbot_interface   
    }

def load_admin_functions():
    from modules.admin.admin_ui import admin_page
    return {
        'admin_page': admin_page
    }
    
def morpho_analysis_functions():
    from modules.analysis_text.morpho_analysis import (
        get_repeated_words_colors,
        highlight_repeated_words,
        POS_COLORS,
        POS_TRANSLATIONS,
        perform_advance_morphosyntax_analysis
    )
    return {
        'get_repeated_words_colors': get_repeated_words_colors,
        'highlight_repeated_words': highlight_repeated_words,
        'POS_COLORS': POS_COLORS,
        'POS_TRANSLATIONS': POS_TRANSLATIONS,
        'perform_advance_morphosyntax_analysis' : perform_advance_morphosyntax_analysis
    }

def semantic_analysis_text_functions():
    from modules.analysis_text.semantic_analysis import (
        visualize_semantic_relations,
        perform_semantic_analysis,
        create_semantic_graph
    )
    return {
        'visualize_semantic_relations': visualize_semantic_relations,
        'perform_semantic_analysis': perform_semantic_analysis,
        'create_semantic_graph': create_semantic_graph
    }

def discourse_analysis_text_functions():
    from modules.analysis_text.discourse_analysis import (
        perform_discourse_analysis,
        compare_semantic_analysis
    )
    return {
        'perform_discourse_analysis': perform_discourse_analysis,
        'compare_semantic_analysis': compare_semantic_analysis
    }

def spacy_utils_functions():
    from modules.utils.spacy_utils import load_spacy_models
    return {
        'load_spacy_models': load_spacy_models
    }

def chatbot_functions():
    from modules.chatbot.chatbot import (
        initialize_chatbot,
        get_chatbot_response,
        ClaudeAPIChat
    )
    return {
        'initialize_chatbot': initialize_chatbot,
        'get_chatbot_response': get_chatbot_response,
        'ClaudeAPIChat': ClaudeAPIChat
    }

# Opcional: función para cargar todas las funciones
def load_all_functions():
    return {
        **load_auth_functions(),
        **load_database_function(),
        **load_ui_functions(),
        **load_admin_functions(),
        **morpho_analysis_functions(),
        **semantic_analysis_text_functions(),
        **discourse_analysis_text_functions(),
        **spacy_utils_functions(),
        **chatbot_functions()
    }