#R, 96 95 bytes
R, 96 95 bytes
function(x,d=diff(rle(utf8ToInt(x))$v))if(any(d>0)&any(d<0)|sum(1|d)<2)3 else`if`(all(d<1),2,1) Returns:
1for wavy and raising2for wavy and decreasing3for non-wavy
Explained
d=diff(rle(utf8ToInt(x))$v): Generates a variabledby first converting the string into it'sASCIIvalues usingutf8ToIntwhich conveniently returns a vector. Subsequently perform run length encoding usingrle.rle(...)$vreturns the non-repeating values of the sequence (i.e. collapsing all runs). Finally take the difference.if(any(d>0)&any(d<0)|sum(1|d)<2)3: If at least one of the differences are positive and at least one negative, or if the difference sequence has less than2elements (equivalent to the original word having less than 3 characters), the word is non-wavy and return3else``if``(all(d<1),2,1): Else if all differences are negative, return2for wavy and decreasing, else return1for wavy and raising.
Try all the test cases at R-fiddle (note that it's named such that it can be vectorized for the test cases).