Documentation and better support for deserialization in bisimilarity

This commit is contained in:
elvis
2025-07-16 18:03:31 +02:00
parent 23ce9c3488
commit 567850f013
2 changed files with 39 additions and 9 deletions

View File

@ -33,6 +33,19 @@ impl Default for Translator {
}
}
impl PartialEq for Translator {
fn eq(&self, other: &Self) -> bool {
for (s, id) in self.strings.iter() {
match other.strings.get(s) {
None => return false,
Some(id2) if id != id2 => return false,
_ => {}
}
}
true
}
}
impl Translator {
/// converts a string into an id
pub fn encode(&mut self, s: impl Into<String>) -> IdType {