mmi_parser

Struct AaOutput

Source
pub struct AaOutput {
    pub id: String,
    pub abbreviation_type: AbbreviationType,
    pub short_form: String,
    pub long_form: String,
    pub short_token_count: i32,
    pub short_character_count: i32,
    pub long_token_count: i32,
    pub long_character_count: i32,
    pub positional_info: AaPosInfo,
}
Expand description

Main “Secondary” struct of program Acronyms and Abbreviations detected by MetaMap

Fields§

§id: String

Unique identifier

§abbreviation_type: AbbreviationType

Abbreviation type: either MetaMap defined or User-defined

§short_form: String

Short form of the acronym/abbreviation

§long_form: String

Long form or expansion

§short_token_count: i32

number of tokens (including whitespace) in short form

§short_character_count: i32

number of characters in short form

§long_token_count: i32

number of tokens (including whitespace) in long form

§long_character_count: i32

number of characters in long form

§positional_info: AaPosInfo

starting position of short form followed by “:” followed by character length of short form

Implementations§

Source§

impl AaOutput

Source

pub fn assemble(parts: HashMap<&str, &str>) -> Result<Self, Box<dyn Error>>

Parses a hashmap into AaOutput field types. Utilizes all other functionality defined in this module to assemble/parse each field into its appropriate format and types.

While this function is useful for building AaOutput types, parse_record will probably be much more practical since it accepts a string reference and does the field tagging/mapping for you.

Trait Implementations§

Source§

impl Debug for AaOutput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AaOutput

Source§

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 PartialEq for AaOutput

Source§

fn eq(&self, other: &AaOutput) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AaOutput

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for AaOutput

Source§

impl StructuralPartialEq for AaOutput

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,