There is no official 'rule'. In the two words you mention, the words function like consonants in that, if they are preceded by an indefinite article, it must be 'a' not 'an'. However, to a phonetician, they are very close to vowels in that there is no obstruction in the air-flow when they are produced. DSme resolve this problem by calling them semi-vowels.
- For Teachers