fn relative_dependent_position(indices: &[usize], head: usize, dependent: usize) -> isize {
        let mut head_position = indices
            .binary_search(&head)
            .expect("Head is missing in sorted POS tag list");

        let dependent_position = match indices.binary_search(&dependent) {
            Ok(idx) => idx,
            Err(idx) => {
                // The head moves one place if the dependent is inserted
                // before the head. Consider e.g. the indices
                //
                // [3, 6, 9]
                //     ^--- insertion point of 4.
                //
                // Suppose that we want to compute the relative
                // position of 4 to its head 9 (position 2). The
                // insertion point is 1. When computing the relative
                // position, we should take into account that 4 lies
                // before 6.
                if dependent < head {
                    head_position += 1;
                }
                idx
            }
        };

        head_position as isize - dependent_position as isize
    }
/// Find the relative position of a dependent to a head.
///
/// This methods finds the relative position of `dependent` to
/// `head` in `indices`.
Find the relative position of a dependent to a head.
Find the relative position of a dependent to a head .
fn relative_dependent_position(indices: &[usize], head: usize, dependent: usize) -> isize {
        let mut head_position = indices
            .binary_search(&head)
            .expect("Head is missing in sorted POS tag list");
        let dependent_position = match indices.binary_search(&dependent) {
            Ok(idx) => idx,
            Err(idx) => {
                // The head moves one place if the dependent is inserted
                // before the head. Consider e.g. the indices
                //
                // [3, 6, 9]
                //     ^--- insertion point of 4.
                //
                // Suppose that we want to compute the relative
                // position of 4 to its head 9 (position 2). The
                // insertion point is 1. When computing the relative
                // position, we should take into account that 4 lies
                // before 6.
                if dependent < head {
                    head_position += 1;
                }
                idx
            }
        };
        head_position as isize - dependent_position as isize
    }
fn relative_dependent_position ( indices : & [ usize ] , head : usize , dependent : usize ) -> isize { let mut head_position = indices . binary_search ( & head ) . expect ( " " ) ; let dependent_position = match indices . binary_search ( & dependent ) { Ok ( idx ) => idx , Err ( idx ) => { // The head moves one place if the dependent is inserted // before the head. Consider e.g. the indices // // [3, 6, 9] //     ^--- insertion point of 4. // // Suppose that we want to compute the relative // position of 4 to its head 9 (position 2). The // insertion point is 1. When computing the relative // position, we should take into account that 4 lies // before 6. if dependent < head { head_position += 1 ; } idx } } ; head_position as isize - dependent_position as isize }
Find the relative position of a dependent to a head.
Find the relative position of a dependent to a head .
indices
&[usize]
head
usize
dependent
usize