If none of these rules applies, then retain the current position letter value. If the current position letter is equal to the last letter placed in the code then set the pointer to point to the next letter and go to step 5.The next character of the NYSIIS code is the current position letter.Increment the pointer to point at the next letter.Go to step 5. If the last character of the NYSIIS code is the letter 'S' then remove it. If the last two characters of the NYSIIS code are the letters 'AY' then replace them with the single character 'Y'. If the last character of the NYSIIS code is the letter 'A' then remove this letter. References External links USDA report with both the original NYSIIS procedure and a modified version NIST Dictionary of Algorithms and Data Structures entry, including pointers to several implementations Sample coder, using a variant of the algorithm Ruby Implementation C# Implementation PHP Implementation Phonetic algorithms