1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};

/// An entity is a text with a label
///
/// This object is used to hold the label used to
/// annotate the text.
#[derive(Eq, Hash, Serialize, Deserialize, Clone, Debug)]
pub struct Entity {
    pub name: String,
    pub label: String,
}

impl PartialEq for Entity {
    fn eq(&self, other: &Self) -> bool {
        self.name == other.name && self.label == other.label
    }
}