This paper presents an efficient approach to query reformulation and spelling error correction using a log-linear model for string transformation. The proposed method generates the top k most relevant output strings, enhancing accuracy and efficiency in handling queries for web search. Experimental results demonstrate significant improvements over previous techniques in correcting spelling errors and reformulating queries.