Encoding Undirected And Semi-Directed Binary Phylogenetic Networks By Quarnets