mflbackend/src/backend.py
def update_table():
    """
    Update the  inflection table of a word.
    Also update/add the corresponding paradigm, and remove the word
    from the old paradigm.
    """
    identifier = request.args.get('identifier', '')
    lexicon = request.args.get('lexicon', C.config['default'])
    lexconf = lexconfig.get_lexiconconf(lexicon)
    pos = helpers.read_one_pos(lexconf)
    old_para = helpers.get_current_paradigm(identifier, pos, lexconf, paradigmdict)
    table = request.args.get('table', '')
    paradigm = request.args.get('paradigm', '')
    baseform = request.args.get('baseform', '')
    classes = request.args.get('class', '') or request.args.get('classes', '')
    is_new = request.args.get('new')
    is_new = is_new in ['True', 'true', True]

    # remove from the old paradigm
    handle.remove_word_from_paradigm(lexicon, old_para, paradigmdict, identifier, pos)

    # make inflection, assign to the new paradigm
    res = handle.make_new_table(lexicon, table, paradigm, paradigmdict,
                                identifier, baseform, pos, classes,
                                newpara=is_new)
    identifier, wf_table, para, v, classes = res

    # ask karp for the word's ID
    karp_id = helpers.get_es_identifier(identifier,
                                        lexconf['identifier'],
                                        lexconf['lexiconName'],
                                        lexconf['lexiconMode'])
    # save the inflection table in karp
    helpers.karp_update(karp_id, wf_table, resource=lexconf['lexiconName'])
    return jsonify({'paradigm': para.name, 'identifier': identifier,
                    'var_inst': dict(enumerate(v, 1)), 'classes': classes,
                    'pattern': para.jsonify(), 'partOfSpeech': pos,
                    'members': para.count})

    Update the  inflection table of a word.
    Also update/add the corresponding paradigm, and remove the word
    from the old paradigm.
    
Update the  inflection table of a word.
Also update/add the corresponding paradigm, and remove the word
from the old paradigm.
Update the inflection table of a word . Also update / add the corresponding paradigm and remove the word from the old paradigm .
def update_table():
    identifier = request.args.get('identifier', '')
    lexicon = request.args.get('lexicon', C.config['default'])
    lexconf = lexconfig.get_lexiconconf(lexicon)
    pos = helpers.read_one_pos(lexconf)
    old_para = helpers.get_current_paradigm(identifier, pos, lexconf, paradigmdict)
    table = request.args.get('table', '')
    paradigm = request.args.get('paradigm', '')
    baseform = request.args.get('baseform', '')
    classes = request.args.get('class', '') or request.args.get('classes', '')
    is_new = request.args.get('new')
    is_new = is_new in ['True', 'true', True]
    handle.remove_word_from_paradigm(lexicon, old_para, paradigmdict, identifier, pos)
    res = handle.make_new_table(lexicon, table, paradigm, paradigmdict,
                                identifier, baseform, pos, classes,
                                newpara=is_new)
    identifier, wf_table, para, v, classes = res
    karp_id = helpers.get_es_identifier(identifier,
                                        lexconf['identifier'],
                                        lexconf['lexiconName'],
                                        lexconf['lexiconMode'])
    helpers.karp_update(karp_id, wf_table, resource=lexconf['lexiconName'])
    return jsonify({'paradigm': para.name, 'identifier': identifier,
                    'var_inst': dict(enumerate(v, 1)), 'classes': classes,
                    'pattern': para.jsonify(), 'partOfSpeech': pos,
                    'members': para.count})
def update_table ( ) : identifier = request . args . get ( 'identifier' , '' ) lexicon = request . args . get ( 'lexicon' , C . config [ 'default' ] ) lexconf = lexconfig . get_lexiconconf ( lexicon ) pos = helpers . read_one_pos ( lexconf ) old_para = helpers . get_current_paradigm ( identifier , pos , lexconf , paradigmdict ) table = request . args . get ( 'table' , '' ) paradigm = request . args . get ( 'paradigm' , '' ) baseform = request . args . get ( 'baseform' , '' ) classes = request . args . get ( 'class' , '' ) or request . args . get ( 'classes' , '' ) is_new = request . args . get ( 'new' ) is_new = is_new in [ 'True' , 'true' , True ] handle . remove_word_from_paradigm ( lexicon , old_para , paradigmdict , identifier , pos ) res = handle . make_new_table ( lexicon , table , paradigm , paradigmdict , identifier , baseform , pos , classes , newpara = is_new ) identifier , wf_table , para , v , classes = res karp_id = helpers . get_es_identifier ( identifier , lexconf [ 'identifier' ] , lexconf [ 'lexiconName' ] , lexconf [ 'lexiconMode' ] ) helpers . karp_update ( karp_id , wf_table , resource = lexconf [ 'lexiconName' ] ) return jsonify ( { 'paradigm' : para . name , 'identifier' : identifier , 'var_inst' : dict ( enumerate ( v , 1 ) ) , 'classes' : classes , 'pattern' : para . jsonify ( ) , 'partOfSpeech' : pos , 'members' : para . count } )
Update the  inflection table of a word.
Update the inflection table of a word .
"""
    Update the  inflection table of a word.
    Also update/add the corresponding paradigm, and remove the word
    from the old paradigm.
    """ # remove from the old paradigm # make inflection, assign to the new paradigm # ask karp for the word's ID # save the inflection table in karp