def kindint(knd, numkind):
    """
    >>> kindint('Tex',langkindnum['de'])
    1
    >>> kindint('meta',langkindnum['en'])
    19
    >>> kindint(9,langkindnum['en'])
    9
    """
    try:
        return int(knd)
    except:
        try:
            return numkind[knd]
        except:
            for k in numkind:
                if knd in k:
                    return numkind[k]
            return -1
