Their legality is very questionable given all the likely copyright infringement going on, and a state can't really ignore that.
(Of course states can ignore copyright in a legally polite manner, such as asserting that training on all published material in the National Library is fair game)