pub struct HashedMemory(_);
Expand description

A translation memory optimized in a BinaryTree datastructure for performant analysis Most functions defined in this struct have a segment and a hash variant. This is for convenience only, the segment variants simply make use of the included hashing implementation.

Implementations

Add a segment to the memory [O(log(n)]

Adds the hash of a segment to the memory [O(log(n)]

Delete a segment from the memory [O(log(n)]

Checks to see if a segment exists in the memory [O(log(n)]

Checks to see if the hash of a segment exists in the memory [O(log(n)]

Instantiate a new empty HashedMemory

Merge a second memory into this memory

Create a HashedMemory from a .tmx file binary.

Examples
let mut memfile = File::open("files/mem.tmx").unwrap();
let mut memciphertext = Vec::new();
memfile.read_to_end(&mut memciphertext).unwrap();  

let memory = HashedMemory::from_tmx(&memciphertext).unwrap();
Errors

MemoryParseError: Can be caused by invalid .tmx files. F.e. because the tmx lacks a header or srclang. Other errors: When parsing the .tmx file failed for other reasons.

Trait Implementations

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.