# JavaScript (ES6), <s>172</s> <s>169</s> 157 bytes *Saved 3 bytes thanks to @Neil* x=>x.match(/[\w'*]+|\s+/g).map(y=>y[0]==" "?y[1]:y==` `?". ":/\*/.test(y,l=y.match(/\w/g).length)?(i=l%2||2,""):(l+i*10+9+(i=0)).toString(36),i=0).join``+"." Can probably be further improved. Outputs in all lowercase.