def from_text(text):
    """Convert text into an rcode.

    @param text: the texual rcode
    @type text: string
    @raises UnknownRcode: the rcode is unknown
    @rtype: int
    """

    if text.isdigit():
        v = int(text)
        if v >= 0 and v <= 4095:
            return v
    v = _by_text.get(text.upper())
    if v is None:
        raise UnknownRcode
    return v
Convert text into an rcode.

    @param text: the texual rcode
    @type text: string
    @raises UnknownRcode: the rcode is unknown
    @rtype: int