The intuition behind including the index is that path parameters usually appear after certain common elements, such as base paths and top-level action paths.
We include the Shannon entropy as a metric assessing the randomness of the characters in a path element: for fixed paths, API designers typically pick simple English words or phrases, which have a low character entropy.
Random or long identifiers, on the other hand, have a high character entropy.