def get_part_of_speech(s):
    """
    Detect part-of-speech encoding from an entity string, if present.
    :param s: Entity string
    :return: part-of-speech encoding
    """
    tokens = s.split("/")
    if len(tokens) <= 4:
        return ""

    pos_enc = tokens[4]
    if pos_enc == "n" or pos_enc == "a" or pos_enc == "v" or pos_enc == "r":
        return pos_enc
    return ""