The function works correctly for all inputs except "Bear". There might be a special case for the letter "B" or a bug in the function implementation that causes the incorrect output for "Bear". The domain of the function where the rule applies is all words that do not contain the letter "B".