code is able to parse characters and build dictionary of them