def init_state_basic(TableFile, RobustMatchFile):
    random.seed()
    log.print_log_message(['load_tables', TableFile])
    NamespaceEtc = tables.load_data(TableFile)
    (Namespace, Domain, L2,
     L1) = (NamespaceEtc['namespace'], NamespaceEtc['domain'],
            NamespaceEtc['l2'], NamespaceEtc['l1'])
    log.print_log_message([
        'load_tables_succeeded', {
            'namespace': Namespace,
            'domain': Domain,
            'l2': L2,
            'l1': L1
        }
    ])
    log.print_log_message(['load_robust_matching_tables', RobustMatchFile])
    lgm_tables.load_data(RobustMatchFile, Namespace)
    log.print_log_message(
        ['load_robust_matching_tables_succeeded', RobustMatchFile, Namespace])
    #add_regularised_keys_to_sent_atom_namespace_lf_l1_text(Namespace, Domain)
    State = initial_state()
    process_call_message(
        ['set_namespace_domain_and_language', Namespace, Domain, L1], State)
    import_course_info_into_state(State)
    #State['l2'] = L2
    return State
def init_state(TableFile, RobustMatchFile):
    random.seed()
    log.print_log_message(['load_tables', TableFile])
    NamespaceEtc = tables.load_data(TableFile)
    (Namespace, Domain, L2,
     L1) = (NamespaceEtc['namespace'], NamespaceEtc['domain'],
            NamespaceEtc['l2'], NamespaceEtc['l1'])
    log.print_log_message([
        'load_tables_succeeded', {
            'namespace': Namespace,
            'domain': Domain,
            'l2': L2,
            'l1': L1
        }
    ])
    log.print_log_message(['load_robust_matching_tables', RobustMatchFile])
    lgm_tables.load_data(RobustMatchFile, Namespace)
    log.print_log_message(
        ['load_robust_matching_tables_succeeded', RobustMatchFile, Namespace])
    #add_regularised_keys_to_sent_atom_namespace_lf_l1_text(Namespace, Domain)
    State = initial_state()
    process_call_message(
        ['set_namespace_domain_and_language', Namespace, Domain, L1], State)
    import_course_info_into_state(State)
    #State['l2'] = L2
    FirstLesson = get_available_lessons(State)['lessons'][0]
    AbstractAction = process_call_message(['set_lesson', FirstLesson], State)
    InitialAction = output_manager.abstract_call_action_to_action(
        AbstractAction, L1, L2)
    if 'text_to_repeat' in InitialAction:
        State['text_to_repeat'] = InitialAction['text_to_repeat']
    output_manager.prepend_invocation_name_to_action_text(InitialAction, State)
    DontUnderstandAction = output_manager.dont_understand_action(L1, L2, State)
    log.print_log_message([
        'initialised', {
            'state': State,
            'initial_action': InitialAction,
            'dont_understand_action': DontUnderstandAction
        }
    ])
    return (State, InitialAction, DontUnderstandAction)
예제 #3
0
def load_babeldr_english():
    lgm_tables.load_data(babeldr_eng2_parser_tables, 'babeldr_eng2')
    lgm_tables.load_translation_file_data(babeldr_eng2_translation_tables,
                                          'babeldr_eng2')
    lgm_tables.load_tts_file_data(babeldr_eng2_tts_tables, 'babeldr_eng2')
예제 #4
0
def load_babeldr_small():
    lgm_tables.load_data(
        'c:/cygwin64/home/speech/medslt-code/trunk/medslt2/fre/generatedfiles/babeldr_tmp_python_tables_small.data.gz',
        'babeldr')
예제 #5
0
def load_babeldr_french():
    lgm_tables.load_data(babeldr_parser_tables, 'babeldr')
    lgm_tables.load_translation_file_data(babeldr_translation_tables,
                                          'babeldr')
    lgm_tables.load_tts_file_data(babeldr_audio_tables, 'babeldr')