mflbackend/src/handleparadigms.py
def remove_paradigm(lexicon, paradigm, paradigms, pos):
    """
    Remove a  paradigm  (update language model, delete from karp)
    Args:
        lexicon (str): the lexicon name
        paradigm (obj): the paradigm (Paradigm.py)
        paradigms (dict): a dictionary with all paradigms
            '{"lexname": {"nn": [], "vb": []}'
        pos (str): the tables word class
    """
    helpers.karp_delete(paradigm.uuid, lexconfig.get_paradigmlexicon(lexicon))
    lresource = lexconfig.get_lexiconname(lexicon)
    all_paras, numex, lms, alpha = paradigms[lresource].get(pos, ({}, 0, None))
    del all_paras[paradigm.uuid]
    del lms[paradigm.uuid]
    alpha = mp.paradigms_to_alphabet(all_paras.values())
    # update the internal model, save the recomputed alphabet
    paradigms[lresource][pos] = all_paras, numex-1, lms, alpha

    Remove a  paradigm  (update language model, delete from karp)
    Args:
        lexicon (str): the lexicon name
        paradigm (obj): the paradigm (Paradigm.py)
        paradigms (dict): a dictionary with all paradigms
            '{"lexname": {"nn": [], "vb": []}'
        pos (str): the tables word class
    
Remove a  paradigm  (update language model, delete from karp)
Remove a paradigm ( update language model delete from karp )
def remove_paradigm(lexicon, paradigm, paradigms, pos):
    helpers.karp_delete(paradigm.uuid, lexconfig.get_paradigmlexicon(lexicon))
    lresource = lexconfig.get_lexiconname(lexicon)
    all_paras, numex, lms, alpha = paradigms[lresource].get(pos, ({}, 0, None))
    del all_paras[paradigm.uuid]
    del lms[paradigm.uuid]
    alpha = mp.paradigms_to_alphabet(all_paras.values())
    paradigms[lresource][pos] = all_paras, numex-1, lms, alpha
def remove_paradigm ( lexicon , paradigm , paradigms , pos ) : helpers . karp_delete ( paradigm . uuid , lexconfig . get_paradigmlexicon ( lexicon ) ) lresource = lexconfig . get_lexiconname ( lexicon ) all_paras , numex , lms , alpha = paradigms [ lresource ] . get ( pos , ( { } , 0 , None ) ) del all_paras [ paradigm . uuid ] del lms [ paradigm . uuid ] alpha = mp . paradigms_to_alphabet ( all_paras . values ( ) ) paradigms [ lresource ] [ pos ] = all_paras , numex - 1 , lms , alpha
Remove a  paradigm  (update language model, delete from karp)
Remove a paradigm ( update language model delete from karp )
"""
    Remove a  paradigm  (update language model, delete from karp)
    Args:
        lexicon (str): the lexicon name
        paradigm (obj): the paradigm (Paradigm.py)
        paradigms (dict): a dictionary with all paradigms
            '{"lexname": {"nn": [], "vb": []}'
        pos (str): the tables word class
    """ # update the internal model, save the recomputed alphabet
lexicon
the lexicon name
the lexicon name
paradigm
the paradigm (Paradigm.py)
the paradigm ( Paradigm . py )
paradigms
a dictionary with all paradigms
'{"lexname": {"nn": [], "vb": []}'
a dictionary with all paradigms ' { " lexname " : { " nn " : [] " vb " : [] } '
pos
the tables word class
the tables word class