  We determine the Weierstrass semigroup at one and two totally ramified places
in a Kummer extension defined by the affine equation $y^{m}=\prod_{i=1}^{r}
(x-\alpha_i)^{\lambda_i}$ over $K$, the algebraic closure of $\mathbb{F}_q$,
where $\alpha_1, \dots, \alpha_r\in K$ are pairwise distinct elements, and
$\gcd(m, \sum_{i=1}^{r}\lambda_i)=1$. For an arbitrary function field, from the
knowledge of the minimal generating set of the Weierstrass semigroup at two
rational places, the set of pure gaps is characterized. We apply these results
to construct algebraic geometry codes over certain function fields with many
rational places.
