Further changes to the keyword resolution function, incorporating the keyword truncation feature.