Pig Latin Punctuation
<p>I have a file which takes the text of another file and converts it to pig latin, and it works fine, except that punctuation in words like:</p>

<p><code>what's</code> becomes <code>atwhay'say</code> instead of what I want which would be for</p>

<p><code>what's</code> to become <code>at'swhay</code>.</p>

<p>Code:</p>

<pre><code>echo $(
for i in `cat $1`
do
    if [[ $i =~ ^[B-DF-HJ-NP-TV-XZ] ]]
    then
        echo $i | sed -e 's/\(\&lt;[B-DF-HJ-NP-TV-XZ]\+\)\([[:alpha:]]\)\([[:alpha:]]*\&gt;\)/\U\2\L\3\L\1ay/g'
    elif [[ $i =~ ^[b-df-hj-np-tv-xz] ]]
    then    
        echo $i | sed -e 's/\(\&lt;[b-df-hj-np-tv-xz]\+\)\([[:alpha:]]*\&gt;\)/\2\1ay/g'
    else
        echo $i | sed -e 's/\(\&lt;[[:alpha:]]*\&gt;\)/\1yay/g'
    fi
done
)
</code></pre>

<p>Thanks to anyone who can help me with this punctuation error</p>