Make two functions to get term/doc occurrences rather than one.