def find_term(node, tokenL ):
    """ Given a trie, rooted on 'node', locate a matching term beginning on the first token in 'tokenL'
    Returns (matchNode,term_fl) where 'matchNode' is the node matching the last matched token
    and 'term_fl' is true if a complete term was matched. 
    """
    
    matchNode = None
    for token in tokenL:
        if token not in node['children']:
            break

        matchNode = node = node['children'][token]

        
    return (matchNode['value'], matchNode['term_fl']) if matchNode else (None,False)