Ab initio calculations for molecular fragments from charge exchange processes: BF and BF+