pub struct StringDecompositionAutomaton { /* private fields */ }Expand description
Lazy CKY-style string decomposition automaton.
Implementations§
Source§impl StringDecompositionAutomaton
impl StringDecompositionAutomaton
Sourcepub fn new(concat: Symbol, sentence: Vec<Symbol>) -> Self
pub fn new(concat: Symbol, sentence: Vec<Symbol>) -> Self
Build a lazy decomposition automaton for sentence.
Sourcepub fn concat_symbol(&self) -> Symbol
pub fn concat_symbol(&self) -> Symbol
Return the concat operation symbol.
Sourcepub fn sentence(&self) -> &[Symbol]
pub fn sentence(&self) -> &[Symbol]
Return the sentence tokens (used by the obligatory-leaf F heuristic to build per-input terminal supply).
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Count explicit CKY-style decomposition rules without materializing them.
Trait Implementations§
Source§impl BottomUpTa for StringDecompositionAutomaton
impl BottomUpTa for StringDecompositionAutomaton
Source§impl Clone for StringDecompositionAutomaton
impl Clone for StringDecompositionAutomaton
Source§fn clone(&self) -> StringDecompositionAutomaton
fn clone(&self) -> StringDecompositionAutomaton
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CondensedTa for StringDecompositionAutomaton
impl CondensedTa for StringDecompositionAutomaton
Source§fn condensed_rules(&self, out: &mut dyn FnMut(&[Span], &SymbolSet, Span))
fn condensed_rules(&self, out: &mut dyn FnMut(&[Span], &SymbolSet, Span))
Enumerate every distinct
(children, result) pair, reporting the set of
symbols that have that shape. Read moreSource§impl Debug for StringDecompositionAutomaton
impl Debug for StringDecompositionAutomaton
Source§impl IntersectionHeuristic<StringDecompositionAutomaton> for SentenceSxHeuristic<'_>
impl IntersectionHeuristic<StringDecompositionAutomaton> for SentenceSxHeuristic<'_>
Source§fn outside_estimate(&self, left: StateId, span: &Span) -> f64
fn outside_estimate(&self, left: StateId, span: &Span) -> f64
Return an optimistic (admissible) upper bound in
(0, 1] on the best
outside weight of any completion around product state (left, right).Source§fn admits(&self, _left: StateId, _right: &R::State) -> bool
fn admits(&self, _left: StateId, _right: &R::State) -> bool
Sound hard filter consulted at candidate-construction time: return
false iff (left, right) provably has zero outside weight (it can
appear in no valid completion), so the A* loop may skip building the edge
entirely rather than merely deprioritizing it. Read moreSource§fn estimate_if_admitted(&self, left: StateId, right: &R::State) -> Option<f64>
fn estimate_if_admitted(&self, left: StateId, right: &R::State) -> Option<f64>
Return the outside estimate when the product is admitted, and
None
when it is provably unable to occur in an accepting derivation. Read moreSource§fn memoize_admission(&self) -> bool
fn memoize_admission(&self) -> bool
Whether A* should memoize the admission decision by product pair. Read more
Source§impl IntersectionHeuristic<StringDecompositionAutomaton> for ObligatoryLeafHeuristic<'_>
impl IntersectionHeuristic<StringDecompositionAutomaton> for ObligatoryLeafHeuristic<'_>
Source§fn outside_estimate(&self, left: StateId, span: &Span) -> f64
fn outside_estimate(&self, left: StateId, span: &Span) -> f64
Return an optimistic (admissible) upper bound in
(0, 1] on the best
outside weight of any completion around product state (left, right).Source§fn admits(&self, left: StateId, span: &Span) -> bool
fn admits(&self, left: StateId, span: &Span) -> bool
Sound hard filter consulted at candidate-construction time: return
false iff (left, right) provably has zero outside weight (it can
appear in no valid completion), so the A* loop may skip building the edge
entirely rather than merely deprioritizing it. Read moreSource§fn estimate_if_admitted(&self, left: StateId, span: &Span) -> Option<f64>
fn estimate_if_admitted(&self, left: StateId, span: &Span) -> Option<f64>
Return the outside estimate when the product is admitted, and
None
when it is provably unable to occur in an accepting derivation. Read moreSource§fn memoize_admission(&self) -> bool
fn memoize_admission(&self) -> bool
Whether A* should memoize the admission decision by product pair. Read more
Source§impl StateUniverse for StringDecompositionAutomaton
impl StateUniverse for StringDecompositionAutomaton
Source§fn all_states(&self, out: &mut dyn FnMut(Span))
fn all_states(&self, out: &mut dyn FnMut(Span))
Report every state in the finite universe exactly once.
Auto Trait Implementations§
impl Freeze for StringDecompositionAutomaton
impl RefUnwindSafe for StringDecompositionAutomaton
impl Send for StringDecompositionAutomaton
impl Sync for StringDecompositionAutomaton
impl Unpin for StringDecompositionAutomaton
impl UnsafeUnpin for StringDecompositionAutomaton
impl UnwindSafe for StringDecompositionAutomaton
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more