For functions and algorithm in semi-automatic Thai spoonerism, the research has developed the program by PHP language utilizing algorithm structure in order to analyze the elements of syllables; moreover, the principle of probability was brought to establish rules and mechanisms in spoonerism which could specify conditions as follows: