Variable names should be all lower case in Xapian code (a "camelcase" name like `TermFrequency` signifies a class).  If you're implementing a standard formula, it's acceptable to use something like `N` to correspond more closely with the variable in the formula if it makes the code easier to follow, but for `TermFrequency` that's certainly not the case.  We usually use `tf` or `termfreq` so they're good choices for consistency.