pub fn realize_into_assoc_strengths(
        &self,
        state: &ParserState,
        non_lookup_slice: &mut [f32],
        attachment_addrs: &[AttachmentAddr],
    ) {
        if let Some(deprel_layer) = self.layer_lookups.layer_lookup(Layer::DepRel) {
            let deprels = deprel_layer.lookup_values();

            for (idx, (addr, deprel)) in
                iproduct!(attachment_addrs.iter(), deprels.iter()).enumerate()
            {
                let addr_head = addr::AddressedValue {
                    address: vec![addr.head],
                    layer: addr::Layer::Token,
                };
                let addr_dependent = addr::AddressedValue {
                    address: vec![addr.dependent],
                    layer: addr::Layer::Token,
                };
                let addr_head_pos = addr::AddressedValue {
                    address: vec![addr.head],
                    layer: addr::Layer::Tag,
                };
                let addr_dependent_pos = addr::AddressedValue {
                    address: vec![addr.dependent],
                    layer: addr::Layer::Tag,
                };
                let head = addr_head.get(state);
                let dependent = addr_dependent.get(state);
                let head_pos = addr_head_pos.get(state);
                let dependent_pos = addr_dependent_pos.get(state);

                if let (Some(head), Some(dependent), Some(head_pos), Some(dependent_pos)) =
                    (head, dependent, head_pos, dependent_pos)
                {
                    let association =
                        self.assoc_strength(&head, &dependent, &head_pos, &dependent_pos, &deprel);
                    non_lookup_slice[idx] = association;
                }
            }
        }
    }
/// Vectorize a parser state into the given association measure slices.
///
/// Add to `non_lookup_slice` the association measure between all parser state addresses
/// undergoing attachment. Consider all possible dependency relations.
Vectorize a parser state into the given association measure slices.
Add to `non_lookup_slice` the association measure between all parser state addresses
undergoing attachment. Consider all possible dependency relations.
Vectorize a parser state into the given association measure slices . Add to ` non_lookup_slice ` the association measure between all parser state addresses undergoing attachment . Consider all possible dependency relations .
pub fn realize_into_assoc_strengths(
        &self,
        state: &ParserState,
        non_lookup_slice: &mut [f32],
        attachment_addrs: &[AttachmentAddr],
    ) {
        if let Some(deprel_layer) = self.layer_lookups.layer_lookup(Layer::DepRel) {
            let deprels = deprel_layer.lookup_values();
            for (idx, (addr, deprel)) in
                iproduct!(attachment_addrs.iter(), deprels.iter()).enumerate()
            {
                let addr_head = addr::AddressedValue {
                    address: vec![addr.head],
                    layer: addr::Layer::Token,
                };
                let addr_dependent = addr::AddressedValue {
                    address: vec![addr.dependent],
                    layer: addr::Layer::Token,
                };
                let addr_head_pos = addr::AddressedValue {
                    address: vec![addr.head],
                    layer: addr::Layer::Tag,
                };
                let addr_dependent_pos = addr::AddressedValue {
                    address: vec![addr.dependent],
                    layer: addr::Layer::Tag,
                };
                let head = addr_head.get(state);
                let dependent = addr_dependent.get(state);
                let head_pos = addr_head_pos.get(state);
                let dependent_pos = addr_dependent_pos.get(state);
                if let (Some(head), Some(dependent), Some(head_pos), Some(dependent_pos)) =
                    (head, dependent, head_pos, dependent_pos)
                {
                    let association =
                        self.assoc_strength(&head, &dependent, &head_pos, &dependent_pos, &deprel);
                    non_lookup_slice[idx] = association;
                }
            }
        }
    }
pub fn realize_into_assoc_strengths ( & self , state : & ParserState , non_lookup_slice : & mut [ f32 ] , attachment_addrs : & [ AttachmentAddr ] , ) { if let Some ( deprel_layer ) = self . layer_lookups . layer_lookup ( Layer :: DepRel ) { let deprels = deprel_layer . lookup_values ( ) ; for ( idx , ( addr , deprel ) ) in iproduct ! ( attachment_addrs iter ( ) deprels iter ( ) ) . enumerate ( ) { let addr_head = addr :: AddressedValue { address : vec ! [ addr head ] , layer : addr :: Layer :: Token , } ; let addr_dependent = addr :: AddressedValue { address : vec ! [ addr dependent ] , layer : addr :: Layer :: Token , } ; let addr_head_pos = addr :: AddressedValue { address : vec ! [ addr head ] , layer : addr :: Layer :: Tag , } ; let addr_dependent_pos = addr :: AddressedValue { address : vec ! [ addr dependent ] , layer : addr :: Layer :: Tag , } ; let head = addr_head . get ( state ) ; let dependent = addr_dependent . get ( state ) ; let head_pos = addr_head_pos . get ( state ) ; let dependent_pos = addr_dependent_pos . get ( state ) ; if let ( Some ( head ) , Some ( dependent ) , Some ( head_pos ) , Some ( dependent_pos ) ) = ( head , dependent , head_pos , dependent_pos ) { let association = self . assoc_strength ( & head , & dependent , & head_pos , & dependent_pos , & deprel ) ; non_lookup_slice [ idx ] = association ; } } } }
Vectorize a parser state into the given association measure slices.
Vectorize a parser state into the given association measure slices .
&self
state
&ParserState
non_lookup_slice
&mut [f32]
attachment_addrs
&[AttachmentAddr]
&self
state
&ParserState
non_lookup_slice
&mut [f32]
attachment_addrs
&[AttachmentAddr]