Split DocumentFrequency toFile into toFile and toString.