Spectral Learning of General Weighted Automata via Constrained Matrix Completion