Mapping between integer and pronounceable word Purpose

The idea is to provide the code necessary to map a 32-bit integer to/from a pronouncable word of 9 characters maximum. That could be useful, for example, to make a serial number easier to remember, or type in a form.

Both the method for translating an integer to the corresponding word and for translating back a word to the corresponding integer are required.

Rules

There must be a one-to-one mapping between integers and words, and the whole set of 32-bit integers (or, put in another way, any integer from 0 to 4294967295) must be mappable. Although, obviously, not all words will be meaningful, and inputting words that don't map to an integer may have unspecified behavior.

You are free to decide on exactly which set of "pronouncable" words is meaningful, and how the mapping is done, but words must at least follow these rules:


Only the basic 26 letters (A...Z) should be used as characters. Accents, casing, etc... should not be used to extend the possible combinations.
9 characters maximum per word.
two consonants (BCDFGHJKLMNPQRSTVWXZ - 20 possiblities) should not be placed next to each other (they must be surrounded by vowels).
two vowels (AEIOUY - 6 possibilities) should not be placed next to each other (they must be surrounded by consonants).


Note: the simplest scheme where you have all words constructed as CVCVCVCVC (C being a consonant and V a vowel) gives 4147200000 combinations, and a 32 bit integer has 4294967296 possible values, so it is not enough. You need to expand the number of combinations, either by allowing shorter words, or by allowing VCVCVCVCV combinations, as well.

Other standard rules apply, and standard loopholes are forbidden.

Inputs/Outputs

For each submission, two pieces of code must be provided:


One that takes an integer as argument/input and returns/prints the corresponding word
One that takes a word as argument/input and returns/prints the corresponding integer


Alternatively, you can choose to submit a single piece of code that handles both operations:


When given an integer as an input, it outputs the corresponding word
When given a string as an input, it outputs the corresponding integer


Winning condition

This is a code-golf, the answer which has the fewest bytes (when summing both pieces of code, for solutions opting for the separated pieces of code) wins.
PHP, 353 Bytes

Encoding + Decoding

is_numeric($argn) contains the boolean. It is true if the input is an integer.

$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);sort($c);if(is_numeric($a=$argn)){$r=($a)%26&lt;6?$v[$a%26]:$c[$a%26-6];$a=$a/26^0;while($a){$z=count($t=in_array($r[0],$v)?$c:$v);$r=$t[$n=$a%$z].$r;$a=$a/$z^0;}echo$r;}else{for($p=1;$i++&lt;strlen($a);){$u=($b=in_array($a[-$i],$c))?$c:$v;$s+=array_flip($u)[$a[-$i]]*$p+($b&amp;$i&lt;2?6:0);$p*=$i&gt;1?count($u):26;}echo$s;}


PHP, 190 Bytes (Encode) + 195 Byte (Decode) = 385 Bytes

Encoding

$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);sort($c);$r=($a=$argn)%26&lt;6?$v[$a%26]:$c[$a%26-6];$a=$a/26^0;while($a){$z=count($t=in_array($r[0],$v)?$c:$v);$r=$t[$n=$a%$z].$r;$a=$a/$z^0;}echo$r;


5391360000=26*120**4 combinations are available

Online Version Encoding without E_NOTICE

Expanded

$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);
sort($c); # End of Prepare the two array
$r=($a=$argn)%26&lt;6?$v[$a%26]:$c[$a%26-6]; #base 26 decision input mod 26 &lt;6 end with vowel
$a=$a/26^0; #integer division input with 26
while($a){
    $z=count($t=in_array($r[0],$v)?$c:$v); # use vowel if last entry is consonant and viceversa
    $r=$t[$n=$a%$z].$r; # base 6 or base 20 decision
    $a=$a/$z^0; # divide through base
}echo$r; # Output result


Input => Output

4294967296 =&gt; TYPYQACOV 
333 =&gt; DAT 
1 =&gt; E 
7 =&gt; C 
4294967276 =&gt; UTOPOQAMI


If you need always 9 Byte result please replace while($a) with while(strlen($r)&lt;9) + 10 Bytes

Decoding

$c=array_diff(range(A,Z),$v=[A,E,I,O,U,Y]);sort($c);for($p=1;$i++&lt;strlen($a=$argn);){$u=($b=in_array($a[-$i],$c))?$c:$v;$s+=array_flip($u)[$a[-$i]]*$p+($b&amp;$i&lt;2?6:0);$p*=$i&gt;1?count($u):26;}echo$s;


Expanded

$c=array_diff(range("A","Z"),$v=["A","E","I","O","U","Y"]);
sort($c); # End of Prepare the two array
for($p=1;$i++&lt;strlen($a=$argn);){ 
    $u=($b=in_array($a[-$i],$c))?$c:$v; # find use array for $a[-$i]
    $s+=array_flip($u)[$a[-$i]]*$p+($b&amp;$i&lt;2?6:0); # sum value
    $p*=$i&gt;1?count($u):26; # raise multiple for next item
}echo$s;


Input => Output

ABABABABE =&gt; 1
E =&gt; 1
UTOPOQAMI =&gt; 4294967276
BABABADAT =&gt; 333
DAT =&gt; 333
TYPYQACOV =&gt; 4294967296


Online Version Decoding without E_NOTICE

Additional Check

If we need a check if a string is valid.

Add $x.=$b?:0; in the end of the decoding loop + 10 Bytes

Replace echo$s; with echo!preg_match('#([01])\1$#',$x)?$s:_; + 32 Bytes