mflbackend/src/backend.py
def add_table():
    """
    Add a word (an inflection table).
    Also update/add the corresponding paradigm.
    """
    lexicon = request.args.get('lexicon', C.config['default'])
    lexconf = lexconfig.get_lexiconconf(lexicon)
    pos = helpers.read_one_pos(lexconf)
    table = request.args.get('table', '')
    paradigm = request.args.get('paradigm', '')
    identifier = request.args.get('identifier', '')
    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]

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

    # add the inflection to karp
    helpers.karp_add(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})

    Add a word (an inflection table).
    Also update/add the corresponding paradigm.
    
Add a word (an inflection table).
Also update/add the corresponding paradigm.
Add a word ( an inflection table ) . Also update / add the corresponding paradigm .
def add_table():
    lexicon = request.args.get('lexicon', C.config['default'])
    lexconf = lexconfig.get_lexiconconf(lexicon)
    pos = helpers.read_one_pos(lexconf)
    table = request.args.get('table', '')
    paradigm = request.args.get('paradigm', '')
    identifier = request.args.get('identifier', '')
    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]
    res = handle.make_new_table(lexicon, table, paradigm, paradigmdict,
                                identifier, baseform, pos, classes,
                                newword=True, newpara=is_new)
    identifier, wf_table, para, v, classes = res
    helpers.karp_add(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 add_table ( ) : lexicon = request . args . get ( 'lexicon' , C . config [ 'default' ] ) lexconf = lexconfig . get_lexiconconf ( lexicon ) pos = helpers . read_one_pos ( lexconf ) table = request . args . get ( 'table' , '' ) paradigm = request . args . get ( 'paradigm' , '' ) identifier = request . args . get ( 'identifier' , '' ) 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 ] res = handle . make_new_table ( lexicon , table , paradigm , paradigmdict , identifier , baseform , pos , classes , newword = True , newpara = is_new ) identifier , wf_table , para , v , classes = res helpers . karp_add ( 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 } )
Add a word (an inflection table).
Add a word ( an inflection table ) .
"""
    Add a word (an inflection table).
    Also update/add the corresponding paradigm.
    """ # make inflection, assign to the paradigm # add the inflection to karp