( ( Like charges ) ( ( ( ( ( repel ( each ( other while ) ) ) ( ( ( opposite charges ) , ) ( such ( as ( ( protons and ) electrons ) ) ) ) ) , ) ( attract ( one another ) ) ) . ) )
(ROOT (SINV (PP (IN Like) (NP (NNS charges))) (VP (VBP repel) (NP (DT each) (JJ other) (NN while))) (NP (NP (JJ opposite) (NNS charges)) (, ,) (PP (JJ such) (IN as) (NP (NNS protons) (CC and) (NNS electrons)))) (, ,) (S (VP (VB attract) (NP (CD one) (DT another)))) (. .)))
Like charges repel each other while opposite charges, such as protons and electrons, attract one another.
(ROOT (S (NP (JJ Opposite) (NNS charges)) (VP (VBP attract) (NP (CD one) (DT another))) (. .)))