4. In a regular nonagon $A B C D E F G H I$, if the diagonal $A E=2$, then $A B+A C=(\quad)$.
(A) $\sqrt{3}$
(B) 2
(C) $\frac{3}{2}$
(D) $\frac{5}{2}$
4. B.

As shown in Figure 5, connect $A D$, and extend $A C$ to point $M$ such that $C M=A B$.

In the regular nonagon $ABCDEFGHI$, we have
$$
\begin{array}{l}
\angle A B C \\
=\frac{(9-2) \times 180^{\circ}}{9} \\
=140^{\circ},
\end{array}
$$

thus $\angle A C B=20^{\circ}$.
Therefore, $\angle A C D=140^{\circ}-20^{\circ}=120^{\circ}$.
Hence, $\angle D C M=60^{\circ}$, and $\triangle C D M$ is an equilateral triangle.
Thus, $D M=D E$.
Also, $\angle A E D=\angle B A E=3 \angle A C B=60^{\circ}$, so $\triangle A D M \cong \triangle A D E \Rightarrow A M=A E=2$.
Therefore, $A B+A C=2$.