public float length(int u,int v){
  if (u == v)   return 0;
 else   return 1f / (v - u);
}

public float length ( int u , int v ) { if ( u == v ) return 0 ; else return 1f / ( v - u ) ; }
the length between two nodes u and v . in a phrase graph , this length is equal to 1 . 0 / ( v - u ) .
