The following example lets \phraselabel look ahead, whether a comma or period is following. If the punctuation char is found, it is read as argument and put behind the word.
The first line of the example uses the boxed version, but the punctuation char is left outside, because it does not belong to the word. For the case, the punctuation char should be inside the box or the boxes are just for debugging, the second line shows the simplified version without boxes.
Another feature is implemented, the handling of the space factor. In order to add a larger space after full stops with \nonfrenchspacing, TeX keeps track of a space factor. The example saves the space factor after the word inside the node and restores it after the tikzpicture. See the larger space between "cc." and "New".
Full example:
\documentclass{article}
\usepackage{ltxcmds}
\usepackage{tikz}
\newlength{\Aheight}
\setlength{\Aheight}{\fontcharht\font`A}
\makeatletter
\newcommand{\phraselabel}[2]{%
\ltx@ifnextchar@nospace,{\@phraselabel{#1}{#2}}{%
\ltx@ifnextchar@nospace.{\@phraselabel{#1}{#2}}{%
\ltx@ifnextchar@nospace;{\@phraselabel{#1}{#2}}{%
\ltx@ifnextchar@nospace!{\@phraselabel{#1}{#2}}{%
\ltx@ifnextchar@nospace?{\@phraselabel{#1}{#2}}{%
\@phraselabel{#1}{#2}{}%
}}}}}%
}
\newcommand*{\@phraselabel}[3]{%
\begin{tikzpicture}[%
baseline = (word.base),
txt/.style = {inner sep = 0pt, text height = \Aheight, draw},
above/.style = {inner sep = 0pt, text depth = 0pt, draw}%
]
\node[txt] (word) {#1\phrase@save@spacefactor};
\ifx\\#3\\
\else
\node[anchor=base, right, inner sep=0pt]
at (word.base east)
{\phrase@set@spacefactor#3\phrase@save@spacefactor};
\fi
\node[above] at (word.north) {\footnotesize{#2}};
\end{tikzpicture}%
\phrase@set@spacefactor
}
\newcount\phrase@spacefactor
\newcommand*{\phrase@save@spacefactor}{%
\global\phrase@spacefactor=\spacefactor
}
\newcommand*{\phrase@set@spacefactor}{%
\spacefactor=\phrase@spacefactor
}
\makeatother
\begin{document}
% With boxes
\phraselabel{aa}{xxxxx}
\phraselabel{bb}{yyyyy},
\phraselabel{cc}{zzzzz}.
\phraselabel{New}{xxxxx}
\phraselabel{sentence}{yyyyy}.
% Without boxes
\makeatletter
\renewcommand*{\@phraselabel}[3]{%
\begin{tikzpicture}[%
baseline = (word.base),
txt/.style = {inner sep = 0pt, text height = \Aheight},
above/.style = {inner sep = 0pt, text depth = 0pt}%
]
\node[txt] (word) {#1#3\phrase@save@spacefactor};
\node[above] at (word.north) {\footnotesize{#2}};
\end{tikzpicture}%
\phrase@set@spacefactor
}
\makeatother
\phraselabel{aa}{xxxxx}
\phraselabel{bb}{yyyyy},
\phraselabel{cc}{zzzzz}.
\phraselabel{New}{xxxxx}
\phraselabel{sentence}{yyyyy}.
\end{document}

Remark:
\ltx@ifnextchar@nospace of package ltxcmds is used for the look ahead. In contrary to LaTeX's \@ifnextchar, it does not gobble spaces, when looking ahead.
bb? – Sigur Apr 10 '15 at 20:53