def set_item_in_dict(dictionary, item, value):
    """
    Set dictionary item from a dotted-word.

    >>> d = {"x": 1}
    >>> get_item_in_dict(d, "x")
    1
    >>> set_item_in_dict(d, "x", 2)
    >>> get_item_in_dict(d, "x")
    2
    >>> d2 = {"x": {"y": 42}}
    >>> get_item_in_dict(d2, "x.y")
    42
    >>> set_item_in_dict(d2, "x.y", 43)
    >>> get_item_in_dict(d2, "x.y")
    43
    """
    current = dictionary
    words = item.split('.')
    for word in words[:-1]:
        current = current[word]
    current[words[-1]] = value
