Struct programinduction::pcfg::Rule
source · pub struct Rule {
pub name: &'static str,
pub production: Type,
pub logprob: f64,
}
Expand description
A PCFG rule specifies a production that can happen for a particular nonterminal.
A rule associates a production name with a production type. Rules that are not arrows are terminals for the supplied nonterminal type. Rules that are arrows expand nonterminals that correspond to the arrow’s return type.
Log-probabilities are normalized when initializing a Grammar
.
Fields§
§name: &'static str
§production: Type
§logprob: f64
Implementations§
Trait Implementations§
source§impl Ord for Rule
impl Ord for Rule
source§impl PartialEq for Rule
impl PartialEq for Rule
source§impl PartialOrd for Rule
impl PartialOrd for Rule
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Rule
Auto Trait Implementations§
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.