Struct sdml_core::model::ControlledLanguageString
source · pub struct ControlledLanguageString { /* private fields */ }
Expand description
Corresponds to the grammar rule informal_constraint
.
This structure captures an informal, or semi-formal constraint as a natural language string string.
"some cars have manual transmissions"
is an informal constraint in some unidentified natural language."some cars have manual transmissions"@en
is an informal constraint in English."there is a car that has a a:manual transmission."@en-ACE
is a semi-formal constraint in Attempto Controlled English (ACE).
We classify the last example as semi-formal, even though ACE is formally defined,
because SDML does not expect (although does not prohibit) the translation from this form into
the logical structure of a ConstraintSentence
.
In the last example above the prefix a:
on manual identifies the term manual it as an
adjective applied to the word term transmission.
Implementations§
source§impl ControlledLanguageString
impl ControlledLanguageString
pub fn new<S>(value: S, language: ControlledLanguageTag) -> Selfwhere S: Into<String>,
pub fn with_ts_span(self, ts_span: Span) -> Self
pub fn has_ts_span(&self) -> bool
pub fn ts_span(&self) -> Option<&Span>
pub fn set_ts_span(&mut self, span: Span)
pub fn unset_ts_span(&mut self)
pub fn value(&self) -> &String
pub fn set_value(&mut self, value: String)
pub fn language(&self) -> Option<&ControlledLanguageTag>
pub fn set_language(&mut self, language: ControlledLanguageTag)
pub fn unset_language(&mut self)
Trait Implementations§
source§impl Clone for ControlledLanguageString
impl Clone for ControlledLanguageString
source§fn clone(&self) -> ControlledLanguageString
fn clone(&self) -> ControlledLanguageString
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ControlledLanguageString
impl Debug for ControlledLanguageString
source§impl<'de> Deserialize<'de> for ControlledLanguageString
impl<'de> Deserialize<'de> for ControlledLanguageString
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<ControlledLanguageString> for ConstraintBody
impl From<ControlledLanguageString> for ConstraintBody
source§fn from(v: ControlledLanguageString) -> Self
fn from(v: ControlledLanguageString) -> Self
Converts to this type from the input type.
source§impl From<String> for ControlledLanguageString
impl From<String> for ControlledLanguageString
Auto Trait Implementations§
impl RefUnwindSafe for ControlledLanguageString
impl Send for ControlledLanguageString
impl Sync for ControlledLanguageString
impl Unpin for ControlledLanguageString
impl UnwindSafe for ControlledLanguageString
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