Small refactoring of SYAlgo.
Complete 'createTag' function.  This may be optimized in the future
with some regular expressions.