A characterization of triple semigroup of ternary functions and Demorgan triple semigroup of ternary functions