Instead of assigning different ranks to the neighbouring terms with the same document frequency, we implement some extra operations to make their ranks the same.
for the terms with the same document frequency, i.e., the terms with indices from i to j, we assign the same average rank i+j 2 to all of these, such that this does not affect the rank of any other term.